Author: jschlueter
Date: 2008-04-09 14:59:47 +0200 (Wed, 09 Apr 2008)
New Revision: 1408
Modified:
trunk/php5/ext/pdo_mysqlnd/mysql_statement.c
Log:
- Return NULL as NULL (Mantis #359)
Modified: trunk/php5/ext/pdo_mysqlnd/mysql_statement.c
===================================================================
--- trunk/php5/ext/pdo_mysqlnd/mysql_statement.c 2008-04-09 12:16:18 UTC (rev 1407)
+++ trunk/php5/ext/pdo_mysqlnd/mysql_statement.c 2008-04-09 12:59:47 UTC (rev 1408)
@@ -609,24 +609,26 @@
}
#if PDO_USE_MYSQLND
if (S->stmt) {
- /*
- TODO: PDO's fetch expects to get a string, so we cast to
- string here at the moment
- */
- convert_to_string(S->result_bind[colno].zv);
switch (Z_TYPE_P(S->result_bind[colno].zv)) {
case IS_NULL:
*ptr = NULL;
*len = 0;
return 1;
+ case IS_LONG:
+ convert_to_string(S->result_bind[colno].zv);
+ /* fall-through */
case IS_STRING:
*len = Z_STRLEN_P(S->result_bind[colno].zv);
*ptr = estrndup(Z_STRVAL_P(S->result_bind[colno].zv), *len);
return 1;
+/*
+TODO: PDO's fetch expects to get a string, so we cast to string here at the moment
+ Would probably better to return a proper type when possible
case IS_LONG:
*ptr = (char*)Z_LVAL_P(S->result_bind[colno].zv);
*len = sizeof(long);
return 1;
+*/
default:
printf("Invalid type: %i", Z_TYPE_P(S->result_bind[colno].zv));
return 0;
| Thread |
|---|
| • PHP mysqlnd svn commit: r1408 - trunk/php5/ext/pdo_mysqlnd | jschlueter | 9 Apr |