Lines Matching refs:mysql
52 MY_MYSQL *mysql = NULL; local
93 mysql = (MY_MYSQL*) mysqli_resource->ptr;
96 if (!mysql) {
97 mysql = (MY_MYSQL *) ecalloc(1, sizeof(MY_MYSQL));
109 MYSQLI_FETCH_RESOURCE_CONN(mysql, object, MYSQLI_STATUS_INITIALIZED);
139 if (mysql->mysql && mysqli_resource &&
143 php_mysqli_close(mysql, MYSQLI_CLOSE_IMPLICIT, mysqli_resource->status);
151 mysql->persistent = persistent = true;
157 mysql->hash_key = hash_key;
168 if (mysql->mysql) {
169 mysqli_close(mysql->mysql, MYSQLI_CLOSE_IMPLICIT);
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));
193 if (mysql->mysql->data->vio->data->ssl) {
197 …ssl_key = mysql->mysql->data->vio->data->options.ssl_key ? estrdup(mysql->mysql->data->vio->data->…
198 …ssl_cert = mysql->mysql->data->vio->data->options.ssl_cert ? estrdup(mysql->mysql->data->vio->data…
199 …ssl_ca = mysql->mysql->data->vio->data->options.ssl_ca ? estrdup(mysql->mysql->data->vio->data->op…
200 …ssl_capath = mysql->mysql->data->vio->data->options.ssl_capath ? estrdup(mysql->mysql->data->vio->…
201 …ssl_cipher = mysql->mysql->data->vio->data->options.ssl_cipher ? estrdup(mysql->mysql->data->vio->…
204 if (mysql->mysql->options.ssl_key
205 || mysql->mysql->options.ssl_cert
206 || mysql->mysql->options.ssl_ca
207 || mysql->mysql->options.ssl_capath
208 || mysql->mysql->options.ssl_cipher) {
212 ssl_key = mysql->mysql->options.ssl_key ? estrdup(mysql->mysql->options.ssl_key) : NULL;
213 ssl_cert = mysql->mysql->options.ssl_cert ? estrdup(mysql->mysql->options.ssl_cert) : NULL;
214 ssl_ca = mysql->mysql->options.ssl_ca ? estrdup(mysql->mysql->options.ssl_ca) : NULL;
215 … ssl_capath = mysql->mysql->options.ssl_capath ? estrdup(mysql->mysql->options.ssl_capath) : NULL;
216 … ssl_cipher = mysql->mysql->options.ssl_cipher ? estrdup(mysql->mysql->options.ssl_cipher) : NULL;
219 mysqli_close(mysql->mysql, MYSQLI_CLOSE_IMPLICIT);
220 mysql->mysql = NULL;
245 if (!mysql->mysql) {
247 if (!(mysql->mysql = mysql_init(NULL))) {
249 if (!(mysql->mysql = mysqlnd_init(MYSQLND_CLIENT_NO_FLAG, persistent))) {
262 mysql_ssl_set(mysql->mysql, ssl_key, ssl_cert, ssl_ca, ssl_capath, ssl_cipher);
284 …if (mysql_real_connect(mysql->mysql, hostname, username, passwd, dbname, port, socket, flags) == N…
288 mysql_ssl_set(mysql->mysql, ssl_key, ssl_cert, ssl_ca, ssl_capath, ssl_cipher);
310 if (mysqlnd_connect(mysql->mysql, hostname, username, passwd, passwd_len, dbname, dbname_len,
315 php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql));
316 php_mysqli_throw_sql_exception((char *)mysql_sqlstate(mysql->mysql), mysql_errno(mysql->mysql),
317 "%s", mysql_error(mysql->mysql));
320 mysqli_close(mysql->mysql, MYSQLI_CLOSE_DISCONNECTED);
321 mysql->mysql = NULL;
327 php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql));
331 mysql_options(mysql->mysql, MYSQL_OPT_RECONNECT, (char *)&reconnect);
334 mysql_options(mysql->mysql, MYSQL_OPT_LOCAL_INFILE, (char *)&allow_local_infile);
338 mysql_options(mysql->mysql, MYSQL_OPT_LOAD_DATA_LOCAL_DIR, MyG(local_infile_directory));
345 mysqli_resource->ptr = (void *)mysql;
356 mysql->multi_query = 0;
368 if (mysql->hash_key) {
369 zend_string_release_ex(mysql->hash_key, 0);
370 mysql->hash_key = NULL;
371 mysql->persistent = false;
374 efree(mysql);
517 MY_MYSQL *mysql; local
524 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
526 mysqlnd_get_connection_stats(mysql->mysql, return_value);
534 MY_MYSQL *mysql; local
540 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
546 …for (message = (MYSQLND_ERROR_LIST_ELEMENT *) zend_llist_get_first_ex(&mysql->mysql->data->error_i…
548 …message = (MYSQLND_ERROR_LIST_ELEMENT *) zend_llist_get_next_ex(&mysql->mysql->data->error_info->e…
561 if (mysql_errno(mysql->mysql)) {
565 add_assoc_long_ex(&single_error, "errno", sizeof("errno") - 1, mysql_errno(mysql->mysql));
566 …d_assoc_string_ex(&single_error, "sqlstate", sizeof("sqlstate") - 1, mysql_sqlstate(mysql->mysql));
567 add_assoc_string_ex(&single_error, "error", sizeof("error") - 1, mysql_error(mysql->mysql));
631 MY_MYSQL *mysql; local
639 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
642 if (mysql_real_query(mysql->mysql, query, query_len)) {
648 strcpy(s_error, mysql_error(mysql->mysql));
649 strcpy(s_sqlstate, mysql_sqlstate(mysql->mysql));
650 s_errno = mysql_errno(mysql->mysql);
652 MYSQLND_ERROR_INFO error_info = *mysql->mysql->data->error_info;
653 mysql->mysql->data->error_info->error_list.head = NULL;
654 mysql->mysql->data->error_info->error_list.tail = NULL;
655 mysql->mysql->data->error_info->error_list.count = 0;
657 MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
662 strcpy(mysql->mysql->net.last_error, s_error);
663 strcpy(mysql->mysql->net.sqlstate, s_sqlstate);
664 mysql->mysql->net.last_errno = s_errno;
666 zend_llist_clean(&mysql->mysql->data->error_info->error_list);
667 *mysql->mysql->data->error_info = error_info;
678 MY_MYSQL *mysql; local
705 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
712 if (mysqli_async_query(mysql->mysql, query, query_len)) {
713 MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
716 mysql->async_result_fetch_type = resultmode & ~MYSQLI_ASYNC;
721 if (mysql_real_query(mysql->mysql, query, query_len)) {
722 MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
726 if (!mysql_field_count(mysql->mysql)) {
729 php_mysqli_report_index(query, mysqli_server_status(mysql->mysql));
740 result = mysql_store_result(mysql->mysql);
743 result = mysql_use_result(mysql->mysql);
747 MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
752 php_mysqli_report_index(query, mysqli_server_status(mysql->mysql));
781 MY_MYSQL *mysql; local
788 mysql = (MY_MYSQL*) my_res->ptr;
793 (*out_array)[current++] = mysql->mysql;
816 MY_MYSQL *mysql; local
823 mysql = (MY_MYSQL *) my_res->ptr;
824 if (mysql->mysql == *p) {
853 MY_MYSQL *mysql; local
855 mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)intern->ptr)->ptr;
856 if (mysql->mysql == *p) {
947 MY_MYSQL *mysql; local
956 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
958 if (FAIL == mysqlnd_reap_async_query(mysql->mysql)) {
959 MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
963 if (!mysql_field_count(mysql->mysql)) {
971 switch (mysql->async_result_fetch_type) {
973 result = mysql_store_result(mysql->mysql);
976 result = mysql_use_result(mysql->mysql);
981 MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
1025 MY_MYSQL *mysql; local
1033 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
1035 if (mysql_warning_count(mysql->mysql)) {
1037 w = php_get_warnings(mysql->mysql->data);
1039 w = php_get_warnings(mysql->mysql);
1081 MY_MYSQL *mysql; local
1089 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
1091 if (mysql_set_character_set(mysql->mysql, cs_name)) {
1092 MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
1102 MY_MYSQL *mysql; local
1115 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
1119 mysql_get_character_set_info(mysql->mysql, &cs);
1129 cs = mysql->mysql->data->charset;
1208 MY_MYSQL *mysql; local
1217 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
1228 if (mysqli_begin_transaction_libmysql(mysql->mysql, flags, name)) {
1232 if (FAIL == mysqlnd_begin_transaction(mysql->mysql, flags, name)) {
1257 MY_MYSQL *mysql; local
1265 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
1272 if (mysqli_savepoint_libmysql(mysql->mysql, name, false)) {
1274 if (FAIL == mysqlnd_savepoint(mysql->mysql, name)) {
1285 MY_MYSQL *mysql; local
1293 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
1299 if (mysqli_savepoint_libmysql(mysql->mysql, name, true)) {
1301 if (FAIL == mysqlnd_release_savepoint(mysql->mysql, name)) {