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

System Versioning pre0.12

Merge remote-tracking branch 'origin/archive/2017-10-17' into 10.3
This commit is contained in:
Aleksey Midenkov
2017-11-07 00:37:49 +03:00
354 changed files with 20615 additions and 1638 deletions

View File

@ -112,6 +112,7 @@
#include "wsrep_mysqld.h"
#include "wsrep_thd.h"
#include "vtmd.h"
static void wsrep_mysql_parse(THD *thd, char *rawbuf, uint length,
Parser_state *parser_state,
@ -3165,6 +3166,11 @@ bool Sql_cmd_call::execute(THD *thd)
if (do_execute_sp(thd, sp))
return true;
if (sp->sp_cache_version() == ULONG_MAX)
{
sp_cache_flush(thd->sp_proc_cache, sp);
}
/*
Disable slow log for the above call(), if calls are disabled.
Instead we will log the executed statements to the slow log.
@ -4015,7 +4021,6 @@ mysql_execute_command(THD *thd)
copy.
*/
Alter_info alter_info(lex->alter_info, thd->mem_root);
if (thd->is_fatal_error)
{
/* If out of memory when creating a copy of alter_info. */
@ -4043,6 +4048,7 @@ mysql_execute_command(THD *thd)
*/
if (!(create_info.used_fields & HA_CREATE_USED_ENGINE))
create_info.use_default_db_type(thd);
/*
If we are using SET CHARSET without DEFAULT, add an implicit
DEFAULT to not confuse old users. (This may change).
@ -4229,6 +4235,11 @@ mysql_execute_command(THD *thd)
}
else
{
if (create_info.vers_info.check_and_fix_implicit(
thd, &alter_info, &create_info, create_table->table_name))
{
goto end_with_restore_list;
}
/*
In STATEMENT format, we probably have to replicate also temporary
tables, like mysql replication does. Also check if the requested
@ -6386,6 +6397,21 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables)
if (check_dependencies_in_with_clauses(lex->with_clauses_list))
return 1;
if (thd->variables.vers_alter_history == VERS_ALTER_HISTORY_SURVIVE)
{
for (TABLE_LIST *table= all_tables; table; table= table->next_local)
{
if (table->vers_conditions)
{
VTMD_exists vtmd(*table);
if (vtmd.check_exists(thd))
return 1;
if (vtmd.exists && vtmd.setup_select(thd))
return 1;
}
}
}
if (!(res= open_and_lock_tables(thd, all_tables, TRUE, 0)))
{
if (lex->describe)