Lines Matching refs:mysql
52 MY_MYSQL *mysql = NULL; local
92 mysql = (MY_MYSQL*) mysqli_resource->ptr;
95 if (!mysql) {
96 mysql = (MY_MYSQL *) ecalloc(1, sizeof(MY_MYSQL));
108 MYSQLI_FETCH_RESOURCE_CONN(mysql, object, MYSQLI_STATUS_INITIALIZED);
138 if (mysql->mysql && mysqli_resource &&
142 php_mysqli_close(mysql, MYSQLI_CLOSE_IMPLICIT, mysqli_resource->status);
150 mysql->persistent = persistent = TRUE;
156 mysql->hash_key = hash_key;
167 if (mysql->mysql) {
168 mysqli_close(mysql->mysql, MYSQLI_CLOSE_IMPLICIT);
171 mysql->mysql = zend_ptr_stack_pop(&plist->free_links);
177 if (!mysqli_change_user_silent(mysql->mysql, username, passwd, dbname, passwd_len)) {
179 if (!mysql_ping(mysql->mysql)) {
182 mysqlnd_restart_psession(mysql->mysql);
187 php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql));
192 if (mysql->mysql->data->vio->data->ssl) {
196 …ssl_key = mysql->mysql->data->vio->data->options.ssl_key ? estrdup(mysql->mysql->data->vio->data->…
197 …ssl_cert = mysql->mysql->data->vio->data->options.ssl_cert ? estrdup(mysql->mysql->data->vio->data…
198 …ssl_ca = mysql->mysql->data->vio->data->options.ssl_ca ? estrdup(mysql->mysql->data->vio->data->op…
199 …ssl_capath = mysql->mysql->data->vio->data->options.ssl_capath ? estrdup(mysql->mysql->data->vio->…
200 …ssl_cipher = mysql->mysql->data->vio->data->options.ssl_cipher ? estrdup(mysql->mysql->data->vio->…
203 if (mysql->mysql->options.ssl_key
204 || mysql->mysql->options.ssl_cert
205 || mysql->mysql->options.ssl_ca
206 || mysql->mysql->options.ssl_capath
207 || mysql->mysql->options.ssl_cipher) {
211 ssl_key = mysql->mysql->options.ssl_key ? estrdup(mysql->mysql->options.ssl_key) : NULL;
212 ssl_cert = mysql->mysql->options.ssl_cert ? estrdup(mysql->mysql->options.ssl_cert) : NULL;
213 ssl_ca = mysql->mysql->options.ssl_ca ? estrdup(mysql->mysql->options.ssl_ca) : NULL;
214 … ssl_capath = mysql->mysql->options.ssl_capath ? estrdup(mysql->mysql->options.ssl_capath) : NULL;
215 … ssl_cipher = mysql->mysql->options.ssl_cipher ? estrdup(mysql->mysql->options.ssl_cipher) : NULL;
218 mysqli_close(mysql->mysql, MYSQLI_CLOSE_IMPLICIT);
219 mysql->mysql = NULL;
244 if (!mysql->mysql) {
246 if (!(mysql->mysql = mysql_init(NULL))) {
248 if (!(mysql->mysql = mysqlnd_init(MYSQLND_CLIENT_KNOWS_RSET_COPY_DATA, persistent))) {
261 mysql_ssl_set(mysql->mysql, ssl_key, ssl_cert, ssl_ca, ssl_capath, ssl_cipher);
283 …if (mysql_real_connect(mysql->mysql, hostname, username, passwd, dbname, port, socket, flags) == N…
287 mysql_ssl_set(mysql->mysql, ssl_key, ssl_cert, ssl_ca, ssl_capath, ssl_cipher);
309 if (mysqlnd_connect(mysql->mysql, hostname, username, passwd, passwd_len, dbname, dbname_len,
314 php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql));
315 php_mysqli_throw_sql_exception((char *)mysql_sqlstate(mysql->mysql), mysql_errno(mysql->mysql),
316 "%s", mysql_error(mysql->mysql));
319 mysqli_close(mysql->mysql, MYSQLI_CLOSE_DISCONNECTED);
320 mysql->mysql = NULL;
326 php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql));
330 mysql_options(mysql->mysql, MYSQL_OPT_RECONNECT, (char *)&reconnect);
333 mysql_options(mysql->mysql, MYSQL_OPT_LOCAL_INFILE, (char *)&allow_local_infile);
338 mysqli_resource->ptr = (void *)mysql;
349 mysql->multi_query = 0;
363 if (mysql->hash_key) {
364 zend_string_release_ex(mysql->hash_key, 0);
365 mysql->hash_key = NULL;
366 mysql->persistent = FALSE;
369 efree(mysql);
469 MY_MYSQL *mysql; local
476 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
478 mysqlnd_get_connection_stats(mysql->mysql, return_value);
486 MY_MYSQL *mysql; local
492 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
498 …for (message = (MYSQLND_ERROR_LIST_ELEMENT *) zend_llist_get_first_ex(&mysql->mysql->data->error_i…
500 …message = (MYSQLND_ERROR_LIST_ELEMENT *) zend_llist_get_next_ex(&mysql->mysql->data->error_info->e…
513 if (mysql_errno(mysql->mysql)) {
517 add_assoc_long_ex(&single_error, "errno", sizeof("errno") - 1, mysql_errno(mysql->mysql));
518 …d_assoc_string_ex(&single_error, "sqlstate", sizeof("sqlstate") - 1, mysql_sqlstate(mysql->mysql));
519 add_assoc_string_ex(&single_error, "error", sizeof("error") - 1, mysql_error(mysql->mysql));
583 MY_MYSQL *mysql; local
591 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
594 if (mysql_real_query(mysql->mysql, query, query_len)) {
600 strcpy(s_error, mysql_error(mysql->mysql));
601 strcpy(s_sqlstate, mysql_sqlstate(mysql->mysql));
602 s_errno = mysql_errno(mysql->mysql);
604 MYSQLND_ERROR_INFO error_info = *mysql->mysql->data->error_info;
605 mysql->mysql->data->error_info->error_list.head = NULL;
606 mysql->mysql->data->error_info->error_list.tail = NULL;
607 mysql->mysql->data->error_info->error_list.count = 0;
609 MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
614 strcpy(mysql->mysql->net.last_error, s_error);
615 strcpy(mysql->mysql->net.sqlstate, s_sqlstate);
616 mysql->mysql->net.last_errno = s_errno;
618 zend_llist_clean(&mysql->mysql->data->error_info->error_list);
619 *mysql->mysql->data->error_info = error_info;
630 MY_MYSQL *mysql; local
657 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
664 if (mysqli_async_query(mysql->mysql, query, query_len)) {
665 MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
668 mysql->async_result_fetch_type = resultmode & ~MYSQLI_ASYNC;
673 if (mysql_real_query(mysql->mysql, query, query_len)) {
674 MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
678 if (!mysql_field_count(mysql->mysql)) {
681 php_mysqli_report_index(query, mysqli_server_status(mysql->mysql));
694 result = mysqlnd_store_result_ofs(mysql->mysql);
697 result = mysql_store_result(mysql->mysql);
700 result = mysql_use_result(mysql->mysql);
704 MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
709 php_mysqli_report_index(query, mysqli_server_status(mysql->mysql));
738 MY_MYSQL *mysql; local
745 mysql = (MY_MYSQL*) my_res->ptr;
750 (*out_array)[current++] = mysql->mysql;
773 MY_MYSQL *mysql; local
780 mysql = (MY_MYSQL *) my_res->ptr;
781 if (mysql->mysql == *p) {
810 MY_MYSQL *mysql; local
812 mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)intern->ptr)->ptr;
813 if (mysql->mysql == *p) {
904 MY_MYSQL *mysql; local
913 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
915 if (FAIL == mysqlnd_reap_async_query(mysql->mysql)) {
919 if (!mysql_field_count(mysql->mysql)) {
927 switch (mysql->async_result_fetch_type) {
929 result = mysql_store_result(mysql->mysql);
932 result = mysql_use_result(mysql->mysql);
937 MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
981 MY_MYSQL *mysql; local
989 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
991 if (mysql_warning_count(mysql->mysql)) {
993 w = php_get_warnings(mysql->mysql->data);
995 w = php_get_warnings(mysql->mysql);
1037 MY_MYSQL *mysql; local
1045 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
1047 if (mysql_set_character_set(mysql->mysql, cs_name)) {
1048 MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
1058 MY_MYSQL *mysql; local
1071 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
1075 mysql_get_character_set_info(mysql->mysql, &cs);
1085 cs = mysql->mysql->data->charset;
1164 MY_MYSQL *mysql; local
1173 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
1184 if (mysqli_begin_transaction_libmysql(mysql->mysql, flags, name)) {
1188 if (FAIL == mysqlnd_begin_transaction(mysql->mysql, flags, name)) {
1213 MY_MYSQL *mysql; local
1221 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
1228 if (mysqli_savepoint_libmysql(mysql->mysql, name, FALSE)) {
1230 if (FAIL == mysqlnd_savepoint(mysql->mysql, name)) {
1241 MY_MYSQL *mysql; local
1249 MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
1255 if (mysqli_savepoint_libmysql(mysql->mysql, name, TRUE)) {
1257 if (FAIL == mysqlnd_release_savepoint(mysql->mysql, name)) {