Commit Graph

163 Commits

Author SHA1 Message Date
Antony Dovgal
b7f2d8f17e MFH: fix possible crash in free_statement() 2006-08-23 19:15:57 +00:00
Ilia Alshanetsky
43fca8a3f8 Fixed bug #38394 (PDO fails to recover from failed prepared statement
execution).
2006-08-09 14:45:00 +00:00
Ilia Alshanetsky
2b5a53d6b6 Fixed memory leak on unused bound name parameters. 2006-08-01 15:06:01 +00:00
Ilia Alshanetsky
c6ace95236 Fixed bug #37445 (Fixed crash in pdo_mysql resulting from premature object
destruction).
2006-07-31 20:18:11 +00:00
Antony Dovgal
168f53b72b fix bug #38253 (PDO produces segfault with default fetch mode)
add test
2006-07-30 11:19:56 +00:00
Antony Dovgal
3ff986ecf7 init vatiables 2006-06-20 13:26:01 +00:00
Antony Dovgal
e4a3732c91 no need to call zend_is_callable() if callable is known to be invalid
free fname on failure and plug possible leak
2006-05-30 09:46:59 +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
Antony Dovgal
ea53739d30 MFB: don't segfault if an exception has been thrown from the fetch handler 2006-04-22 19:10:53 +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
Antony Dovgal
08e6fded56 prevent possible NULL dereference 2006-03-28 20:19:44 +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
Ilia Alshanetsky
4ccd89d147 Properly calculate the size of the result array. 2006-03-19 17:35:36 +00:00
Antony Dovgal
5c7c11c41d MFH: check stream for NULL before writing to it
remove unnecessary semicolons
2006-03-18 22:24:05 +00:00
Ilia Alshanetsky
92ba7cccad Fixed memory leak on unused bind var. 2006-03-15 15:25:50 +00:00
Marcus Boerger
1d461a6bcc - MFH 2006-01-22 23:57:41 +00:00
Ilia Alshanetsky
64a7e46506 Fixed bug #35797 (segfault on PDOStatement::execute() with
zend.ze1_compatibility_mode = On).
2006-01-01 20:07:41 +00:00
foobar
5bd93221a8 bump year and license version 2006-01-01 12:51:34 +00:00
Ilia Alshanetsky
b83a0eb10c Fixed memory corruption when FETCH_LAZY mode is being used. 2005-12-17 20:00:00 +00:00
Ilia Alshanetsky
bdf9c4d15c Fixed bug #35694 (Improved error message for invalid fetch mode). 2005-12-15 22:33:02 +00:00
foobar
3e669bc950 MFH: nuke php3 legacy 2005-12-06 02:28:41 +00:00
Antony Dovgal
06c57b7d55 tweak fix a bit
(by request of Wez)
2005-12-01 20:39:12 +00:00
Antony Dovgal
59087fee52 MFH: fix #35508 (PDO fails when unknown fetch mode specified) 2005-12-01 19:59:58 +00:00
Wez Furlong
63dae4ee74 Fix #35431; LAZY fetch and fetchAll == crash.
Lazy makes no sense with fetchAll; disallow it.
2005-11-27 21:01:58 +00:00
Antony Dovgal
6543134dea MFH: fix #35430 (PDO crashes on incorrect FETCH_FUNC use) 2005-11-27 21:01:02 +00:00
Wez Furlong
426fb96cc9 Doh, need to canonicalize parameter names (by prefixing with :) before
attempting to remap them to positional args.
2005-11-26 21:20:52 +00:00
Wez Furlong
2618322506 Bug: when stringify fetch mode is on, and the driver returns a string instead
of a stream for a LOB parameter, PDO would incorrectly return NULL for that
column.
2005-11-25 03:23:17 +00:00
Wez Furlong
c2d53719c2 Fix for #35332.
The problem is caused by the user mixing positional and named parameters.
PDO was blindly adding the parameters, unaware that the same parameters were
already allocated by position.

What we do now is register the parameter with the driver before adding it to
any hash.  This gives the driver an opportunity to normalize the name and
parameter number.  PDO can then ensure that only one entry is occupied in the
hash for a given parameter.
2005-11-25 00:29:04 +00:00
Ilia Alshanetsky
8e49bacf95 Fixed bug #35358 (Incorrect error messages for PDO class constants). 2005-11-24 16:21:43 +00:00
Wez Furlong
0bd9518f8c Closes PECL #5944; binding an invalid parameter can lead to segfaults.
Modified patch provided by curt@php.net.
2005-11-16 06:32:33 +00:00
Ilia Alshanetsky
8e2de517bb Fixed bug #35135 (PDOStatment without related PDO object may crash). 2005-11-07 16:53:15 +00:00
Marcus Boerger
24a80c3ebf - Fix remaining memleaks
# all tests pass for me now for the first time in:
# pgsql, mysql, sqlite, sqlite2
2005-10-31 07:47:40 +00:00
Wez Furlong
b74698f135 fix misinterpretation of data when overriding types via bindColumn.
Very slightly modified patch from Marcus.
2005-10-31 03:23:38 +00:00
Wez Furlong
40c24a65c4 improve test portability.
improve infrastructure for LOB support.
2005-10-31 02:07:38 +00:00
Marcus Boerger
e7494a7e9e - Fix memleak 2005-10-30 22:17:52 +00:00
Wez Furlong
0139cd0e53 Closes PECL Bug #5772; FETCH_FUNC broken for mixed case function names 2005-10-29 03:11:46 +00:00
Wez Furlong
7af8089096 Closes PECL #5809; PDOStatement::execute(array(...)) would modify its args.
It should behave like bindValue() not bindParam().
2005-10-29 03:01:19 +00:00
Ilia Alshanetsky
6b46a441cd Fixed compiler warning 2005-10-25 03:53:25 +00:00
Ilia Alshanetsky
a5fe9808aa MFH: Fixed bug #34809 (FETCH_INTO in PDO crashes without a destination object). 2005-10-10 14:44:16 +00:00
Marcus Boerger
f3c44f6065 - MFH Fixed Bug #34590 User defined PDOStatement class can't implement
methods
- Reimplement Traversable interface
# If there is a problem with this i need a backtrace. As far as i can
# tell by gdb/valgrind/logic there is no error here. But missuse leads to
# the same error report casing the exclusion of interface Traversable.
2005-09-21 22:58:39 +00:00
Wez Furlong
8dc3e7b147 When populating bound columns, override the returned type with the type
specified by the user in their bind.
2005-09-11 20:32:28 +00:00
Wez Furlong
81151a5dbf remove traversable interface; apparently it's not enough, and this stuff is too
magical to figure out wtf should be added.
2005-09-11 14:27:10 +00:00
Wez Furlong
9c252b4b07 closes PECL #5027; PDO_FETCH_NAMED not handled via setFetchMode(). 2005-09-10 19:32:15 +00:00
Wez Furlong
efe24c0205 add __sleep and __wakeup functions to prevent serialize/deserialize from being used on PDO objects. Refs PECL #5217 2005-09-10 17:48:45 +00:00
Wez Furlong
0730fa2af9 Add PDOStatement::bindValue(), which is similar to bindParam(), except that
it binds the value of the zval at the time it is called, rather than keeping
a reference to the zval and taking the value at execute() time.
2005-09-10 15:32:04 +00:00
George Schlossnagle
248c30dad7 MFH. Protect against underflow - refs http://pecl.php.net/bugs/bug.php?id=5193 2005-09-01 14:44:11 +00:00
Ilia Alshanetsky
ecc34bddcc Fixed memory leak. 2005-08-03 18:26:16 +00:00
Wez Furlong
bf85bf515e add sanity checks 2005-07-27 14:18:01 +00:00
Marcus Boerger
d8eece2b43 - Add missing part to make colon in parameter binding optional 2005-07-22 14:31:20 +00:00
Wez Furlong
cfe1dc3b46 this looks like a much better fix for refcounting/shutdown in lazy objects. 2005-07-22 04:33:56 +00:00