needed to move to a new structure MYSQLND_STMT. Makes
the code cleaner and less error-prone.
Also fix PDO/MySQL which directly touch mysqlnd internals
instead of using API calls.
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.
We're responsible for gobbling up supplemental result sets in closeCursor()
(which is what PDO does for us if we didn't implement our own closer routine).
as destroying the prepared statement handler, so we're leaking and breaking, as
can be seen by running the test suite.
brown paper bag for PDO in PHP 5.1RC4?
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.
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.
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