Matteo Beccati [Tue, 4 Jun 2013 15:20:20 +0000 (17:20 +0200)]
Refactored custom PDO_pgsql methods to trigger errors/exceptions
BC Break: the custom methods were previously just return false on
failure. Now they throw an exception with a proper error message.
An hopefully welcome improvement, but some application might be
depending on the old behaviour. FWIW the PDO::pgsqlCopy* methods
are not documented, even though they are available since 5.3.x.
Matteo Beccati [Tue, 4 Jun 2013 14:49:16 +0000 (16:49 +0200)]
Allow PDO drivers custom methods to trigger errors/exceptions
Moved a few definitions from php_pdo_int.h to a new php_pdo_error.h
header file that can be included if drivers need PDO's own error
handling to be triggered within custom methods (e.g. PDO::pgsqlLOBOpen).
Return an error on passwords longer than 30 chars instead of segfault.
Set error and message handlers properly.
Do not segfault in out of bound colnums in getColumnMeta()
Fix DBSETOPT to use a blank string instead of NULL to stop FreeTDS complaints.
Use DBSETLDBNAME for compatibillity with SQL Azure.
Nikita Popov [Sun, 24 Mar 2013 16:52:16 +0000 (17:52 +0100)]
Fix PDO::inTransaction() test for pgsql
inTransaction() nowadays casts the in_transaction result to boolean.
I'm not sure whether the INERROR state should result in true or false.
For now I went with the result that we actually get.
Matteo Beccati [Sat, 1 Jun 2013 21:15:48 +0000 (23:15 +0200)]
Fixed bug #62857 (bytea test failures)
Postgres 9.1+ test fixes. Tests were failing due to the default
standard_conforming_strings GUC being changed to on. Also the
pg_escape_bytea test was encoding the data before estabilishing
a connection, thus falling back to the old escaping type which
isn't properly handled by the backend when using a default
configuration.
I haven't updated the NEWS file as it's just test fixes.
PDO DBLIB was returning false if there were no results after a
statement was executed. This should be the fetch methods response
not the execute method response.
FreeTDS will segfault when passwords over 30 characters are used.
Truncate the password and let the server return an error if the
password is still invalid.
PDO DBLIB would segfault on getcolumn meta when colno was
out of bounds. DBLIB connection specified null arg to dbsetopt
per Microsoft technical docs, but FreeTDS complains. The SQL USE
statement was invalid for SQL Azure, use DBSETLDBNAME instead.
Remi Collet [Fri, 31 May 2013 06:46:18 +0000 (08:46 +0200)]
Merge branch 'PHP-5.5'
* PHP-5.5:
NEWS
NEWS
Fixed Bug #64949 (Buffer overflow in _pdo_pgsql_error)
Use size_t everywhere instead
This needs to be a long Otherwise we are limited to a 32G opcache segment
Remi Collet [Fri, 31 May 2013 06:39:32 +0000 (08:39 +0200)]
Fixed Bug #64949 (Buffer overflow in _pdo_pgsql_error)
There is a lot of call such as:
pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, "Copy command failed");
Where the 3rd paramater is a error message string where a sqlstate (5 chars)
is expected. This cause a segfault in copy_from.phpt and copy_to.phpt.
This is only a sanity check to avoid buffer overflow, but obviously this
calls need to be fixed (using NULL or a correct sqlstate).
pdo_dblib: fix bug #64522DBLIB statement destructor was being called late and clobbered results from subsequent statement objects sharing the same connection
I wasn't able to produce a file causing exactly the same crash.
However the first three seconds of the originally reported
file are pretty enough to repro bug #64830. That reduces its
size to 72k.
Remi Collet [Tue, 21 May 2013 16:09:22 +0000 (18:09 +0200)]
Merge branch 'PHP-5.5'
* PHP-5.5:
Integer overflow in SndToJewish leads to php hang AT least in (inputDay is long, metonicCycle is int): metonicCycle = (inputDay + 310) / 6940;
Remi Collet [Tue, 21 May 2013 16:09:02 +0000 (18:09 +0200)]
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
Integer overflow in SndToJewish leads to php hang AT least in (inputDay is long, metonicCycle is int): metonicCycle = (inputDay + 310) / 6940;
Remi Collet [Tue, 21 May 2013 16:08:45 +0000 (18:08 +0200)]
Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
Integer overflow in SndToJewish leads to php hang AT least in (inputDay is long, metonicCycle is int): metonicCycle = (inputDay + 310) / 6940;