Lines Matching refs:mysql
61 MY_MYSQL *mysql = NULL; local
98 mysql = (MY_MYSQL*) mysqli_resource->ptr;
101 if (!mysql) {
102 mysql = (MY_MYSQL *) ecalloc(1, sizeof(MY_MYSQL));
115 MYSQLI_FETCH_RESOURCE_CONN(mysql, object, MYSQLI_STATUS_INITIALIZED);
145 if (mysql->mysql && mysqli_resource &&
149 php_mysqli_close(mysql, MYSQLI_CLOSE_IMPLICIT, mysqli_resource->status);
157 mysql->persistent = persistent = TRUE;
163 mysql->hash_key = hash_key;
172 mysql->mysql = zend_ptr_stack_pop(&plist->free_links);
178 if (!mysqli_change_user_silent(mysql->mysql, username, passwd, dbname, passwd_len)) {
180 if (!mysql_ping(mysql->mysql)) {
183 mysqlnd_restart_psession(mysql->mysql);
188 php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql));
192 mysqli_close(mysql->mysql, MYSQLI_CLOSE_IMPLICIT);
193 mysql->mysql = NULL;
220 if (!mysql->mysql) {
222 if (!(mysql->mysql = mysql_init(NULL))) {
224 if (!(mysql->mysql = mysqlnd_init(MYSQLND_CLIENT_KNOWS_RSET_COPY_DATA, persistent))) {
234 mysql_options(mysql->mysql, MYSQL_OPT_USE_REMOTE_CONNECTION, (char *)&external);
236 mysql_options(mysql->mysql, MYSQL_OPT_USE_EMBEDDED_CONNECTION, 0);
244 …if (mysql_real_connect(mysql->mysql, hostname, username, passwd, dbname, port, socket, flags) == N…
246 if (mysqlnd_connect(mysql->mysql, hostname, username, passwd, passwd_len, dbname, dbname_len,
251 php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql));
252 php_mysqli_throw_sql_exception((char *)mysql_sqlstate(mysql->mysql), mysql_errno(mysql->mysql),
253 "%s", mysql_error(mysql->mysql));
256 mysqli_close(mysql->mysql, MYSQLI_CLOSE_DISCONNECTED);
257 mysql->mysql = NULL;
263 php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql));
266 mysql->mysql->reconnect = MyG(reconnect);
269 mysql_options(mysql->mysql, MYSQL_OPT_LOCAL_INFILE, (char *)&MyG(allow_local_infile));
274 mysqli_resource->ptr = (void *)mysql;
285 mysql->multi_query = 0;
299 if (mysql->hash_key) {
300 zend_string_release(mysql->hash_key);
301 mysql->hash_key = NULL;
302 mysql->persistent = FALSE;
305 efree(mysql);
401 MY_MYSQL *mysql; local
408 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
410 mysqlnd_get_connection_stats(mysql->mysql, return_value);
419 MY_MYSQL *mysql; local
425 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
428 if (mysql->mysql->data->error_info->error_list) {
431 …for (message = (MYSQLND_ERROR_LIST_ELEMENT *) zend_llist_get_first_ex(mysql->mysql->data->error_in…
433 …message = (MYSQLND_ERROR_LIST_ELEMENT *) zend_llist_get_next_ex(mysql->mysql->data->error_info->er…
444 if (mysql_errno(mysql->mysql)) {
447 add_assoc_long_ex(&single_error, "errno", sizeof("errno") - 1, mysql_errno(mysql->mysql));
448 …d_assoc_string_ex(&single_error, "sqlstate", sizeof("sqlstate") - 1, mysql_sqlstate(mysql->mysql));
449 add_assoc_string_ex(&single_error, "error", sizeof("error") - 1, mysql_error(mysql->mysql));
509 MY_MYSQL *mysql; local
517 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
520 if (mysql_real_query(mysql->mysql, query, query_len)) {
526 strcpy(s_error, mysql_error(mysql->mysql));
527 strcpy(s_sqlstate, mysql_sqlstate(mysql->mysql));
528 s_errno = mysql_errno(mysql->mysql);
530 MYSQLND_ERROR_INFO error_info = *mysql->mysql->data->error_info;
532 MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
537 strcpy(mysql->mysql->net.last_error, s_error);
538 strcpy(mysql->mysql->net.sqlstate, s_sqlstate);
539 mysql->mysql->net.last_errno = s_errno;
541 *mysql->mysql->data->error_info = error_info;
552 MY_MYSQL *mysql; local
577 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
584 if (mysqli_async_query(mysql->mysql, query, query_len)) {
585 MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
588 mysql->async_result_fetch_type = resultmode & ~MYSQLI_ASYNC;
593 if (mysql_real_query(mysql->mysql, query, query_len)) {
594 MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
598 if (!mysql_field_count(mysql->mysql)) {
601 php_mysqli_report_index(query, mysqli_server_status(mysql->mysql));
614 result = mysqlnd_store_result_ofs(mysql->mysql);
617 result = mysql_store_result(mysql->mysql);
620 result = mysql_use_result(mysql->mysql);
624 php_mysqli_throw_sql_exception((char *)mysql_sqlstate(mysql->mysql), mysql_errno(mysql->mysql),
625 "%s", mysql_error(mysql->mysql));
630 php_mysqli_report_index(query, mysqli_server_status(mysql->mysql));
658 MY_MYSQL *mysql; local
665 mysql = (MY_MYSQL*) my_res->ptr;
670 (*out_array)[current++] = mysql->mysql;
694 MY_MYSQL *mysql; local
701 mysql = (MY_MYSQL *) my_res->ptr;
702 if (mysql->mysql == *p) {
731 MY_MYSQL *mysql; local
733 mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)intern->ptr)->ptr;
734 if (mysql->mysql == *p) {
815 MY_MYSQL *mysql; local
824 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
826 if (FAIL == mysqlnd_reap_async_query(mysql->mysql)) {
830 if (!mysql_field_count(mysql->mysql)) {
838 switch (mysql->async_result_fetch_type) {
840 result = mysql_store_result(mysql->mysql);
843 result = mysql_use_result(mysql->mysql);
848 php_mysqli_throw_sql_exception((char *)mysql_sqlstate(mysql->mysql), mysql_errno(mysql->mysql),
849 "%s", mysql_error(mysql->mysql));
894 MY_MYSQL *mysql; local
902 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
904 if (mysql_warning_count(mysql->mysql)) {
906 w = php_get_warnings(mysql->mysql->data);
908 w = php_get_warnings(mysql->mysql);
950 MY_MYSQL *mysql; local
958 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
960 if (mysql_set_character_set(mysql->mysql, cs_name)) {
973 MY_MYSQL *mysql; local
986 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
990 mysql_get_character_set_info(mysql->mysql, &cs);
1000 cs = mysql->mysql->data->charset;
1083 MY_MYSQL *mysql; local
1093 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
1107 if (mysqli_begin_transaction_libmysql(mysql->mysql, flags, name)) {
1111 if (FAIL == mysqlnd_begin_transaction(mysql->mysql, flags, name)) {
1137 MY_MYSQL *mysql; local
1145 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
1152 if (mysqli_savepoint_libmysql(mysql->mysql, name, FALSE)) {
1154 if (FAIL == mysqlnd_savepoint(mysql->mysql, name)) {
1166 MY_MYSQL *mysql; local
1174 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
1180 if (mysqli_savepoint_libmysql(mysql->mysql, name, TRUE)) {
1182 if (FAIL == mysqlnd_savepoint(mysql->mysql, name)) {