Lines Matching refs:conn

220 MYSQLND_METHOD(mysqlnd_conn_data, free_options)(MYSQLND_CONN_DATA * conn)  in MYSQLND_METHOD()
222 bool pers = conn->persistent; in MYSQLND_METHOD()
224 if (conn->options->charset_name) { in MYSQLND_METHOD()
225 mnd_pefree(conn->options->charset_name, pers); in MYSQLND_METHOD()
226 conn->options->charset_name = NULL; in MYSQLND_METHOD()
228 if (conn->options->auth_protocol) { in MYSQLND_METHOD()
229 mnd_pefree(conn->options->auth_protocol, pers); in MYSQLND_METHOD()
230 conn->options->auth_protocol = NULL; in MYSQLND_METHOD()
232 if (conn->options->num_commands) { in MYSQLND_METHOD()
234 for (i = 0; i < conn->options->num_commands; i++) { in MYSQLND_METHOD()
236 mnd_pefree(conn->options->init_commands[i], pers); in MYSQLND_METHOD()
238 mnd_pefree(conn->options->init_commands, pers); in MYSQLND_METHOD()
239 conn->options->init_commands = NULL; in MYSQLND_METHOD()
241 if (conn->options->cfg_file) { in MYSQLND_METHOD()
242 mnd_pefree(conn->options->cfg_file, pers); in MYSQLND_METHOD()
243 conn->options->cfg_file = NULL; in MYSQLND_METHOD()
245 if (conn->options->cfg_section) { in MYSQLND_METHOD()
246 mnd_pefree(conn->options->cfg_section, pers); in MYSQLND_METHOD()
247 conn->options->cfg_section = NULL; in MYSQLND_METHOD()
249 if (conn->options->connect_attr) { in MYSQLND_METHOD()
250 zend_hash_destroy(conn->options->connect_attr); in MYSQLND_METHOD()
251 mnd_pefree(conn->options->connect_attr, pers); in MYSQLND_METHOD()
252 conn->options->connect_attr = NULL; in MYSQLND_METHOD()
254 if (conn->options->local_infile_directory) { in MYSQLND_METHOD()
255 mnd_pefree(conn->options->local_infile_directory, pers); in MYSQLND_METHOD()
256 conn->options->local_infile_directory = NULL; in MYSQLND_METHOD()
264 MYSQLND_METHOD(mysqlnd_conn_data, free_contents)(MYSQLND_CONN_DATA * conn) in MYSQLND_METHOD()
266 bool pers = conn->persistent; in MYSQLND_METHOD()
270 if (conn->current_result) { in MYSQLND_METHOD()
271 conn->current_result->m.free_result(conn->current_result, TRUE); in MYSQLND_METHOD()
272 conn->current_result = NULL; in MYSQLND_METHOD()
275 if (conn->protocol_frame_codec) { in MYSQLND_METHOD()
276 conn->protocol_frame_codec->data->m.free_contents(conn->protocol_frame_codec); in MYSQLND_METHOD()
279 if (conn->vio) { in MYSQLND_METHOD()
280 conn->vio->data->m.free_contents(conn->vio); in MYSQLND_METHOD()
285 mysqlnd_set_persistent_string(&conn->hostname, NULL, 0, pers); in MYSQLND_METHOD()
286 mysqlnd_set_persistent_string(&conn->username, NULL, 0, pers); in MYSQLND_METHOD()
287 mysqlnd_set_persistent_string(&conn->password, NULL, 0, pers); in MYSQLND_METHOD()
288 mysqlnd_set_persistent_string(&conn->connect_or_select_db, NULL, 0, pers); in MYSQLND_METHOD()
289 mysqlnd_set_persistent_string(&conn->unix_socket, NULL, 0, pers); in MYSQLND_METHOD()
290 DBG_INF_FMT("scheme=%s", conn->scheme.s); in MYSQLND_METHOD()
291 mysqlnd_set_persistent_string(&conn->scheme, NULL, 0, pers); in MYSQLND_METHOD()
293 if (conn->server_version) { in MYSQLND_METHOD()
294 mnd_pefree(conn->server_version, pers); in MYSQLND_METHOD()
295 conn->server_version = NULL; in MYSQLND_METHOD()
297 if (conn->host_info) { in MYSQLND_METHOD()
298 mnd_pefree(conn->host_info, pers); in MYSQLND_METHOD()
299 conn->host_info = NULL; in MYSQLND_METHOD()
301 mysqlnd_set_persistent_string(&conn->authentication_plugin_data, NULL, 0, pers); in MYSQLND_METHOD()
302 mysqlnd_set_string(&conn->last_message, NULL, 0); in MYSQLND_METHOD()
304 conn->charset = NULL; in MYSQLND_METHOD()
305 conn->greet_charset = NULL; in MYSQLND_METHOD()
314 MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, dtor)(MYSQLND_CONN_DATA * conn) in MYSQLND_METHOD_PRIVATE()
317 DBG_INF_FMT("conn=%" PRIu64, conn->thread_id); in MYSQLND_METHOD_PRIVATE()
319 conn->m->free_contents(conn); in MYSQLND_METHOD_PRIVATE()
320 conn->m->free_options(conn); in MYSQLND_METHOD_PRIVATE()
322 if (conn->error_info) { in MYSQLND_METHOD_PRIVATE()
323 mysqlnd_error_info_free_contents(conn->error_info); in MYSQLND_METHOD_PRIVATE()
324 conn->error_info = NULL; in MYSQLND_METHOD_PRIVATE()
327 if (conn->protocol_frame_codec) { in MYSQLND_METHOD_PRIVATE()
328 mysqlnd_pfc_free(conn->protocol_frame_codec, conn->stats, conn->error_info); in MYSQLND_METHOD_PRIVATE()
329 conn->protocol_frame_codec = NULL; in MYSQLND_METHOD_PRIVATE()
332 if (conn->vio) { in MYSQLND_METHOD_PRIVATE()
333 mysqlnd_vio_free(conn->vio, conn->stats, conn->error_info); in MYSQLND_METHOD_PRIVATE()
334 conn->vio = NULL; in MYSQLND_METHOD_PRIVATE()
337 if (conn->payload_decoder_factory) { in MYSQLND_METHOD_PRIVATE()
338 mysqlnd_protocol_payload_decoder_factory_free(conn->payload_decoder_factory); in MYSQLND_METHOD_PRIVATE()
339 conn->payload_decoder_factory = NULL; in MYSQLND_METHOD_PRIVATE()
342 if (conn->stats) { in MYSQLND_METHOD_PRIVATE()
343 mysqlnd_stats_end(conn->stats, conn->persistent); in MYSQLND_METHOD_PRIVATE()
346 mnd_pefree(conn, conn->persistent); in MYSQLND_METHOD_PRIVATE()
355 MYSQLND_METHOD(mysqlnd_conn_data, set_server_option)(MYSQLND_CONN_DATA * const conn, enum_mysqlnd_s… in MYSQLND_METHOD()
358 DBG_RETURN(conn->command->set_option(conn, option)); in MYSQLND_METHOD()
365 MYSQLND_METHOD(mysqlnd_conn_data, restart_psession)(MYSQLND_CONN_DATA * conn) in MYSQLND_METHOD()
368 MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_CONNECT_REUSED); in MYSQLND_METHOD()
369 conn->current_result = NULL; in MYSQLND_METHOD()
370 conn->last_message.s = NULL; in MYSQLND_METHOD()
378 MYSQLND_METHOD(mysqlnd_conn_data, end_psession)(MYSQLND_CONN_DATA * conn) in MYSQLND_METHOD()
382 if (conn->current_result) { in MYSQLND_METHOD()
383 conn->current_result->m.free_result(conn->current_result, TRUE); in MYSQLND_METHOD()
384 conn->current_result = NULL; in MYSQLND_METHOD()
386 mysqlnd_set_string(&conn->last_message, NULL, 0); in MYSQLND_METHOD()
387 conn->error_info = &conn->error_info_impl; in MYSQLND_METHOD()
413 MYSQLND_METHOD(mysqlnd_conn_data, execute_init_commands)(MYSQLND_CONN_DATA * conn) in MYSQLND_METHOD()
418 if (conn->options->init_commands) { in MYSQLND_METHOD()
420 for (; current_command < conn->options->num_commands; ++current_command) { in MYSQLND_METHOD()
421 const char * const command = conn->options->init_commands[current_command]; in MYSQLND_METHOD()
423 MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_INIT_COMMAND_EXECUTED_COUNT); in MYSQLND_METHOD()
424 if (PASS != conn->m->query(conn, command, strlen(command))) { in MYSQLND_METHOD()
425 MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_INIT_COMMAND_FAILED_COUNT); in MYSQLND_METHOD()
430 if (conn->last_query_type == QUERY_SELECT) { in MYSQLND_METHOD()
431 MYSQLND_RES * result = conn->m->use_result(conn); in MYSQLND_METHOD()
436 } while (conn->m->next_result(conn) != FAIL); in MYSQLND_METHOD()
447 MYSQLND_METHOD(mysqlnd_conn_data, get_updated_connect_flags)(MYSQLND_CONN_DATA * conn, unsigned int… in MYSQLND_METHOD()
450 MYSQLND_PFC * pfc = conn->protocol_frame_codec; in MYSQLND_METHOD()
452 MYSQLND_VIO * vio = conn->vio; in MYSQLND_METHOD()
459 mysql_flags |= conn->options->flags; /* use the flags from set_client_option() */ in MYSQLND_METHOD()
485 if (conn->options->connect_attr && zend_hash_num_elements(conn->options->connect_attr)) { in MYSQLND_METHOD()
496 MYSQLND_METHOD(mysqlnd_conn_data, connect_handshake)(MYSQLND_CONN_DATA * conn, in MYSQLND_METHOD()
506 …if (PASS == conn->vio->data->m.connect(conn->vio, *scheme, conn->persistent, conn->stats, conn->er… in MYSQLND_METHOD()
507conn->protocol_frame_codec->data->m.reset(conn->protocol_frame_codec, conn->stats, conn->error_inf… in MYSQLND_METHOD()
510 ret = conn->command->handshake(conn, *username, *password, *database, client_flags); in MYSQLND_METHOD()
518 MYSQLND_METHOD(mysqlnd_conn_data, get_scheme)(MYSQLND_CONN_DATA * conn, MYSQLND_CSTRING hostname, M…
555 MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
569 MYSQLND_PFC * pfc = conn->protocol_frame_codec;
573 DBG_INF_FMT("conn=%p", conn);
575 SET_EMPTY_ERROR(conn->error_info);
576 UPSERT_STATUS_SET_AFFECTED_ROWS_TO_ERROR(conn->upsert_status);
580 conn? conn->persistent:0, conn? (int)GET_CONNECTION_STATE(&conn->state):-1);
582 if (GET_CONNECTION_STATE(&conn->state) > CONN_ALLOCED) {
585 if (GET_CONNECTION_STATE(&conn->state) < CONN_QUIT_SENT) {
586 MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_CLOSE_IMPLICIT);
588 conn->m->send_close(conn);
591 conn->m->free_contents(conn);
607 conn->m->set_client_option(conn, MYSQLND_OPT_MAX_ALLOWED_PACKET, (char *)&max_allowed_size);
632 transport = conn->m->get_scheme(conn, hostname, &socket_or_pipe, port, &unix_socket, &named_pipe);
634 mysql_flags = conn->m->get_updated_connect_flags(conn, mysql_flags);
638 …if (FAIL == conn->m->connect_handshake(conn, &scheme, &username, &password, &database, mysql_flags…
644 SET_CONNECTION_STATE(&conn->state, CONN_READY);
657 mysqlnd_set_persistent_string(&conn->scheme, transport.s, transport.l, conn->persistent);
663 if (!conn->scheme.s) {
667 mysqlnd_set_persistent_string(&conn->username, username.s, username.l, conn->persistent);
668 mysqlnd_set_persistent_string(&conn->password, username.s, password.l, conn->persistent);
669 conn->port = port;
670 …mysqlnd_set_persistent_string(&conn->connect_or_select_db, database.s, database.l, conn->persisten…
673 mysqlnd_set_persistent_string(&conn->hostname, hostname.s, hostname.l, conn->persistent);
676 mnd_sprintf(&p, 0, "%s via TCP/IP", conn->hostname.s);
678 SET_OOM_ERROR(conn->error_info);
681 conn->host_info = mnd_pestrdup(p, conn->persistent);
685 conn->unix_socket.s = mnd_pestrdup(socket_or_pipe.s, conn->persistent);
687 conn->host_info = mnd_pestrdup("Localhost via UNIX socket", conn->persistent);
690 mnd_sprintf(&p, 0, "%s via named pipe", conn->unix_socket.s);
692 SET_OOM_ERROR(conn->error_info);
695 conn->host_info = mnd_pestrdup(p, conn->persistent);
700 if (!conn->unix_socket.s || !conn->host_info) {
701 SET_OOM_ERROR(conn->error_info);
704 conn->unix_socket.l = strlen(conn->unix_socket.s);
707 SET_EMPTY_ERROR(conn->error_info);
709 mysqlnd_local_infile_default(conn);
711 if (FAIL == conn->m->execute_init_commands(conn)) {
715 …MYSQLND_INC_CONN_STATISTIC_W_VALUE2(conn->stats, STAT_CONNECT_SUCCESS, 1, STAT_OPENED_CONNECTIONS,…
719 if (conn->persistent) {
720 …MYSQLND_INC_CONN_STATISTIC_W_VALUE2(conn->stats, STAT_PCONNECT_SUCCESS, 1, STAT_OPENED_PERSISTENT_…
723 DBG_INF_FMT("connection_id=%" PRIu64, conn->thread_id);
728 …128s (trying to connect via %s)", conn->error_info->error_no, conn->error_info->error, transport.s…
729 if (!conn->error_info->error_no) {
732 …sg, 0, "Unknown error while trying to connect via %s", transport.s ? transport.s : conn->scheme.s);
733 SET_CLIENT_ERROR(conn->error_info, CR_CONNECTION_ERROR, UNKNOWN_SQLSTATE, msg);
742 conn->m->free_contents(conn);
743 MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_CONNECT_FAILURE);
760 MYSQLND_CONN_DATA * conn = conn_handle->data; local
768 …DBG_RETURN(conn->m->connect(conn, hostname, username, password, database, port, socket_or_pipe, my…
779 MYSQLND_METHOD(mysqlnd_conn_data, query)(MYSQLND_CONN_DATA * conn, const char * const query, const …
783 DBG_INF_FMT("conn=%p conn=%" PRIu64 " query=%s", conn, conn->thread_id, query);
785 if (PASS == conn->m->send_query(conn, query, query_len, NULL, NULL) &&
786 PASS == conn->m->reap_query(conn))
789 …if (conn->last_query_type == QUERY_UPSERT && UPSERT_STATUS_GET_AFFECTED_ROWS(conn->upsert_status))…
790 …MYSQLND_INC_CONN_STATISTIC_W_VALUE(conn->stats, STAT_ROWS_AFFECTED_NORMAL, UPSERT_STATUS_GET_AFFEC…
801 MYSQLND_CONN_DATA * conn, const char * const query, const size_t query_len,
805 DBG_INF_FMT("conn=%" PRIu64 " query=%s", conn->thread_id, query);
806 DBG_INF_FMT("conn->server_status=%u", UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_status));
809 enum_func_status ret = conn->command->query(conn, query_string);
810 DBG_INF_FMT("conn->server_status=%u", UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_status));
818 MYSQLND_METHOD(mysqlnd_conn_data, reap_query)(MYSQLND_CONN_DATA * conn)
821 DBG_INF_FMT("conn=%" PRIu64, conn->thread_id);
823 DBG_INF_FMT("conn->server_status=%u", UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_status));
824 enum_func_status ret = conn->command->reap_result(conn);
825 DBG_INF_FMT("conn->server_status=%u", UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_status));
833 MYSQLND_METHOD(mysqlnd_conn_data, list_method)(MYSQLND_CONN_DATA * conn, const char * const query, …
840 DBG_INF_FMT("conn=%" PRIu64 " query=%s wild=%p", conn->thread_id, query, achtung_wild);
856 if (PASS == conn->m->query(conn, show_query, show_query_len)) {
857 result = conn->m->store_result(conn);
869 MYSQLND_METHOD(mysqlnd_conn_data, err_no)(const MYSQLND_CONN_DATA * const conn)
871 return conn->error_info->error_no;
878 MYSQLND_METHOD(mysqlnd_conn_data, error)(const MYSQLND_CONN_DATA * const conn)
880 return conn->error_info->error;
887 MYSQLND_METHOD(mysqlnd_conn_data, sqlstate)(const MYSQLND_CONN_DATA * const conn)
889 return conn->error_info->sqlstate[0] ? conn->error_info->sqlstate:MYSQLND_SQLSTATE_NULL;
906 MYSQLND_METHOD(mysqlnd_conn_data, ssl_set)(MYSQLND_CONN_DATA * const conn, const char * key, const …
909 MYSQLND_VIO * vio = conn->vio;
925 MYSQLND_METHOD(mysqlnd_conn_data, escape_string)(MYSQLND_CONN_DATA * const conn, char * newstr, con…
929 DBG_INF_FMT("conn=%" PRIu64, conn->thread_id);
931 DBG_INF_FMT("server_status=%u", UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_status));
932 if (UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_status) & SERVER_STATUS_NO_BACKSLASH_ESCAPES) {
933 ret = mysqlnd_cset_escape_quotes(conn->charset, newstr, escapestr, escapestr_len);
935 ret = mysqlnd_cset_escape_slashes(conn->charset, newstr, escapestr, escapestr_len);
944 MYSQLND_METHOD(mysqlnd_conn_data, dump_debug_info)(MYSQLND_CONN_DATA * const conn)
947 DBG_INF_FMT("conn=%" PRIu64, conn->thread_id);
948 DBG_RETURN(conn->command->debug(conn));
955 MYSQLND_METHOD(mysqlnd_conn_data, select_db)(MYSQLND_CONN_DATA * const conn, const char * const db,…
958 DBG_INF_FMT("conn=%" PRIu64 " db=%s", conn->thread_id, db);
961 DBG_RETURN(conn->command->init_db(conn, database));
968 MYSQLND_METHOD(mysqlnd_conn_data, ping)(MYSQLND_CONN_DATA * const conn)
971 DBG_INF_FMT("conn=%" PRIu64, conn->thread_id);
973 enum_func_status ret = conn->command->ping(conn);
982 MYSQLND_METHOD(mysqlnd_conn_data, statistic)(MYSQLND_CONN_DATA * conn, zend_string **message)
985 DBG_INF_FMT("conn=%" PRIu64, conn->thread_id);
986 DBG_RETURN(conn->command->statistics(conn, message));
993 MYSQLND_METHOD(mysqlnd_conn_data, kill)(MYSQLND_CONN_DATA * conn, unsigned int pid)
996 DBG_INF_FMT("conn=%" PRIu64 " pid=%u", conn->thread_id, pid);
1000 const unsigned int read_response = (pid != conn->thread_id);
1002 DBG_RETURN(conn->command->process_kill(conn, process_id, read_response));
1009 MYSQLND_METHOD(mysqlnd_conn_data, set_charset)(MYSQLND_CONN_DATA * const conn, const char * const c…
1015 DBG_INF_FMT("conn=%" PRIu64 " cs=%s", conn->thread_id, csname);
1018 …SET_CLIENT_ERROR(conn->error_info, CR_CANT_FIND_CHARSET, UNKNOWN_SQLSTATE, "Invalid character set …
1025 if (FAIL == (ret = conn->m->query(conn, query, query_len)) || conn->error_info->error_no) {
1028 conn->charset = charset;
1040 MYSQLND_METHOD(mysqlnd_conn_data, refresh)(MYSQLND_CONN_DATA * const conn, uint8_t options)
1043 DBG_INF_FMT("conn=%" PRIu64 " options=%u", conn->thread_id, options);
1044 DBG_RETURN(conn->command->refresh(conn, options));
1051 MYSQLND_METHOD(mysqlnd_conn_data, shutdown)(MYSQLND_CONN_DATA * const conn, uint8_t level)
1054 DBG_INF_FMT("conn=%" PRIu64 " level=%u", conn->thread_id, level);
1055 DBG_RETURN(conn->command->shutdown(conn, level));
1062 MYSQLND_METHOD(mysqlnd_conn_data, send_close)(MYSQLND_CONN_DATA * const conn)
1065 MYSQLND_VIO * vio = conn->vio;
1067 enum mysqlnd_connection_state state = GET_CONNECTION_STATE(&conn->state);
1070 …DBG_INF_FMT("conn=%" PRIu64 " vio->data->stream->abstract=%p", conn->thread_id, net_stream? net_st…
1075 if (conn->persistent) {
1083 ret = conn->command->quit(conn);
1084 vio->data->m.close_stream(vio, conn->stats, conn->error_info);
1086 SET_CONNECTION_STATE(&conn->state, CONN_QUIT_SENT);
1097 DBG_ERR_FMT("Brutally closing connection [%p][%s]", conn, conn->scheme.s);
1110 SET_CONNECTION_STATE(&conn->state, CONN_QUIT_SENT);
1114 vio->data->m.close_stream(vio, conn->stats, conn->error_info);
1125 MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, get_reference)(MYSQLND_CONN_DATA * const conn)
1128 ++conn->refcount;
1129 DBG_INF_FMT("conn=%" PRIu64 " new_refcount=%u", conn->thread_id, conn->refcount);
1130 DBG_RETURN(conn);
1137 MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, free_reference)(MYSQLND_CONN_DATA * const conn)
1141 DBG_INF_FMT("conn=%" PRIu64 " old_refcount=%u", conn->thread_id, conn->refcount);
1142 if (!(--conn->refcount)) {
1148 ret = conn->m->send_close(conn);
1149 conn->m->dtor(conn);
1158 MYSQLND_METHOD(mysqlnd_conn_data, field_count)(const MYSQLND_CONN_DATA * const conn)
1160 return conn->field_count;
1167 MYSQLND_METHOD(mysqlnd_conn_data, server_status)(const MYSQLND_CONN_DATA * const conn)
1169 return UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_status);
1176 MYSQLND_METHOD(mysqlnd_conn_data, insert_id)(const MYSQLND_CONN_DATA * const conn)
1178 return UPSERT_STATUS_GET_LAST_INSERT_ID(conn->upsert_status);
1185 MYSQLND_METHOD(mysqlnd_conn_data, affected_rows)(const MYSQLND_CONN_DATA * const conn)
1187 return UPSERT_STATUS_GET_AFFECTED_ROWS(conn->upsert_status);
1194 MYSQLND_METHOD(mysqlnd_conn_data, warning_count)(const MYSQLND_CONN_DATA * const conn)
1196 return UPSERT_STATUS_GET_WARNINGS(conn->upsert_status);
1203 MYSQLND_METHOD(mysqlnd_conn_data, info)(const MYSQLND_CONN_DATA * const conn)
1205 return conn->last_message.s;
1228 MYSQLND_METHOD(mysqlnd_conn_data, get_server_info)(const MYSQLND_CONN_DATA * const conn)
1230 return conn->server_version;
1237 MYSQLND_METHOD(mysqlnd_conn_data, get_host_info)(const MYSQLND_CONN_DATA * const conn)
1239 return conn->host_info;
1246 MYSQLND_METHOD(mysqlnd_conn_data, get_proto_info)(const MYSQLND_CONN_DATA * const conn)
1248 return conn->protocol_version;
1255 MYSQLND_METHOD(mysqlnd_conn_data, charset_name)(const MYSQLND_CONN_DATA * const conn)
1257 return conn->charset->name;
1264 MYSQLND_METHOD(mysqlnd_conn_data, thread_id)(const MYSQLND_CONN_DATA * const conn)
1266 return conn->thread_id;
1273 MYSQLND_METHOD(mysqlnd_conn_data, get_server_version)(const MYSQLND_CONN_DATA * const conn)
1278 if (!(p = conn->server_version)) {
1295 MYSQLND_METHOD(mysqlnd_conn_data, more_results)(const MYSQLND_CONN_DATA * const conn)
1299 …DBG_RETURN(UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_status) & SERVER_MORE_RESULTS_EXISTS? TRUE…
1306 MYSQLND_METHOD(mysqlnd_conn_data, next_result)(MYSQLND_CONN_DATA * const conn)
1309 DBG_INF_FMT("conn=%" PRIu64 "", conn->thread_id);
1311 SET_EMPTY_ERROR(conn->error_info);
1313 if (GET_CONNECTION_STATE(&conn->state) != CONN_NEXT_RESULT_PENDING) {
1317 UPSERT_STATUS_SET_AFFECTED_ROWS_TO_ERROR(conn->upsert_status);
1322 enum_func_status ret = conn->m->query_read_result_set_header(conn, NULL);
1328 if (!conn->error_info->error_no) {
1331 SET_CONNECTION_STATE(&conn->state, CONN_QUIT_SENT);
1332 conn->m->send_close(conn);
1334 …DBG_INF_FMT("Error from the server : (%u) %s", conn->error_info->error_no, conn->error_info->error…
1338 …if (conn->last_query_type == QUERY_UPSERT && UPSERT_STATUS_GET_AFFECTED_ROWS(conn->upsert_status))…
1339 …MYSQLND_INC_CONN_STATISTIC_W_VALUE(conn->stats, STAT_ROWS_AFFECTED_NORMAL, UPSERT_STATUS_GET_AFFEC…
1348 MYSQLND_METHOD(mysqlnd_conn_data, change_user)(MYSQLND_CONN_DATA * const conn,
1360 conn->thread_id, user?user:"", passwd?"***":"null", db?db:"", silent == TRUE);
1362 SET_EMPTY_ERROR(conn->error_info);
1363 UPSERT_STATUS_SET_AFFECTED_ROWS_TO_ERROR(conn->upsert_status);
1377 ret = mysqlnd_run_authentication(conn, user, passwd, passwd_len, db, strlen(db),
1378 conn->authentication_plugin_data, conn->options->auth_protocol,
1379 … 0 /*charset not used*/, conn->options, conn->server_capabilities, silent, TRUE/*is_change*/);
1393 MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(MYSQLND_CONN_DATA * const conn,
1400 DBG_INF_FMT("conn=%" PRIu64 " option=%u", conn->thread_id, option);
1413 ret = conn->vio->data->m.set_client_option(conn->vio, option, value);
1418 …ret = conn->protocol_frame_codec->data->m.set_client_option(conn->protocol_frame_codec, option, va…
1421 conn->options->int_and_float_native = *(unsigned int*) value;
1425 conn->options->flags |= CLIENT_LOCAL_FILES;
1427 conn->options->flags &= ~CLIENT_LOCAL_FILES;
1432 if (conn->options->local_infile_directory) {
1433 mnd_pefree(conn->options->local_infile_directory, conn->persistent);
1437 conn->options->local_infile_directory = NULL;
1439 conn->options->local_infile_directory = mnd_pestrdup(value, conn->persistent);
1449 …ew_init_commands = mnd_perealloc(conn->options->init_commands, sizeof(char *) * (conn->options->nu…
1450 conn->options->init_commands = new_init_commands;
1451 new_command = mnd_pestrdup(value, conn->persistent);
1452 conn->options->init_commands[conn->options->num_commands] = new_command;
1453 ++conn->options->num_commands;
1468 …SET_CLIENT_ERROR(conn->error_info, CR_CANT_FIND_CHARSET, UNKNOWN_SQLSTATE, "Unknown character set"…
1473 new_charset_name = mnd_pestrdup(value, conn->persistent);
1474 if (conn->options->charset_name) {
1475 mnd_pefree(conn->options->charset_name, conn->persistent);
1477 conn->options->charset_name = new_charset_name;
1478 DBG_INF_FMT("charset=%s", conn->options->charset_name);
1482 conn->options->protocol = MYSQL_PROTOCOL_PIPE;
1486 conn->options->protocol = *(unsigned int*) value;
1503 conn->options->max_allowed_packet = *(unsigned int*) value;
1508 char * new_auth_protocol = value? mnd_pestrdup(value, conn->persistent) : NULL;
1509 if (conn->options->auth_protocol) {
1510 mnd_pefree(conn->options->auth_protocol, conn->persistent);
1512 conn->options->auth_protocol = new_auth_protocol;
1513 DBG_INF_FMT("auth_protocol=%s", conn->options->auth_protocol);
1518 conn->options->flags |= CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS;
1520 conn->options->flags &= ~CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS;
1524 if (conn->options->connect_attr) {
1525 … DBG_INF_FMT("Before reset %d attribute(s)", zend_hash_num_elements(conn->options->connect_attr));
1526 zend_hash_clean(conn->options->connect_attr);
1530 if (conn->options->connect_attr && value) {
1531 … DBG_INF_FMT("Before delete %d attribute(s)", zend_hash_num_elements(conn->options->connect_attr));
1532 zend_hash_str_del(conn->options->connect_attr, value, strlen(value));
1533 DBG_INF_FMT("%d left", zend_hash_num_elements(conn->options->connect_attr));
1552 MYSQLND_METHOD(mysqlnd_conn_data, set_client_option_2d)(MYSQLND_CONN_DATA * const conn,
1560 DBG_INF_FMT("conn=%" PRIu64 " option=%u", conn->thread_id, option);
1564 if (!conn->options->connect_attr) {
1566 conn->options->connect_attr = mnd_pemalloc(sizeof(HashTable), conn->persistent);
1567 …zend_hash_init(conn->options->connect_attr, 0, NULL, conn->persistent ? ZVAL_INTERNAL_PTR_DTOR : Z…
1574 if (conn->persistent) {
1583 zend_hash_update(conn->options->connect_attr, str, &attrz);
1597 MYSQLND_METHOD(mysqlnd_conn_data, use_result)(MYSQLND_CONN_DATA * const conn)
1600 DBG_INF_FMT("conn=%" PRIu64, conn->thread_id);
1602 if (!conn->current_result) {
1607 …if (conn->last_query_type != QUERY_SELECT || GET_CONNECTION_STATE(&conn->state) != CONN_FETCHING_D…
1608 …SET_CLIENT_ERROR(conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync);
1613 MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_UNBUFFERED_SETS);
1615 conn->current_result->conn = conn->m->get_reference(conn);
1617 MYSQLND_RES *result = conn->current_result->m.use_result(conn->current_result, FALSE);
1619 conn->current_result->m.free_result(conn->current_result, TRUE);
1621 conn->current_result = NULL;
1629 MYSQLND_METHOD(mysqlnd_conn_data, store_result)(MYSQLND_CONN_DATA * const conn)
1632 DBG_INF_FMT("conn=%" PRIu64 " conn=%p", conn->thread_id, conn);
1634 if (!conn->current_result) {
1639 …if (conn->last_query_type != QUERY_SELECT || GET_CONNECTION_STATE(&conn->state) != CONN_FETCHING_D…
1640 …SET_CLIENT_ERROR(conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync);
1645 MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_BUFFERED_SETS);
1646 MYSQLND_RES *result = conn->current_result->m.store_result(conn->current_result, conn, NULL);
1648 conn->current_result->m.free_result(conn->current_result, TRUE);
1650 conn->current_result = NULL;
1658 MYSQLND_METHOD(mysqlnd_conn_data, get_connection_stats)(const MYSQLND_CONN_DATA * const conn,
1662 mysqlnd_fill_stats_hash(conn->stats, mysqlnd_stats_values_names, return_value ZEND_FILE_LINE_CC);
1670 MYSQLND_METHOD(mysqlnd_conn_data, set_autocommit)(MYSQLND_CONN_DATA * conn, unsigned int mode)
1673 …DBG_RETURN(conn->m->query(conn, (mode) ? "SET AUTOCOMMIT=1":"SET AUTOCOMMIT=0", sizeof("SET AUTOCO…
1680 MYSQLND_METHOD(mysqlnd_conn_data, tx_commit)(MYSQLND_CONN_DATA * conn)
1682 return conn->m->tx_commit_or_rollback(conn, TRUE, TRANS_COR_NO_OPT, NULL);
1689 MYSQLND_METHOD(mysqlnd_conn_data, tx_rollback)(MYSQLND_CONN_DATA * conn)
1691 return conn->m->tx_commit_or_rollback(conn, FALSE, TRANS_COR_NO_OPT, NULL);
1698 MYSQLND_METHOD(mysqlnd_conn_data, tx_cor_options_to_string)(const MYSQLND_CONN_DATA * const conn, s…
1773 MYSQLND_METHOD(mysqlnd_conn_data, tx_commit_or_rollback)(MYSQLND_CONN_DATA * conn, const bool commi…
1778 conn->m->tx_cor_options_to_string(conn, &tmp_str, flags);
1793 SET_OOM_ERROR(conn->error_info);
1797 enum_func_status ret = conn->m->query(conn, query, query_len);
1806 MYSQLND_METHOD(mysqlnd_conn_data, tx_begin)(MYSQLND_CONN_DATA * conn, const unsigned int mode, cons…
1839 SET_OOM_ERROR(conn->error_info);
1843 enum_func_status ret = conn->m->query(conn, query, query_len);
1845 …if (ret && mode & (TRANS_START_READ_WRITE | TRANS_START_READ_ONLY) && mysqlnd_stmt_errno(conn) == …
1846 SET_CLIENT_ERROR(conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE,
1857 MYSQLND_METHOD(mysqlnd_conn_data, tx_savepoint)(MYSQLND_CONN_DATA * conn, const char * const name)
1862 …SET_CLIENT_ERROR(conn->error_info, CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, "Savepoint name not provide…
1869 SET_OOM_ERROR(conn->error_info);
1873 enum_func_status ret = conn->m->query(conn, query, query_len);
1882 MYSQLND_METHOD(mysqlnd_conn_data, tx_savepoint_release)(MYSQLND_CONN_DATA * conn, const char * cons…
1887 …SET_CLIENT_ERROR(conn->error_info, CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, "Savepoint name not provide…
1894 SET_OOM_ERROR(conn->error_info);
1898 enum_func_status ret = conn->m->query(conn, query, query_len);
1907 MYSQLND_METHOD(mysqlnd_conn_data, negotiate_client_api_capabilities)(MYSQLND_CONN_DATA * const conn
1911 if (conn) {
1912 ret = conn->client_api_capabilities;
1913 conn->client_api_capabilities = flags;
1923 MYSQLND_METHOD(mysqlnd_conn_data, get_client_api_capabilities)(const MYSQLND_CONN_DATA * const conn)
1926 DBG_RETURN(conn? conn->client_api_capabilities : 0);
1933 MYSQLND_METHOD(mysqlnd_conn_data, stmt_init)(MYSQLND_CONN_DATA * const conn)
1937 ret = conn->object_factory.get_prepared_statement(conn);
2033 MYSQLND_METHOD(mysqlnd_conn, clone_object)(MYSQLND * const conn)
2037 ret = conn->data->object_factory.clone_connection_object(conn);
2045 MYSQLND_METHOD_PRIVATE(mysqlnd_conn, dtor)(MYSQLND * conn)
2048 DBG_INF_FMT("conn=%" PRIu64, conn->data->thread_id);
2050 conn->data->m->free_reference(conn->data);
2052 mnd_pefree(conn, conn->persistent);
2063 MYSQLND_CONN_DATA * conn = conn_handle->data; local
2066 DBG_INF_FMT("conn=%" PRIu64, conn->thread_id);
2068 if (GET_CONNECTION_STATE(&conn->state) >= CONN_READY) {
2074 MYSQLND_INC_CONN_STATISTIC(conn->stats, close_type_to_stat_map[close_type]);
2081 enum_func_status ret = conn->m->send_close(conn);