Commit Graph

105 Commits

Author SHA1 Message Date
Xinchen Hui
a16a6eae24 Refactor PDO (incompleted) 2014-04-16 17:28:11 +08:00
Xinchen Hui
c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Matteo Beccati
5c06e5c2e0 Fixed compiler warning
I moved the constant to the enum in order to avoid this:
ext/pgsql/pgsql.c:3491: warning: comparison is always false due to limited range of data type

Works in gcc 4.6, but I'm not sure about other compilers.
2013-08-21 11:22:32 +02:00
Stanislav Malyshev
ac40c0b562 Merge branch 'pull-request/341'
* pull-request/341: (23 commits)
  typofixes
2013-06-10 14:20:18 -07:00
Xinchen Hui
0a7395e009 Happy New Year 2013-01-01 16:28:54 +08:00
Xinchen Hui
e4a8fa6a15 Merge branch 'PHP-5.3' into PHP-5.4 2012-10-09 13:29:51 +08:00
Xinchen Hui
6284ef112e Fixed bug #63236 (Executable permission on various source files) 2012-10-09 13:28:31 +08:00
Felipe Pena
e4ca0ed09f - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena
4e19825281 - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena
927bf09c29 - Year++ 2011-01-01 02:19:59 +00:00
Felipe Pena
0203cc3d44 - Year++ 2011-01-01 02:17:06 +00:00
Kalle Sommer Nielsen
e71ee33358 Fixed bug #51943 (Several files are out of ANSI spec)
# Based on patch by CoreyStup at gmail dot com
2010-07-13 23:59:54 +00:00
Kalle Sommer Nielsen
aeb1dc7cc4 Fixed bug #51943 (Several files are out of ANSI spec)
# Based on patch by CoreyStup at gmail dot com
2010-07-13 23:59:54 +00:00
Ilia Alshanetsky
24b8bc3489 Removed the in_transaction handler for 5.3 to avoid BC break due to structure change 2010-06-15 11:13:20 +00:00
Ilia Alshanetsky
90906a91e9 Added inTransaction() method to PDO, with specialized support for Postgres 2010-06-10 12:11:19 +00:00
Ilia Alshanetsky
6ed1819bf4 Added inTransaction() method to PDO, with specialized support for Postgres 2010-06-10 12:11:19 +00:00
Dmitry Stogov
77b2e54658 Fixed PDO objects binary incompatibility 2010-05-06 08:37:41 +00:00
Sebastian Bergmann
9ba1e81665 sed -i "s#1997-2009#1997-2010#g" **/*.c **/*.h **/*.php 2010-01-03 09:23:27 +00:00
Sebastian Bergmann
08659c2dcd MFH: Bump copyright year, 3 of 3. 2008-12-31 11:15:49 +00:00
Johannes Schlüter
be0793d2e7 MFH: Add mysqlnd support for PDO_mysql, fixes at least bug#41997,#42499,
pecl#12794, pecl#12401

# Running the tests:
# (Note: Doesn't work currnetly on HEAD, see:
#  http://news.php.net/php.qa/64378)
#
#  PDO_MYSQL_TEST_DSN  - DSN
#    For example: mysql:dbname=test;host=localhost;port=3306
#
#  PDO_MYSQL_TEST_HOST    - database host
#  PDO_MYSQL_TEST_DB      - database (schema) name
#  PDO_MYSQL_TEST_SOCKET  - database server socket
#  PDO_MYSQL_TEST_ENGINE  - storage engine to use
#  PDO_MYSQL_TEST_USER    - database user
#  PDO_MYSQL_TEST_PASS    - database user password
#  PDO_MYSQL_TEST_CHARSET - database charset
#
#  NOTE: if any of PDO_MYSQL_TEST_[HOST|DB|SOCKET|ENGINE|CHARSET] is
#  part of PDO_MYSQL_TEST_DSN, the values must match. That is, for example,
#  for PDO_MYSQL_TEST_DSN = mysql:dbname=test you MUST set PDO_MYSQL_TEST_DB=test.
2008-07-21 13:09:28 +00:00
Sebastian Bergmann
d1dded8751 MFH: Bump copyright year, 2 of 2. 2007-12-31 07:17:19 +00:00
Jani Taskinen
dcd3b197e7 MFH:- Fixed bug #43365 (Several enums have trailing commas) 2007-11-26 10:59:04 +00:00
Dmitry Stogov
6c810b0d4c Improved memory usage by movig constants to read only memory. (Dmitry, Pierre) 2007-09-27 18:00:48 +00:00
Jani Taskinen
5b71d45eff MFH: sync 2007-07-23 11:53:58 +00:00
Ilia Alshanetsky
efd7846d34 [DOC] Added PDO::FETCH_KEY_PAIR mode that will fetch a 2 column result set
into an associated array.
2007-05-16 19:33:57 +00:00
Sebastian Bergmann
4223aa4d5e MFH: Bump year. 2007-01-01 09:36:18 +00:00
Antony Dovgal
5e34f6cf9e MFH 2006-09-28 23:27:59 +00:00
Antony Dovgal
d6eb64344d MFH 2006-09-28 23:03:56 +00:00
Marcus Boerger
7bbab02633 - MFH
. Fix iterator based access
  . Add new attribute ATTR_DEFAULT_FETCH_MODE: $bdh->setAttribute()
  . Add new fetch mode: FETCH_PROPS_LATE, this fills object member
    variables after calling the constructor (fixes #36428).
2006-05-11 22:43:44 +00:00
Wez Furlong
687e6ffc58 Add "ATTR_EMULATE_PREPARES" general attribute to replace the custom
attributes employed by mysql and postgres drivers.
No functional change.
2006-04-09 08:05:01 +00:00
Wez Furlong
fb7d5bd780 The fix for #35332 caused #35671 (and thus PECL #6504).
Partially back out that fix and introduce an extra optional step for drivers to
canonicalize the "name" that is used for registering parameters.
2006-03-27 20:51:01 +00:00
foobar
5bd93221a8 bump year and license version 2006-01-01 12:51:34 +00:00
foobar
3e669bc950 MFH: nuke php3 legacy 2005-12-06 02:28:41 +00:00
Wez Furlong
d0ea27b802 API for connection dependent objects to add/del refs to dbh's. 2005-11-28 05:23:22 +00:00
Wez Furlong
40c24a65c4 improve test portability.
improve infrastructure for LOB support.
2005-10-31 02:07:38 +00:00
Antony Dovgal
a9cac89541 MFH: commit forgotten part 2005-10-27 19:39:38 +00:00
Antony Dovgal
2af3190a3d use correct enum type for the arg 2005-10-25 16:02:33 +00:00
Wez Furlong
a750f195cd Fix Bug #34687; error information from query() not passed back 2005-10-02 22:11:19 +00:00
Marcus Boerger
ca9dd7d826 - Add PDO::setAttribute(PDO::ATTR_STATEMENT_CLASS) 2005-10-02 20:07:11 +00:00
Edin Kadribasic
35b7ad00a6 Declare functions used by driver as PDO_API in php_pdo_driver.h 2005-09-24 14:18:01 +00:00
Ilia Alshanetsky
97e8c6f4a9 Proper handling for databases that need to pre-calculate length of large
columns, which is not normally done for performance reasons.
2005-07-20 03:38:33 +00:00
Wez Furlong
664ebfa499 expand oracle null handling compatability by offering the ability to convert
NULLs into empty strings as well as the other way around.  It still doesn't
help a great deal in the long run, but at least the option is there.

Make sure hash tables are nulled out to avoid double freeing them.
2005-07-12 02:40:59 +00:00
Wez Furlong
d3b653e97b Added:
proto bool PDOStatement::closeCursor()
Closes the cursor, leaving the statement ready for re-execution.

The purpose of the function is to free up the connection to the server so that
other queries may be issued, but leaving the statement in a state that it can
be re-executed.

This is implemented either as an optional driver specific method (allowing for
maximum efficiency), or as the generic PDO fallback if no driver specific
function is installed.

The PDO generic fallback is semantically the same as writing the following code
in your PHP script:

do {
	while ($stmt->fetch())
		;
	if (!$stmt->nextRowset())
		break;
} while (true);
2005-07-09 03:52:41 +00:00
Wez Furlong
7976182b94 Fix Bug #33111 2005-07-08 19:28:52 +00:00
Wez Furlong
ab1ba644db add a bit of a hack to cater for pgsql prepared statements.
These are effectively named statements with strong constraints on the naming
format.  We cater for this in a fairly generic way: allow a driver to replace
the format string we use to generate names from positional parameters.  In
addition, if that format is set, we always force a rewrite from regular names
to the strongly enforced names.
2005-07-08 15:24:21 +00:00
Wez Furlong
49c1882837 Add a PDO_ATTR_STRINGIFY_FETCHES attribute, which is used to convert integer or
floating point values into strings during fetch.  This is a compatibility hack
for drivers that return native types rather than string representations.

We use this flag in the test suite to persuade postgres tests to pass.
2005-07-08 04:13:00 +00:00
Wez Furlong
294a44a9cb add an attribute for returning the driver name 2005-07-07 16:24:51 +00:00
Wez Furlong
d4a158260b Add PDO_FETCH_NAMED; closes PECL #4641 by providing a way to access columns
by name, even when multiple columns have the same name:

$sql = "SELECT 1 a, 2 a, 3 b, 4 c, 5 d, 6 c, 7 a";
echo "$sql\n";
print_r($db->query($sql)->fetchAll(PDO_FETCH_NAMED));

Array
(
    [0] => Array
        (
            [a] => Array
                (
                    [0] => 1
                    [1] => 2
                    [2] => 7
                )

            [b] => 3
            [c] => Array
                (
                    [0] => 4
                    [1] => 6
                )

            [d] => 5
        )
)

Also added two new attributes for use at prepare time;
PDO_ATTR_FETCH_TABLE_NAMES and PDO_ATTR_FETCH_CATALOG_NAMES instruct the driver
that the names of the columns that they return to PDO should include the table
and catalog names respectively.  Both attributes may be used together or
independently.  The catalog, table and column name components should be
separated by a . character.
2005-07-03 03:49:44 +00:00
Wez Furlong
49e7b3da4c Fix a dumb bug that would effecively ignore persistent connections and create a
new one each time.

Add a hook for persistent connections: it is called when the object goes out of
scope, and offers the driver an opportunity to release per-request scoped data
at the right time.

This hook is used by pdo_sqlite to unregister UDFs, which are dangerous to keep
registered between requests.
2005-06-10 05:47:55 +00:00
Ilia Alshanetsky
fa0e534f83 Various compiler warning fixes. 2005-05-18 22:40:56 +00:00