From dcc18b6d6f77b60211c54e82a9a708fc04cee207 Mon Sep 17 00:00:00 2001 From: Andrey Hristov Date: Sat, 6 Aug 2005 16:15:53 +0000 Subject: [PATCH] fix problem on 64 bit - when asking for "l" supply long not int because on 64 bit they differ and zend_parse_parameters makes a *(long*) cast which means that if the variable is int 4 bytes of the variable(s) declared before it (on the stack) will be overwritten. In this case this is the length of the query -> made 0 and mysqli_query() returns FALSE. --- ext/mysqli/mysqli_nonapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index 63979d980a..7387b2e60b 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -213,7 +213,7 @@ PHP_FUNCTION(mysqli_query) MYSQL_RES *result; char *query = NULL; unsigned int query_len; - unsigned int resultmode = 0; + unsigned long resultmode = 0; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|l", &mysql_link, mysqli_link_class_entry, &query, &query_len, &resultmode) == FAILURE) { return; -- 2.50.1