version 1.1, 2012/02/21 23:47:58
|
version 1.1.1.4, 2014/06/15 20:03:51
|
Line 2
|
Line 2
|
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| PHP Version 5 | |
| PHP Version 5 | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| Copyright (c) 1997-2012 The PHP Group | | | Copyright (c) 1997-2014 The PHP Group | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| This source file is subject to version 3.01 of the PHP license, | |
| This source file is subject to version 3.01 of the PHP license, | |
| that is bundled with this package in the file LICENSE, and is | |
| that is bundled with this package in the file LICENSE, and is | |
Line 384 mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval **
|
Line 384 mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval **
|
/* Changed to my_bool in MySQL 5.1. See MySQL Bug #16144 */ |
/* Changed to my_bool in MySQL 5.1. See MySQL Bug #16144 */ |
my_bool tmp; |
my_bool tmp; |
#else |
#else |
uint tmp = 0; | ulong tmp = 0; |
#endif |
#endif |
stmt->result.buf[ofs].type = IS_STRING; |
stmt->result.buf[ofs].type = IS_STRING; |
/* |
/* |
Line 535 PHP_FUNCTION(mysqli_change_user)
|
Line 535 PHP_FUNCTION(mysqli_change_user)
|
old_charset = mysql->mysql->charset; |
old_charset = mysql->mysql->charset; |
#endif |
#endif |
|
|
|
#if defined(MYSQLI_USE_MYSQLND) |
|
rc = mysqlnd_change_user_ex(mysql->mysql, user, password, dbname, FALSE, (size_t) password_len); |
|
#else |
rc = mysql_change_user(mysql->mysql, user, password, dbname); |
rc = mysql_change_user(mysql->mysql, user, password, dbname); |
|
#endif |
MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql); |
MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql); |
|
|
if (rc) { |
if (rc) { |
Line 883 void mysqli_stmt_fetch_libmysql(INTERNAL_FUNCTION_PARA
|
Line 887 void mysqli_stmt_fetch_libmysql(INTERNAL_FUNCTION_PARA
|
*/ |
*/ |
/* Even if the string is of length zero there is one byte alloced so efree() in all cases */ |
/* Even if the string is of length zero there is one byte alloced so efree() in all cases */ |
if (Z_TYPE_P(stmt->result.vars[i]) == IS_STRING) { |
if (Z_TYPE_P(stmt->result.vars[i]) == IS_STRING) { |
efree(stmt->result.vars[i]->value.str.val); | STR_FREE(stmt->result.vars[i]->value.str.val); |
} |
} |
if (!stmt->result.is_null[i]) { |
if (!stmt->result.is_null[i]) { |
switch (stmt->result.buf[i].type) { |
switch (stmt->result.buf[i].type) { |
Line 1047 PHP_FUNCTION(mysqli_stmt_fetch)
|
Line 1051 PHP_FUNCTION(mysqli_stmt_fetch)
|
/* {{{ php_add_field_properties */ |
/* {{{ php_add_field_properties */ |
static void php_add_field_properties(zval *value, const MYSQL_FIELD *field TSRMLS_DC) |
static void php_add_field_properties(zval *value, const MYSQL_FIELD *field TSRMLS_DC) |
{ |
{ |
add_property_string(value, "name", (char *) (field->name ? field->name : ""), 1); | add_property_string(value, "name",(field->name ? field->name : ""), 1); |
add_property_string(value, "orgname", (char *) (field->org_name ? field->org_name : ""), 1); | add_property_string(value, "orgname",(field->org_name ? field->org_name : ""), 1); |
add_property_string(value, "table", (char *) (field->table ? field->table : ""), 1); | add_property_string(value, "table",(field->table ? field->table : ""), 1); |
add_property_string(value, "orgtable", (char *) (field->org_table ? field->org_table : ""), 1); | add_property_string(value, "orgtable",(field->org_table ? field->org_table : ""), 1); |
add_property_string(value, "def", (field->def ? field->def : ""), 1); | add_property_string(value, "def",(field->def ? field->def : ""), 1); |
add_property_string(value, "db", (field->db ? field->db : ""), 1); | add_property_string(value, "db",(field->db ? field->db : ""), 1); |
|
|
/* FIXME: manually set the catalog to "def" due to bug in |
/* FIXME: manually set the catalog to "def" due to bug in |
* libmysqlclient which does not initialize field->catalog |
* libmysqlclient which does not initialize field->catalog |
Line 1287 PHP_FUNCTION(mysqli_get_host_info)
|
Line 1291 PHP_FUNCTION(mysqli_get_host_info)
|
return; |
return; |
} |
} |
MYSQLI_FETCH_RESOURCE_CONN(mysql, &mysql_link, MYSQLI_STATUS_VALID); |
MYSQLI_FETCH_RESOURCE_CONN(mysql, &mysql_link, MYSQLI_STATUS_VALID); |
| #if !defined(MYSQLI_USE_MYSQLND) |
RETURN_STRING((mysql->mysql->host_info) ? mysql->mysql->host_info : "", 1); |
RETURN_STRING((mysql->mysql->host_info) ? mysql->mysql->host_info : "", 1); |
|
#else |
|
RETURN_STRING((mysql->mysql->data->host_info) ? mysql->mysql->data->host_info : "", 1); |
|
#endif |
} |
} |
/* }}} */ |
/* }}} */ |
|
|
Line 1665 static int mysqli_options_get_option_zval_type(int opt
|
Line 1672 static int mysqli_options_get_option_zval_type(int opt
|
#ifdef MYSQL_OPT_SSL_VERIFY_SERVER_CERT |
#ifdef MYSQL_OPT_SSL_VERIFY_SERVER_CERT |
REGISTER_LONG_CONSTANT("MYSQLI_OPT_SSL_VERIFY_SERVER_CERT", MYSQL_OPT_SSL_VERIFY_SERVER_CERT, CONST_CS | CONST_PERSISTENT); |
REGISTER_LONG_CONSTANT("MYSQLI_OPT_SSL_VERIFY_SERVER_CERT", MYSQL_OPT_SSL_VERIFY_SERVER_CERT, CONST_CS | CONST_PERSISTENT); |
#endif /* MySQL 5.1.1., mysqlnd @ PHP 5.3.3 */ |
#endif /* MySQL 5.1.1., mysqlnd @ PHP 5.3.3 */ |
|
#if MYSQL_VERSION_ID >= 50611 || defined(MYSQLI_USE_MYSQLND) |
|
case MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS: |
|
#endif |
return IS_LONG; |
return IS_LONG; |
|
|
#ifdef MYSQL_SHARED_MEMORY_BASE_NAME |
#ifdef MYSQL_SHARED_MEMORY_BASE_NAME |
Line 1800 PHP_FUNCTION(mysqli_prepare)
|
Line 1810 PHP_FUNCTION(mysqli_prepare)
|
memcpy(last_error, stmt->stmt->last_error, MYSQL_ERRMSG_SIZE); |
memcpy(last_error, stmt->stmt->last_error, MYSQL_ERRMSG_SIZE); |
memcpy(sqlstate, mysql->mysql->net.sqlstate, SQLSTATE_LENGTH+1); |
memcpy(sqlstate, mysql->mysql->net.sqlstate, SQLSTATE_LENGTH+1); |
#else |
#else |
MYSQLND_ERROR_INFO error_info = mysql->mysql->error_info; | MYSQLND_ERROR_INFO error_info = *mysql->mysql->data->error_info; |
#endif |
#endif |
mysqli_stmt_close(stmt->stmt, FALSE); |
mysqli_stmt_close(stmt->stmt, FALSE); |
stmt->stmt = NULL; |
stmt->stmt = NULL; |
Line 1811 PHP_FUNCTION(mysqli_prepare)
|
Line 1821 PHP_FUNCTION(mysqli_prepare)
|
memcpy(mysql->mysql->net.last_error, last_error, MYSQL_ERRMSG_SIZE); |
memcpy(mysql->mysql->net.last_error, last_error, MYSQL_ERRMSG_SIZE); |
memcpy(mysql->mysql->net.sqlstate, sqlstate, SQLSTATE_LENGTH+1); |
memcpy(mysql->mysql->net.sqlstate, sqlstate, SQLSTATE_LENGTH+1); |
#else |
#else |
mysql->mysql->error_info = error_info; | *mysql->mysql->data->error_info = error_info; |
#endif |
#endif |
} |
} |
} |
} |
Line 1830 PHP_FUNCTION(mysqli_prepare)
|
Line 1840 PHP_FUNCTION(mysqli_prepare)
|
efree(stmt); |
efree(stmt); |
RETURN_FALSE; |
RETURN_FALSE; |
} |
} |
|
#ifndef MYSQLI_USE_MYSQLND |
|
stmt->link_handle = Z_OBJ_HANDLE(*mysql_link); |
|
zend_objects_store_add_ref_by_handle(stmt->link_handle TSRMLS_CC); |
|
#endif |
|
|
mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE)); |
mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE)); |
mysqli_resource->ptr = (void *)stmt; |
mysqli_resource->ptr = (void *)stmt; |
Line 2358 PHP_FUNCTION(mysqli_stmt_init)
|
Line 2372 PHP_FUNCTION(mysqli_stmt_init)
|
efree(stmt); |
efree(stmt); |
RETURN_FALSE; |
RETURN_FALSE; |
} |
} |
|
#ifndef MYSQLI_USE_MYSQLND |
|
stmt->link_handle = Z_OBJ_HANDLE(*mysql_link); |
|
zend_objects_store_add_ref_by_handle(stmt->link_handle TSRMLS_CC); |
|
#endif |
|
|
mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE)); |
mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE)); |
mysqli_resource->status = MYSQLI_STATUS_INITIALIZED; |
mysqli_resource->status = MYSQLI_STATUS_INITIALIZED; |