]> granicus.if.org Git - php/commitdiff
Fix for MySQL Bug #49406
authorAndrey Hristov <andrey@php.net>
Mon, 30 Aug 2010 18:10:23 +0000 (18:10 +0000)
committerAndrey Hristov <andrey@php.net>
Mon, 30 Aug 2010 18:10:23 +0000 (18:10 +0000)
Binding params doesn't work when selecting a date inside a CASE-WHEN
(http://bugs.mysql.com/bug.php?id=49406)
The MySQL server sends MYSQL_TYPE_NEWDATE values as clear text, even
when PS are used and thus the binary protocol are used. Changing the
handler for the type.

ext/mysqlnd/mysqlnd_ps_codec.c

index a0e6c0050e3c8c92f569d081d5e81fc1e66c0aa9..dd6f7a620c306a04d264ac6b148206d951225347 100644 (file)
@@ -493,7 +493,7 @@ void _mysqlnd_init_ps_fetch_subsystem()
        mysqlnd_ps_fetch_functions[MYSQL_TYPE_DATE].php_type    = IS_STRING;
        mysqlnd_ps_fetch_functions[MYSQL_TYPE_DATE].can_ret_as_str_in_uni       = TRUE;
 
-       mysqlnd_ps_fetch_functions[MYSQL_TYPE_NEWDATE].func             = ps_fetch_date;
+       mysqlnd_ps_fetch_functions[MYSQL_TYPE_NEWDATE].func             = ps_fetch_string;
        mysqlnd_ps_fetch_functions[MYSQL_TYPE_NEWDATE].pack_len = MYSQLND_PS_SKIP_RESULT_W_LEN;
        mysqlnd_ps_fetch_functions[MYSQL_TYPE_NEWDATE].php_type = IS_STRING;
        mysqlnd_ps_fetch_functions[MYSQL_TYPE_NEWDATE].can_ret_as_str_in_uni    = TRUE;