version 1.1.1.2, 2012/05/29 12:34:41
|
version 1.1.1.3, 2013/07/22 01:31:56
|
Line 2
|
Line 2
|
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| PHP Version 5 | |
| PHP Version 5 | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| Copyright (c) 2006-2012 The PHP Group | | | Copyright (c) 2006-2013 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 764 MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CON
|
Line 764 MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CON
|
conn->server_version = mnd_pestrdup(greet_packet->server_version, conn->persistent); |
conn->server_version = mnd_pestrdup(greet_packet->server_version, conn->persistent); |
|
|
conn->greet_charset = mysqlnd_find_charset_nr(greet_packet->charset_no); |
conn->greet_charset = mysqlnd_find_charset_nr(greet_packet->charset_no); |
|
if (!conn->greet_charset) { |
|
php_error_docref(NULL TSRMLS_CC, E_WARNING, |
|
"Server sent charset (%d) unknown to the client. Please, report to the developers", greet_packet->charset_no); |
|
SET_CLIENT_ERROR(*conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, |
|
"Server sent charset unknown to the client. Please, report to the developers"); |
|
goto err; |
|
} |
/* we allow load data local infile by default */ |
/* we allow load data local infile by default */ |
mysql_flags |= MYSQLND_CAPABILITIES; |
mysql_flags |= MYSQLND_CAPABILITIES; |
|
|
|
mysql_flags |= conn->options->flags; /* use the flags from set_client_option() */ |
|
|
if (db) { |
if (db) { |
mysql_flags |= CLIENT_CONNECT_WITH_DB; |
mysql_flags |= CLIENT_CONNECT_WITH_DB; |
} |
} |
Line 975 MYSQLND_METHOD(mysqlnd_conn, connect)(MYSQLND * conn_h
|
Line 984 MYSQLND_METHOD(mysqlnd_conn, connect)(MYSQLND * conn_h
|
} |
} |
DBG_RETURN(ret); |
DBG_RETURN(ret); |
} |
} |
|
/* }}} */ |
|
|
|
|
/* {{{ mysqlnd_connect */ |
/* {{{ mysqlnd_connect */ |
PHPAPI MYSQLND * mysqlnd_connect(MYSQLND * conn_handle, |
PHPAPI MYSQLND * mysqlnd_connect(MYSQLND * conn_handle, |
const char * host, const char * user, |
const char * host, const char * user, |
Line 1328 MYSQLND_METHOD(mysqlnd_conn_data, list_fields)(MYSQLND
|
Line 1337 MYSQLND_METHOD(mysqlnd_conn_data, list_fields)(MYSQLND
|
} |
} |
|
|
if (FAIL == result->m.read_result_metadata(result, conn TSRMLS_CC)) { |
if (FAIL == result->m.read_result_metadata(result, conn TSRMLS_CC)) { |
DBG_ERR("Error ocurred while reading metadata"); | DBG_ERR("Error occurred while reading metadata"); |
result->m.free_result(result, TRUE TSRMLS_CC); |
result->m.free_result(result, TRUE TSRMLS_CC); |
result = NULL; |
result = NULL; |
break; |
break; |
Line 2177 MYSQLND_METHOD(mysqlnd_conn_data, change_user)(MYSQLND
|
Line 2186 MYSQLND_METHOD(mysqlnd_conn_data, change_user)(MYSQLND
|
} |
} |
memcpy(conn->auth_plugin_data, plugin_data, plugin_data_len); |
memcpy(conn->auth_plugin_data, plugin_data, plugin_data_len); |
|
|
DBG_INF_FMT("salt=[%*s]", plugin_data_len - 1, plugin_data); | DBG_INF_FMT("salt=[%*.s]", plugin_data_len - 1, plugin_data); |
|
|
/* The data should be allocated with malloc() */ |
/* The data should be allocated with malloc() */ |
scrambled_data = |
scrambled_data = |
Line 2277 MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(M
|
Line 2286 MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(M
|
break; |
break; |
#endif |
#endif |
case MYSQL_OPT_LOCAL_INFILE: |
case MYSQL_OPT_LOCAL_INFILE: |
if (!value || (*(unsigned int*) value) ? 1 : 0) { | if (value && (*(unsigned int*) value) ? 1 : 0) { |
conn->options->flags |= CLIENT_LOCAL_FILES; |
conn->options->flags |= CLIENT_LOCAL_FILES; |
} else { |
} else { |
conn->options->flags &= ~CLIENT_LOCAL_FILES; |
conn->options->flags &= ~CLIENT_LOCAL_FILES; |
Line 2312 MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(M
|
Line 2321 MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(M
|
break; |
break; |
case MYSQL_SET_CHARSET_NAME: |
case MYSQL_SET_CHARSET_NAME: |
{ |
{ |
char * new_charset_name = mnd_pestrdup(value, conn->persistent); | char * new_charset_name; |
| if (!mysqlnd_find_charset_name(value)) { |
| SET_CLIENT_ERROR(*conn->error_info, CR_CANT_FIND_CHARSET, UNKNOWN_SQLSTATE, "Unknown character set"); |
| ret = FAIL; |
| break; |
| } |
| |
| new_charset_name = mnd_pestrdup(value, conn->persistent); |
if (!new_charset_name) { |
if (!new_charset_name) { |
goto oom; |
goto oom; |
} |
} |
Line 2361 MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(M
|
Line 2377 MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(M
|
DBG_INF_FMT("auth_protocol=%s", conn->options->auth_protocol); |
DBG_INF_FMT("auth_protocol=%s", conn->options->auth_protocol); |
break; |
break; |
} |
} |
|
case MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS: |
|
if (value && (*(unsigned int*) value) ? 1 : 0) { |
|
conn->options->flags |= CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS; |
|
} else { |
|
conn->options->flags &= ~CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS; |
|
} |
|
break; |
#ifdef WHEN_SUPPORTED_BY_MYSQLI |
#ifdef WHEN_SUPPORTED_BY_MYSQLI |
case MYSQL_SHARED_MEMORY_BASE_NAME: |
case MYSQL_SHARED_MEMORY_BASE_NAME: |
case MYSQL_OPT_USE_RESULT: |
case MYSQL_OPT_USE_RESULT: |