1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-27595 Backport SQL service, introduced by MDEV-19275.

The SQL SERVICE backported into the 10.4.
This commit is contained in:
Alexey Botchkov
2022-07-24 00:40:06 +04:00
parent f0fe23566b
commit 1fa196a559
30 changed files with 1843 additions and 413 deletions

View File

@ -1670,14 +1670,14 @@ static MYSQL_METHODS client_methods=
cli_use_result, /* use_result */
cli_fetch_lengths, /* fetch_lengths */
cli_flush_use_result, /* flush_use_result */
cli_read_change_user_result /* read_change_user_result */
cli_read_change_user_result, /* read_change_user_result */
NULL /* on_close_free */
#ifndef MYSQL_SERVER
,cli_list_fields, /* list_fields */
cli_read_prepare_result, /* read_prepare_result */
cli_stmt_execute, /* stmt_execute */
cli_read_binary_rows, /* read_binary_rows */
cli_unbuffered_fetch, /* unbuffered_fetch */
NULL, /* free_embedded_thd */
cli_read_statistics, /* read_statistics */
cli_read_query_result, /* next_result */
cli_read_binary_rows /* read_rows_from_cursor */
@ -3351,10 +3351,8 @@ static void mysql_close_free(MYSQL *mysql)
my_free(mysql->user);
my_free(mysql->passwd);
my_free(mysql->db);
#if defined(EMBEDDED_LIBRARY) || MYSQL_VERSION_ID >= 50100
my_free(mysql->info_buffer);
mysql->info_buffer= 0;
#endif
if (mysql->methods && mysql->methods->on_close_free)
(*mysql->methods->on_close_free)(mysql);
/* Clear pointers for better safety */
mysql->host_info= mysql->user= mysql->passwd= mysql->db= 0;
}
@ -3473,13 +3471,6 @@ void STDCALL mysql_close(MYSQL *mysql)
mysql_close_free_options(mysql);
mysql_close_free(mysql);
mysql_detach_stmt_list(&mysql->stmts, "mysql_close");
#ifndef MYSQL_SERVER
if (mysql->thd)
{
(*mysql->methods->free_embedded_thd)(mysql);
mysql->thd= 0;
}
#endif
if (mysql->free_me)
my_free(mysql);
}
@ -4301,3 +4292,9 @@ int STDCALL mysql_cancel(MYSQL *mysql)
return vio_shutdown(mysql->net.vio, SHUT_RDWR);
return -1;
}
my_ulonglong STDCALL mysql_affected_rows(MYSQL *mysql)
{
return mysql->affected_rows;
}