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()
507 …PASS == conn->protocol_frame_codec->data->m.reset(conn->protocol_frame_codec, conn->stats, conn->e… in MYSQLND_METHOD()
511 ret = conn->command->handshake(conn, *username, *password, *database, client_flags); in MYSQLND_METHOD()
519 MYSQLND_METHOD(mysqlnd_conn_data, get_scheme)(MYSQLND_CONN_DATA * conn, MYSQLND_CSTRING hostname, M…
556 MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
570 MYSQLND_PFC * pfc = conn->protocol_frame_codec;
574 DBG_INF_FMT("conn=%p", conn);
576 SET_EMPTY_ERROR(conn->error_info);
577 UPSERT_STATUS_SET_AFFECTED_ROWS_TO_ERROR(conn->upsert_status);
581 conn? conn->persistent:0, conn? (int)GET_CONNECTION_STATE(&conn->state):-1);
583 if (GET_CONNECTION_STATE(&conn->state) > CONN_ALLOCED) {
586 if (GET_CONNECTION_STATE(&conn->state) < CONN_QUIT_SENT) {
587 MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_CLOSE_IMPLICIT);
589 conn->m->send_close(conn);
592 conn->m->free_contents(conn);
608 conn->m->set_client_option(conn, MYSQLND_OPT_MAX_ALLOWED_PACKET, (char *)&max_allowed_size);
633 transport = conn->m->get_scheme(conn, hostname, &socket_or_pipe, port, &unix_socket, &named_pipe);
635 mysql_flags = conn->m->get_updated_connect_flags(conn, mysql_flags);
639 …if (FAIL == conn->m->connect_handshake(conn, &scheme, &username, &password, &database, mysql_flags…
645 SET_CONNECTION_STATE(&conn->state, CONN_READY);
658 mysqlnd_set_persistent_string(&conn->scheme, transport.s, transport.l, conn->persistent);
664 if (!conn->scheme.s) {
668 mysqlnd_set_persistent_string(&conn->username, username.s, username.l, conn->persistent);
669 mysqlnd_set_persistent_string(&conn->password, username.s, password.l, conn->persistent);
670 conn->port = port;
671 …mysqlnd_set_persistent_string(&conn->connect_or_select_db, database.s, database.l, conn->persisten…
674 mysqlnd_set_persistent_string(&conn->hostname, hostname.s, hostname.l, conn->persistent);
677 mnd_sprintf(&p, 0, "%s via TCP/IP", conn->hostname.s);
679 SET_OOM_ERROR(conn->error_info);
682 conn->host_info = mnd_pestrdup(p, conn->persistent);
686 conn->unix_socket.s = mnd_pestrdup(socket_or_pipe.s, conn->persistent);
688 conn->host_info = mnd_pestrdup("Localhost via UNIX socket", conn->persistent);
691 mnd_sprintf(&p, 0, "%s via named pipe", conn->unix_socket.s);
693 SET_OOM_ERROR(conn->error_info);
696 conn->host_info = mnd_pestrdup(p, conn->persistent);
701 if (!conn->unix_socket.s || !conn->host_info) {
702 SET_OOM_ERROR(conn->error_info);
705 conn->unix_socket.l = strlen(conn->unix_socket.s);
708 SET_EMPTY_ERROR(conn->error_info);
710 mysqlnd_local_infile_default(conn);
712 if (FAIL == conn->m->execute_init_commands(conn)) {
716 …MYSQLND_INC_CONN_STATISTIC_W_VALUE2(conn->stats, STAT_CONNECT_SUCCESS, 1, STAT_OPENED_CONNECTIONS,…
720 if (conn->persistent) {
721 …MYSQLND_INC_CONN_STATISTIC_W_VALUE2(conn->stats, STAT_PCONNECT_SUCCESS, 1, STAT_OPENED_PERSISTENT_…
724 DBG_INF_FMT("connection_id=%" PRIu64, conn->thread_id);
729 …128s (trying to connect via %s)", conn->error_info->error_no, conn->error_info->error, transport.s…
730 if (!conn->error_info->error_no) {
733 …sg, 0, "Unknown error while trying to connect via %s", transport.s ? transport.s : conn->scheme.s);
734 SET_CLIENT_ERROR(conn->error_info, CR_CONNECTION_ERROR, UNKNOWN_SQLSTATE, msg);
743 conn->m->free_contents(conn);
744 MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_CONNECT_FAILURE);
761 MYSQLND_CONN_DATA * conn = conn_handle->data; local
769 …DBG_RETURN(conn->m->connect(conn, hostname, username, password, database, port, socket_or_pipe, my…
780 MYSQLND_METHOD(mysqlnd_conn_data, query)(MYSQLND_CONN_DATA * conn, const char * const query, const …
784 DBG_INF_FMT("conn=%p conn=%" PRIu64 " query=%s", conn, conn->thread_id, query);
786 if (PASS == conn->m->send_query(conn, query, query_len, NULL, NULL) &&
787 PASS == conn->m->reap_query(conn))
790 …if (conn->last_query_type == QUERY_UPSERT && UPSERT_STATUS_GET_AFFECTED_ROWS(conn->upsert_status))…
791 …MYSQLND_INC_CONN_STATISTIC_W_VALUE(conn->stats, STAT_ROWS_AFFECTED_NORMAL, UPSERT_STATUS_GET_AFFEC…
802 MYSQLND_CONN_DATA * conn, const char * const query, const size_t query_len,
806 DBG_INF_FMT("conn=%" PRIu64 " query=%s", conn->thread_id, query);
807 DBG_INF_FMT("conn->server_status=%u", UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_status));
810 enum_func_status ret = conn->command->query(conn, query_string);
811 DBG_INF_FMT("conn->server_status=%u", UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_status));
819 MYSQLND_METHOD(mysqlnd_conn_data, reap_query)(MYSQLND_CONN_DATA * conn)
822 DBG_INF_FMT("conn=%" PRIu64, conn->thread_id);
824 DBG_INF_FMT("conn->server_status=%u", UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_status));
825 enum_func_status ret = conn->command->reap_result(conn);
826 DBG_INF_FMT("conn->server_status=%u", UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_status));
834 MYSQLND_METHOD(mysqlnd_conn_data, list_method)(MYSQLND_CONN_DATA * conn, const char * const query, …
841 DBG_INF_FMT("conn=%" PRIu64 " query=%s wild=%p", conn->thread_id, query, achtung_wild);
857 if (PASS == conn->m->query(conn, show_query, show_query_len)) {
858 result = conn->m->store_result(conn);
870 MYSQLND_METHOD(mysqlnd_conn_data, err_no)(const MYSQLND_CONN_DATA * const conn)
872 return conn->error_info->error_no;
879 MYSQLND_METHOD(mysqlnd_conn_data, error)(const MYSQLND_CONN_DATA * const conn)
881 return conn->error_info->error;
888 MYSQLND_METHOD(mysqlnd_conn_data, sqlstate)(const MYSQLND_CONN_DATA * const conn)
890 return conn->error_info->sqlstate[0] ? conn->error_info->sqlstate:MYSQLND_SQLSTATE_NULL;
907 MYSQLND_METHOD(mysqlnd_conn_data, ssl_set)(MYSQLND_CONN_DATA * const conn, const char * key, const …
910 MYSQLND_VIO * vio = conn->vio;
926 MYSQLND_METHOD(mysqlnd_conn_data, escape_string)(MYSQLND_CONN_DATA * const conn, char * newstr, con…
930 DBG_INF_FMT("conn=%" PRIu64, conn->thread_id);
932 DBG_INF_FMT("server_status=%u", UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_status));
933 if (UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_status) & SERVER_STATUS_NO_BACKSLASH_ESCAPES) {
934 ret = mysqlnd_cset_escape_quotes(conn->charset, newstr, escapestr, escapestr_len);
936 ret = mysqlnd_cset_escape_slashes(conn->charset, newstr, escapestr, escapestr_len);
945 MYSQLND_METHOD(mysqlnd_conn_data, dump_debug_info)(MYSQLND_CONN_DATA * const conn)
948 DBG_INF_FMT("conn=%" PRIu64, conn->thread_id);
949 DBG_RETURN(conn->command->debug(conn));
956 MYSQLND_METHOD(mysqlnd_conn_data, select_db)(MYSQLND_CONN_DATA * const conn, const char * const db,…
959 DBG_INF_FMT("conn=%" PRIu64 " db=%s", conn->thread_id, db);
962 DBG_RETURN(conn->command->init_db(conn, database));
969 MYSQLND_METHOD(mysqlnd_conn_data, ping)(MYSQLND_CONN_DATA * const conn)
972 DBG_INF_FMT("conn=%" PRIu64, conn->thread_id);
974 enum_func_status ret = conn->command->ping(conn);
983 MYSQLND_METHOD(mysqlnd_conn_data, statistic)(MYSQLND_CONN_DATA * conn, zend_string **message)
986 DBG_INF_FMT("conn=%" PRIu64, conn->thread_id);
987 DBG_RETURN(conn->command->statistics(conn, message));
994 MYSQLND_METHOD(mysqlnd_conn_data, kill)(MYSQLND_CONN_DATA * conn, unsigned int pid)
997 DBG_INF_FMT("conn=%" PRIu64 " pid=%u", conn->thread_id, pid);
1001 const unsigned int read_response = (pid != conn->thread_id);
1003 DBG_RETURN(conn->command->process_kill(conn, process_id, read_response));
1010 MYSQLND_METHOD(mysqlnd_conn_data, set_charset)(MYSQLND_CONN_DATA * const conn, const char * const c…
1016 DBG_INF_FMT("conn=%" PRIu64 " cs=%s", conn->thread_id, csname);
1019 …SET_CLIENT_ERROR(conn->error_info, CR_CANT_FIND_CHARSET, UNKNOWN_SQLSTATE, "Invalid character set …
1026 if (FAIL == (ret = conn->m->query(conn, query, query_len)) || conn->error_info->error_no) {
1029 conn->charset = charset;
1041 MYSQLND_METHOD(mysqlnd_conn_data, refresh)(MYSQLND_CONN_DATA * const conn, uint8_t options)
1044 DBG_INF_FMT("conn=%" PRIu64 " options=%u", conn->thread_id, options);
1045 DBG_RETURN(conn->command->refresh(conn, options));
1052 MYSQLND_METHOD(mysqlnd_conn_data, shutdown)(MYSQLND_CONN_DATA * const conn, uint8_t level)
1055 DBG_INF_FMT("conn=%" PRIu64 " level=%u", conn->thread_id, level);
1056 DBG_RETURN(conn->command->shutdown(conn, level));
1063 MYSQLND_METHOD(mysqlnd_conn_data, send_close)(MYSQLND_CONN_DATA * const conn)
1066 MYSQLND_VIO * vio = conn->vio;
1068 enum mysqlnd_connection_state state = GET_CONNECTION_STATE(&conn->state);
1071 …DBG_INF_FMT("conn=%" PRIu64 " vio->data->stream->abstract=%p", conn->thread_id, net_stream? net_st…
1076 if (conn->persistent) {
1084 ret = conn->command->quit(conn);
1085 vio->data->m.close_stream(vio, conn->stats, conn->error_info);
1087 SET_CONNECTION_STATE(&conn->state, CONN_QUIT_SENT);
1098 DBG_ERR_FMT("Brutally closing connection [%p][%s]", conn, conn->scheme.s);
1111 SET_CONNECTION_STATE(&conn->state, CONN_QUIT_SENT);
1115 vio->data->m.close_stream(vio, conn->stats, conn->error_info);
1126 MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, get_reference)(MYSQLND_CONN_DATA * const conn)
1129 ++conn->refcount;
1130 DBG_INF_FMT("conn=%" PRIu64 " new_refcount=%u", conn->thread_id, conn->refcount);
1131 DBG_RETURN(conn);
1138 MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, free_reference)(MYSQLND_CONN_DATA * const conn)
1142 DBG_INF_FMT("conn=%" PRIu64 " old_refcount=%u", conn->thread_id, conn->refcount);
1143 if (!(--conn->refcount)) {
1149 ret = conn->m->send_close(conn);
1150 conn->m->dtor(conn);
1159 MYSQLND_METHOD(mysqlnd_conn_data, field_count)(const MYSQLND_CONN_DATA * const conn)
1161 return conn->field_count;
1168 MYSQLND_METHOD(mysqlnd_conn_data, server_status)(const MYSQLND_CONN_DATA * const conn)
1170 return UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_status);
1177 MYSQLND_METHOD(mysqlnd_conn_data, insert_id)(const MYSQLND_CONN_DATA * const conn)
1179 return UPSERT_STATUS_GET_LAST_INSERT_ID(conn->upsert_status);
1186 MYSQLND_METHOD(mysqlnd_conn_data, affected_rows)(const MYSQLND_CONN_DATA * const conn)
1188 return UPSERT_STATUS_GET_AFFECTED_ROWS(conn->upsert_status);
1195 MYSQLND_METHOD(mysqlnd_conn_data, warning_count)(const MYSQLND_CONN_DATA * const conn)
1197 return UPSERT_STATUS_GET_WARNINGS(conn->upsert_status);
1204 MYSQLND_METHOD(mysqlnd_conn_data, info)(const MYSQLND_CONN_DATA * const conn)
1206 return conn->last_message.s;
1229 MYSQLND_METHOD(mysqlnd_conn_data, get_server_info)(const MYSQLND_CONN_DATA * const conn)
1231 return conn->server_version;
1238 MYSQLND_METHOD(mysqlnd_conn_data, get_host_info)(const MYSQLND_CONN_DATA * const conn)
1240 return conn->host_info;
1247 MYSQLND_METHOD(mysqlnd_conn_data, get_proto_info)(const MYSQLND_CONN_DATA * const conn)
1249 return conn->protocol_version;
1256 MYSQLND_METHOD(mysqlnd_conn_data, charset_name)(const MYSQLND_CONN_DATA * const conn)
1258 return conn->charset->name;
1265 MYSQLND_METHOD(mysqlnd_conn_data, thread_id)(const MYSQLND_CONN_DATA * const conn)
1267 return conn->thread_id;
1274 MYSQLND_METHOD(mysqlnd_conn_data, get_server_version)(const MYSQLND_CONN_DATA * const conn)
1279 if (!(p = conn->server_version)) {
1296 MYSQLND_METHOD(mysqlnd_conn_data, more_results)(const MYSQLND_CONN_DATA * const conn)
1300 …DBG_RETURN(UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_status) & SERVER_MORE_RESULTS_EXISTS? TRUE…
1307 MYSQLND_METHOD(mysqlnd_conn_data, next_result)(MYSQLND_CONN_DATA * const conn)
1310 DBG_INF_FMT("conn=%" PRIu64 "", conn->thread_id);
1312 SET_EMPTY_ERROR(conn->error_info);
1314 if (GET_CONNECTION_STATE(&conn->state) != CONN_NEXT_RESULT_PENDING) {
1318 UPSERT_STATUS_SET_AFFECTED_ROWS_TO_ERROR(conn->upsert_status);
1323 enum_func_status ret = conn->m->query_read_result_set_header(conn, NULL);
1329 if (!conn->error_info->error_no) {
1332 SET_CONNECTION_STATE(&conn->state, CONN_QUIT_SENT);
1333 conn->m->send_close(conn);
1335 …DBG_INF_FMT("Error from the server : (%u) %s", conn->error_info->error_no, conn->error_info->error…
1339 …if (conn->last_query_type == QUERY_UPSERT && UPSERT_STATUS_GET_AFFECTED_ROWS(conn->upsert_status))…
1340 …MYSQLND_INC_CONN_STATISTIC_W_VALUE(conn->stats, STAT_ROWS_AFFECTED_NORMAL, UPSERT_STATUS_GET_AFFEC…
1349 MYSQLND_METHOD(mysqlnd_conn_data, change_user)(MYSQLND_CONN_DATA * const conn,
1361 conn->thread_id, user?user:"", passwd?"***":"null", db?db:"", silent == TRUE);
1363 SET_EMPTY_ERROR(conn->error_info);
1364 UPSERT_STATUS_SET_AFFECTED_ROWS_TO_ERROR(conn->upsert_status);
1378 ret = mysqlnd_run_authentication(conn, user, passwd, passwd_len, db, strlen(db),
1379 conn->authentication_plugin_data, conn->options->auth_protocol,
1380 … 0 /*charset not used*/, conn->options, conn->server_capabilities, silent, TRUE/*is_change*/);
1394 MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(MYSQLND_CONN_DATA * const conn,
1401 DBG_INF_FMT("conn=%" PRIu64 " option=%u", conn->thread_id, option);
1414 ret = conn->vio->data->m.set_client_option(conn->vio, option, value);
1419 …ret = conn->protocol_frame_codec->data->m.set_client_option(conn->protocol_frame_codec, option, va…
1422 conn->options->int_and_float_native = *(unsigned int*) value;
1426 conn->options->flags |= CLIENT_LOCAL_FILES;
1428 conn->options->flags &= ~CLIENT_LOCAL_FILES;
1433 if (conn->options->local_infile_directory) {
1434 mnd_pefree(conn->options->local_infile_directory, conn->persistent);
1438 conn->options->local_infile_directory = NULL;
1440 conn->options->local_infile_directory = mnd_pestrdup(value, conn->persistent);
1450 …ew_init_commands = mnd_perealloc(conn->options->init_commands, sizeof(char *) * (conn->options->nu…
1451 conn->options->init_commands = new_init_commands;
1452 new_command = mnd_pestrdup(value, conn->persistent);
1453 conn->options->init_commands[conn->options->num_commands] = new_command;
1454 ++conn->options->num_commands;
1469 …SET_CLIENT_ERROR(conn->error_info, CR_CANT_FIND_CHARSET, UNKNOWN_SQLSTATE, "Unknown character set"…
1474 new_charset_name = mnd_pestrdup(value, conn->persistent);
1475 if (conn->options->charset_name) {
1476 mnd_pefree(conn->options->charset_name, conn->persistent);
1478 conn->options->charset_name = new_charset_name;
1479 DBG_INF_FMT("charset=%s", conn->options->charset_name);
1483 conn->options->protocol = MYSQL_PROTOCOL_PIPE;
1487 conn->options->protocol = *(unsigned int*) value;
1504 conn->options->max_allowed_packet = *(unsigned int*) value;
1509 char * new_auth_protocol = value? mnd_pestrdup(value, conn->persistent) : NULL;
1510 if (conn->options->auth_protocol) {
1511 mnd_pefree(conn->options->auth_protocol, conn->persistent);
1513 conn->options->auth_protocol = new_auth_protocol;
1514 DBG_INF_FMT("auth_protocol=%s", conn->options->auth_protocol);
1519 conn->options->flags |= CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS;
1521 conn->options->flags &= ~CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS;
1525 if (conn->options->connect_attr) {
1526 … DBG_INF_FMT("Before reset %d attribute(s)", zend_hash_num_elements(conn->options->connect_attr));
1527 zend_hash_clean(conn->options->connect_attr);
1531 if (conn->options->connect_attr && value) {
1532 … DBG_INF_FMT("Before delete %d attribute(s)", zend_hash_num_elements(conn->options->connect_attr));
1533 zend_hash_str_del(conn->options->connect_attr, value, strlen(value));
1534 DBG_INF_FMT("%d left", zend_hash_num_elements(conn->options->connect_attr));
1553 MYSQLND_METHOD(mysqlnd_conn_data, set_client_option_2d)(MYSQLND_CONN_DATA * const conn,
1561 DBG_INF_FMT("conn=%" PRIu64 " option=%u", conn->thread_id, option);
1565 if (!conn->options->connect_attr) {
1567 conn->options->connect_attr = mnd_pemalloc(sizeof(HashTable), conn->persistent);
1568 …zend_hash_init(conn->options->connect_attr, 0, NULL, conn->persistent ? ZVAL_INTERNAL_PTR_DTOR : Z…
1575 if (conn->persistent) {
1584 zend_hash_update(conn->options->connect_attr, str, &attrz);
1598 MYSQLND_METHOD(mysqlnd_conn_data, use_result)(MYSQLND_CONN_DATA * const conn)
1601 DBG_INF_FMT("conn=%" PRIu64, conn->thread_id);
1603 if (!conn->current_result) {
1608 …if (conn->last_query_type != QUERY_SELECT || GET_CONNECTION_STATE(&conn->state) != CONN_FETCHING_D…
1609 …SET_CLIENT_ERROR(conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync);
1614 MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_UNBUFFERED_SETS);
1616 conn->current_result->conn = conn->m->get_reference(conn);
1618 MYSQLND_RES *result = conn->current_result->m.use_result(conn->current_result, FALSE);
1620 conn->current_result->m.free_result(conn->current_result, TRUE);
1622 conn->current_result = NULL;
1630 MYSQLND_METHOD(mysqlnd_conn_data, store_result)(MYSQLND_CONN_DATA * const conn)
1633 DBG_INF_FMT("conn=%" PRIu64 " conn=%p", conn->thread_id, conn);
1635 if (!conn->current_result) {
1640 …if (conn->last_query_type != QUERY_SELECT || GET_CONNECTION_STATE(&conn->state) != CONN_FETCHING_D…
1641 …SET_CLIENT_ERROR(conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync);
1646 MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_BUFFERED_SETS);
1647 MYSQLND_RES *result = conn->current_result->m.store_result(conn->current_result, conn, NULL);
1649 conn->current_result->m.free_result(conn->current_result, TRUE);
1651 conn->current_result = NULL;
1659 MYSQLND_METHOD(mysqlnd_conn_data, get_connection_stats)(const MYSQLND_CONN_DATA * const conn,
1663 mysqlnd_fill_stats_hash(conn->stats, mysqlnd_stats_values_names, return_value ZEND_FILE_LINE_CC);
1671 MYSQLND_METHOD(mysqlnd_conn_data, set_autocommit)(MYSQLND_CONN_DATA * conn, unsigned int mode)
1674 …DBG_RETURN(conn->m->query(conn, (mode) ? "SET AUTOCOMMIT=1":"SET AUTOCOMMIT=0", sizeof("SET AUTOCO…
1681 MYSQLND_METHOD(mysqlnd_conn_data, tx_commit)(MYSQLND_CONN_DATA * conn)
1683 return conn->m->tx_commit_or_rollback(conn, TRUE, TRANS_COR_NO_OPT, NULL);
1690 MYSQLND_METHOD(mysqlnd_conn_data, tx_rollback)(MYSQLND_CONN_DATA * conn)
1692 return conn->m->tx_commit_or_rollback(conn, FALSE, TRANS_COR_NO_OPT, NULL);
1699 MYSQLND_METHOD(mysqlnd_conn_data, tx_cor_options_to_string)(const MYSQLND_CONN_DATA * const conn, s…
1774 MYSQLND_METHOD(mysqlnd_conn_data, tx_commit_or_rollback)(MYSQLND_CONN_DATA * conn, const bool commi…
1779 conn->m->tx_cor_options_to_string(conn, &tmp_str, flags);
1794 SET_OOM_ERROR(conn->error_info);
1798 enum_func_status ret = conn->m->query(conn, query, query_len);
1807 MYSQLND_METHOD(mysqlnd_conn_data, tx_begin)(MYSQLND_CONN_DATA * conn, const unsigned int mode, cons…
1840 SET_OOM_ERROR(conn->error_info);
1844 enum_func_status ret = conn->m->query(conn, query, query_len);
1846 …if (ret && mode & (TRANS_START_READ_WRITE | TRANS_START_READ_ONLY) && mysqlnd_stmt_errno(conn) == …
1847 SET_CLIENT_ERROR(conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE,
1858 MYSQLND_METHOD(mysqlnd_conn_data, tx_savepoint)(MYSQLND_CONN_DATA * conn, const char * const name)
1863 …SET_CLIENT_ERROR(conn->error_info, CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, "Savepoint name not provide…
1870 SET_OOM_ERROR(conn->error_info);
1874 enum_func_status ret = conn->m->query(conn, query, query_len);
1883 MYSQLND_METHOD(mysqlnd_conn_data, tx_savepoint_release)(MYSQLND_CONN_DATA * conn, const char * cons…
1888 …SET_CLIENT_ERROR(conn->error_info, CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, "Savepoint name not provide…
1895 SET_OOM_ERROR(conn->error_info);
1899 enum_func_status ret = conn->m->query(conn, query, query_len);
1908 MYSQLND_METHOD(mysqlnd_conn_data, negotiate_client_api_capabilities)(MYSQLND_CONN_DATA * const conn
1912 if (conn) {
1913 ret = conn->client_api_capabilities;
1914 conn->client_api_capabilities = flags;
1924 MYSQLND_METHOD(mysqlnd_conn_data, get_client_api_capabilities)(const MYSQLND_CONN_DATA * const conn)
1927 DBG_RETURN(conn? conn->client_api_capabilities : 0);
1934 MYSQLND_METHOD(mysqlnd_conn_data, stmt_init)(MYSQLND_CONN_DATA * const conn)
1938 ret = conn->object_factory.get_prepared_statement(conn);
2034 MYSQLND_METHOD(mysqlnd_conn, clone_object)(MYSQLND * const conn)
2038 ret = conn->data->object_factory.clone_connection_object(conn);
2046 MYSQLND_METHOD_PRIVATE(mysqlnd_conn, dtor)(MYSQLND * conn)
2049 DBG_INF_FMT("conn=%" PRIu64, conn->data->thread_id);
2051 conn->data->m->free_reference(conn->data);
2053 mnd_pefree(conn, conn->persistent);
2064 MYSQLND_CONN_DATA * conn = conn_handle->data; local
2067 DBG_INF_FMT("conn=%" PRIu64, conn->thread_id);
2069 if (GET_CONNECTION_STATE(&conn->state) >= CONN_READY) {
2075 MYSQLND_INC_CONN_STATISTIC(conn->stats, close_type_to_stat_map[close_type]);
2082 enum_func_status ret = conn->m->send_close(conn);