Commit Graph

50 Commits

Author SHA1 Message Date
Marcus Boerger
b47525e508 - TSRM fix 2005-09-29 19:57:13 +00:00
Wez Furlong
fdd42afa6c Fixup LOB handling for inserts (refs #34630).
Also tripped over the return of PECL #5200; looks like mysql doesn't return an
accurate length for the columns.  The PDO driver will sanity check the real
length against the buffer size it allocated (based on the info provided by
mysql), so that we won't overrun the buffer.  In addition, if a varchar field
is reported as having a length of less than 128, we'll allocate 128 just in
case.

If the data is truncated, report it via the appropriate sqlstate code.

There must be a better way to do this stuff.
2005-09-25 02:05:03 +00:00
Ilia Alshanetsky
156a899e4a MFH: Fixed bug #34001 (pdo_mysql truncates numberic fields at 4 chars) 2005-09-01 01:57:01 +00:00
Ilia Alshanetsky
99d8090cb2 Fixed memory corruption (wrong order of operations of stored prep. stmt).
Optimize the max length calculation process.
2005-07-20 04:30:14 +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
Ilia Alshanetsky
9438584d76 Only set attribute if result set contains some columns. 2005-07-20 02:36:34 +00:00
Ilia Alshanetsky
1e1d2e2b0d clean up 2005-07-20 02:19:20 +00:00
Wez Furlong
8adbc92d4b this hack can and does segv; let's remove it. 2005-07-20 01:59:14 +00:00
Wez Furlong
fc48f9096d gah! 2005-07-14 02:20:52 +00:00
Wez Furlong
0601249f82 it is not an error for a statement to return 0 rows.
Andrey: please run the test suite before each commit!
This broke beta 3 and was clearly visible as a result of running the tests.

Running further tests now.
2005-07-14 02:03:54 +00:00
Andrey Hristov
8899425e26 strictly check the result of mysql_affected_rows() 2005-07-12 19:22:05 +00:00
Andrey Hristov
31de8e9018 stmt->column_count is set only if the result has been already bound, don't
rely on that and use the real count which is kept in st_mysql_stmt
#of course using internal values is bad idea but the comment already says
#that this should be fixed
2005-07-10 02:58:51 +00:00
Andrey Hristov
55ab9b75a6 ok, calculate max_length only in case of a blob (normal, medium, long).
in case of a varchar lets allocate 255 bytes and be quick without asking
libmysql to update max_length
2005-07-10 02:49:14 +00:00
Andrey Hristov
2711d70d33 if the result set is buffered ask libmysql to compute the lengths, so
later allocate buffer as big as the largest value of the column in the
result set (max_legth positive).
2005-07-10 02:20:26 +00:00
Wez Furlong
5602a5ba65 Get precise lengths from the server, as suggested by Andrey. 2005-07-10 02:00:35 +00:00
Ilia Alshanetsky
eb4aff5a91 Added safety checks. 2005-07-09 05:08:54 +00:00
Ilia Alshanetsky
4c18dfc852 Make cursor closer work with emulation as well. 2005-07-09 05:04:43 +00:00
Ilia Alshanetsky
df60983b75 Added missing header check. 2005-07-09 04:43:16 +00:00
Ilia Alshanetsky
c58e878513 Implement cursor_closer for MySQL driver. 2005-07-09 04:30:49 +00:00
Ilia Alshanetsky
ba66cac1cf Fixed memory leak 2005-07-09 04:21:14 +00:00
Wez Furlong
c2f3636cf2 Fix two bugs:
- execute() would not re-fetch meta data after nextRowset() had been called.

- buffered mode would only be enabled on the first execute on a statement handle.
2005-07-09 03:54:13 +00:00
Ilia Alshanetsky
e7b930ea9a Make prepared statements obey buffering flag in MySQL. 2005-07-07 17:53:34 +00:00
Ilia Alshanetsky
307f622817 Fixed memory leak. 2005-07-07 15:54:00 +00:00
Wez Furlong
d7e5dfb2de Enable native mysql 4.1.x prepared statement support
# the hardest part was installing 4.1.x on a gentoo box over a 56k modem
2005-07-03 02:20:08 +00:00
Wez Furlong
1bbab25455 Experimental support for queries returning multiple rowsets under mysql 5.0.
Patch from Guy Harrison (guy dot a dot harrison (at) gmail dot com)
2005-07-02 21:01:38 +00:00
Ilia Alshanetsky
348c0cddae Added PDO_MYSQL_ATTR_USE_BUFFERED_QUERY parameter for pdo_mysql, to toggle
usage of buffered queries.
2005-06-24 19:45:59 +00:00
Ilia Alshanetsky
fa0e534f83 Various compiler warning fixes. 2005-05-18 22:40:56 +00:00
Ilia Alshanetsky
569138e0c0 removed unused var. 2005-04-19 20:53:54 +00:00
foobar
0e57528666 No c++ comments in C code 2005-04-19 11:41:04 +00:00
Hartmut Holzgraefe
f7e8fcb8e0 fully distinguish between database and statement level errors 2005-02-27 20:34:36 +00:00
Hartmut Holzgraefe
dd7d41e938 use fetch_fields only once and remember the result 2005-02-27 12:43:23 +00:00
Hartmut Holzgraefe
04f2f981e0 changed the error checks on result set retrieval
UPDATEs not modifying anything are not actually bugs
2005-02-27 12:15:47 +00:00
Hartmut Holzgraefe
81770f3c39 no need to check for execution status, always free a result set if there
is one
2005-02-27 12:05:46 +00:00
Hartmut Holzgraefe
beb7151936 cols 2005-02-27 11:46:38 +00:00
Hartmut Holzgraefe
8725ed75cd CS / whitespace 2005-02-27 11:42:18 +00:00
Hartmut Holzgraefe
fd39b78b39 fix for PECL bug #3529 2005-02-20 23:56:14 +00:00
Hartmut Holzgraefe
5f3dd68ac5 fix for PECL bug 3530 2005-02-20 23:08:34 +00:00
Ilia Alshanetsky
5904d59ffd Fixed compiler warnings. 2005-02-12 20:58:29 +00:00
Wez Furlong
d134fb2a8d update for api changes 2005-02-06 23:22:37 +00:00
Wez Furlong
be616317c7 stub out scrollable cursor change 2005-01-12 06:10:31 +00:00
Wez Furlong
e7a6eca69d rough cut at mysql meta data 2004-09-26 20:47:03 +00:00
Ilia Alshanetsky
ddb32b11b2 Fixed a bug that could result in false failed query reporting on
INSERT/UPDATE/DELETE queries.
2004-07-12 20:09:19 +00:00
Ilia Alshanetsky
40b04cd54b Correctly report errors for statment problems. 2004-05-20 16:13:13 +00:00
Ilia Alshanetsky
0d6aa20880 Error handling support.
Fixed possible crash when trying to fetch data from a failed query.
2004-05-20 15:51:25 +00:00
Wez Furlong
d55e20660b Don't dup here either 2004-05-20 10:30:29 +00:00
Marcus Boerger
0a242a52b3 - Allow to build with ext/mysqli 2004-05-19 20:57:02 +00:00
Ilia Alshanetsky
862247693f Row count cannot be calculated in MySQL without buffering the query. 2004-05-19 20:44:28 +00:00
Ilia Alshanetsky
56abe4de4a Prevent possible crash when working with column containing NULL. 2004-05-19 20:34:01 +00:00
Ilia Alshanetsky
074ba3fbc0 Added lastInsertId() method for retrieving last insert id.
Made affectedRows() work for MySQL.
Populate error value in MySQL on error.
2004-05-19 17:35:39 +00:00
George Schlossnagle
71728cc2b2 initial import of mysql 3.x pdo driver 2004-05-18 18:01:52 +00:00