mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
remove dead VERS_EXPERIMENTAL code
changed to use DBUG keywords instead, so that the code is compiled and tested added tests.
This commit is contained in:
@ -388,7 +388,7 @@ alter table t modify column row_start bigint unsigned;
|
||||
ERROR HY000: Can not change system versioning field `row_start`
|
||||
set system_versioning_alter_history= SURVIVE;
|
||||
ERROR 42000: Variable 'system_versioning_alter_history' can't be set to the value of 'SURVIVE'
|
||||
set system_versioning_alter_history= DROP;
|
||||
set system_versioning_alter_history= 'DROP';
|
||||
ERROR 42000: Variable 'system_versioning_alter_history' can't be set to the value of 'DROP'
|
||||
create or replace table t (a int) with system versioning;
|
||||
alter table t add system versioning;
|
||||
|
39
mysql-test/suite/versioning/r/debug.result
Normal file
39
mysql-test/suite/versioning/r/debug.result
Normal file
@ -0,0 +1,39 @@
|
||||
create table t1 (a int);
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
create temporary table tt1 (a int) with system versioning;
|
||||
ERROR HY000: System versioning prohibited for TEMPORARY tables
|
||||
set @old_dbug=@@global.debug_dbug;
|
||||
set global debug_dbug='+d,sysvers_force';
|
||||
create table t2 (a int);
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
||||
create temporary table tt2 (a int) with system versioning;
|
||||
show create table tt2;
|
||||
Table Create Table
|
||||
tt2 CREATE TEMPORARY TABLE `tt2` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
connect con1, localhost, root;
|
||||
create table t3 (a int);
|
||||
show create table t3;
|
||||
Table Create Table
|
||||
t3 CREATE TABLE `t3` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
|
||||
create temporary table tt3 (a int) with system versioning;
|
||||
show create table tt3;
|
||||
Table Create Table
|
||||
tt3 CREATE TEMPORARY TABLE `tt3` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
disconnect con1;
|
||||
connection default;
|
||||
set global debug_dbug=@old_dbug;
|
||||
drop table t1, t2, t3;
|
@ -272,7 +272,7 @@ alter table t modify column row_start bigint unsigned;
|
||||
set system_versioning_alter_history= SURVIVE;
|
||||
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
set system_versioning_alter_history= DROP;
|
||||
set system_versioning_alter_history= 'DROP';
|
||||
|
||||
if (0)
|
||||
{
|
||||
|
29
mysql-test/suite/versioning/t/debug.test
Normal file
29
mysql-test/suite/versioning/t/debug.test
Normal file
@ -0,0 +1,29 @@
|
||||
--source include/have_debug.inc
|
||||
|
||||
create table t1 (a int);
|
||||
show create table t1;
|
||||
|
||||
--error ER_VERS_TEMPORARY
|
||||
create temporary table tt1 (a int) with system versioning;
|
||||
|
||||
set @old_dbug=@@global.debug_dbug;
|
||||
set global debug_dbug='+d,sysvers_force';
|
||||
|
||||
create table t2 (a int);
|
||||
show create table t2;
|
||||
|
||||
create temporary table tt2 (a int) with system versioning;
|
||||
show create table tt2;
|
||||
|
||||
--connect con1, localhost, root
|
||||
|
||||
create table t3 (a int);
|
||||
show create table t3;
|
||||
|
||||
create temporary table tt3 (a int) with system versioning;
|
||||
show create table tt3;
|
||||
--disconnect con1
|
||||
--connection default
|
||||
|
||||
set global debug_dbug=@old_dbug;
|
||||
drop table t1, t2, t3;
|
@ -1474,10 +1474,6 @@ public:
|
||||
return flags & VERS_UPDATE_UNVERSIONED_FLAG;
|
||||
}
|
||||
|
||||
#ifdef VERS_EXPERIMENTAL
|
||||
bool vers_sys_invisible(THD *thd) const;
|
||||
#endif
|
||||
|
||||
virtual bool vers_trx_id() const
|
||||
{
|
||||
return false;
|
||||
|
@ -6962,13 +6962,9 @@ bool Table_scope_and_contents_source_st::vers_fix_system_fields(
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef VERS_EXPERIMENTAL
|
||||
if (thd->variables.vers_force)
|
||||
{
|
||||
alter_info->flags|= Alter_info::ALTER_ADD_SYSTEM_VERSIONING;
|
||||
options|= HA_VERSIONED_TABLE;
|
||||
}
|
||||
#endif
|
||||
DBUG_EXECUTE_IF("sysvers_force", if (!tmp_table()) {
|
||||
alter_info->flags|= Alter_info::ALTER_ADD_SYSTEM_VERSIONING;
|
||||
options|= HA_VERSIONED_TABLE; });
|
||||
|
||||
// Possibly override default storage engine to match one used in source table.
|
||||
if (vers_tables && alter_info->flags & Alter_info::ALTER_ADD_SYSTEM_VERSIONING &&
|
||||
@ -7183,11 +7179,7 @@ bool Vers_parse_info::fix_alter_info(THD *thd, Alter_info *alter_info,
|
||||
if (!need_check(alter_info) && !share->versioned)
|
||||
return false;
|
||||
|
||||
if (share->tmp_table && share->tmp_table != INTERNAL_TMP_TABLE
|
||||
#ifdef VERS_EXPERIMENTAL
|
||||
&& !thd->variables.vers_force
|
||||
#endif
|
||||
)
|
||||
if (DBUG_EVALUATE_IF("sysvers_force", 0, share->tmp_table))
|
||||
{
|
||||
my_error(ER_VERS_TEMPORARY, MYF(0));
|
||||
return true;
|
||||
|
@ -9852,11 +9852,6 @@ static int get_options(int *argc_ptr, char ***argv_ptr)
|
||||
if (thread_cache_size > max_connections)
|
||||
SYSVAR_AUTOSIZE(thread_cache_size, max_connections);
|
||||
|
||||
#ifdef VERS_EXPERIMENTAL
|
||||
if (opt_bootstrap)
|
||||
global_system_variables.vers_force= 0;
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -200,15 +200,6 @@ struct vers_asof_timestamp_t
|
||||
{}
|
||||
};
|
||||
|
||||
#ifdef VERS_EXPERIMENTAL
|
||||
enum vers_show_enum
|
||||
{
|
||||
VERS_SHOW_OFF= 0,
|
||||
VERS_SHOW_RANGE,
|
||||
VERS_SHOW_ALWAYS
|
||||
};
|
||||
#endif
|
||||
|
||||
enum vers_alter_history_enum
|
||||
{
|
||||
VERS_ALTER_HISTORY_ERROR= 0,
|
||||
|
@ -7617,35 +7617,6 @@ bool get_key_map_from_key_list(key_map *map, TABLE *table,
|
||||
}
|
||||
|
||||
|
||||
#ifdef VERS_EXPERIMENTAL
|
||||
inline
|
||||
bool Field::vers_sys_invisible(THD *thd) const
|
||||
{
|
||||
DBUG_ASSERT(vers_sys_field());
|
||||
DBUG_ASSERT(table);
|
||||
DBUG_ASSERT(table->versioned());
|
||||
DBUG_ASSERT(table->pos_in_table_list);
|
||||
|
||||
if (thd->lex->sql_command != SQLCOM_SELECT)
|
||||
return invisible;
|
||||
|
||||
switch (thd->variables.vers_show)
|
||||
{
|
||||
case VERS_SHOW_RANGE:
|
||||
{
|
||||
vers_system_time_t vers_type= table->pos_in_table_list->vers_conditions.type;
|
||||
return vers_type > SYSTEM_TIME_AS_OF ? false : invisible;
|
||||
}
|
||||
case VERS_SHOW_ALWAYS:
|
||||
return false;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
return invisible;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
Drops in all fields instead of current '*' field
|
||||
|
||||
@ -7775,12 +7746,7 @@ insert_fields(THD *thd, Name_resolution_context *context, const char *db_name,
|
||||
Field_iterator_natural_join).
|
||||
But view fields can never be invisible.
|
||||
*/
|
||||
if ((field= field_iterator.field()) && (
|
||||
#ifdef VERS_EXPERIMENTAL
|
||||
field->vers_sys_field() && field->table->versioned() ?
|
||||
field->vers_sys_invisible(thd) :
|
||||
#endif
|
||||
field->invisible != VISIBLE))
|
||||
if ((field= field_iterator.field()) && field->invisible != VISIBLE)
|
||||
continue;
|
||||
|
||||
Item *item;
|
||||
|
@ -708,10 +708,6 @@ typedef struct system_variables
|
||||
uint in_subquery_conversion_threshold;
|
||||
|
||||
vers_asof_timestamp_t vers_asof_timestamp;
|
||||
#ifdef VERS_EXPERIMENTAL
|
||||
my_bool vers_force;
|
||||
ulong vers_show;
|
||||
#endif
|
||||
my_bool vers_innodb_algorithm_simple;
|
||||
ulong vers_alter_history;
|
||||
} SV;
|
||||
|
@ -2108,9 +2108,6 @@ int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet,
|
||||
TABLE *table= table_list->table;
|
||||
TABLE_SHARE *share= table->s;
|
||||
sql_mode_t sql_mode= thd->variables.sql_mode;
|
||||
#ifdef VERS_EXPERIMENTAL
|
||||
ulong vers_show= thd->variables.vers_show;
|
||||
#endif
|
||||
bool explicit_fields= false;
|
||||
bool foreign_db_mode= sql_mode & (MODE_POSTGRESQL | MODE_ORACLE |
|
||||
MODE_MSSQL | MODE_DB2 |
|
||||
@ -2192,11 +2189,7 @@ int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet,
|
||||
|
||||
uint flags = field->flags;
|
||||
|
||||
if (field->invisible > INVISIBLE_USER
|
||||
#ifdef VERS_EXPERIMENTAL
|
||||
&& !(field->vers_sys_field() && vers_show == VERS_SHOW_ALWAYS)
|
||||
#endif
|
||||
)
|
||||
if (field->invisible > INVISIBLE_USER)
|
||||
continue;
|
||||
if (not_the_first_field)
|
||||
packet->append(STRING_WITH_LEN(",\n"));
|
||||
@ -2344,11 +2337,7 @@ int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet,
|
||||
for (uint j=0 ; j < key_info->user_defined_key_parts ; j++,key_part++)
|
||||
{
|
||||
Field *field= key_part->field;
|
||||
if (field->invisible > INVISIBLE_USER
|
||||
#ifdef VERS_EXPERIMENTAL
|
||||
&& !(field->vers_sys_field() && vers_show == VERS_SHOW_ALWAYS)
|
||||
#endif
|
||||
)
|
||||
if (field->invisible > INVISIBLE_USER)
|
||||
continue;
|
||||
|
||||
if (j)
|
||||
@ -2387,11 +2376,7 @@ int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet,
|
||||
DBUG_ASSERT(fe);
|
||||
explicit_fields= fs->invisible < INVISIBLE_SYSTEM;
|
||||
DBUG_ASSERT(!explicit_fields || fe->invisible < INVISIBLE_SYSTEM);
|
||||
if (explicit_fields
|
||||
#ifdef VERS_EXPERIMENTAL
|
||||
|| vers_show == VERS_SHOW_ALWAYS
|
||||
#endif
|
||||
)
|
||||
if (explicit_fields)
|
||||
{
|
||||
packet->append(STRING_WITH_LEN(",\n PERIOD FOR SYSTEM_TIME ("));
|
||||
append_identifier(thd,packet,fs->field_name.str, fs->field_name.length);
|
||||
@ -2444,11 +2429,7 @@ int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet,
|
||||
add_table_options(thd, table, create_info_arg,
|
||||
table_list->schema_table != 0, 0, packet);
|
||||
|
||||
if (table->versioned()
|
||||
#ifdef VERS_EXPERIMENTAL
|
||||
&& (!thd->variables.vers_force || explicit_fields)
|
||||
#endif
|
||||
)
|
||||
if (table->versioned())
|
||||
packet->append(STRING_WITH_LEN(" WITH SYSTEM VERSIONING"));
|
||||
|
||||
#ifdef WITH_PARTITION_STORAGE_ENGINE
|
||||
@ -5037,11 +5018,6 @@ public:
|
||||
static bool get_all_archive_tables(THD *thd,
|
||||
Dynamic_array<String> &all_archive_tables)
|
||||
{
|
||||
#ifdef VERS_EXPERIMENTAL
|
||||
if (thd->variables.vers_show == VERS_SHOW_ALWAYS)
|
||||
return false;
|
||||
#endif
|
||||
|
||||
if (thd->variables.vers_alter_history != VERS_ALTER_HISTORY_SURVIVE)
|
||||
return false;
|
||||
|
||||
|
@ -6229,9 +6229,7 @@ versioning_option:
|
||||
{
|
||||
if (Lex->create_info.options & HA_LEX_CREATE_TMP_TABLE)
|
||||
{
|
||||
#ifdef VERS_EXPERIMENTAL
|
||||
if (!thd->variables.vers_force)
|
||||
#endif
|
||||
if (DBUG_EVALUATE_IF("sysvers_force", 0, 1))
|
||||
{
|
||||
my_error(ER_VERS_TEMPORARY, MYF(0));
|
||||
MYSQL_YYABORT;
|
||||
@ -16161,18 +16159,6 @@ set_expr_or_default:
|
||||
if ($$ == NULL)
|
||||
MYSQL_YYABORT;
|
||||
}
|
||||
| DROP
|
||||
{
|
||||
$$=new (thd->mem_root) Item_string_sys(thd, "DROP", 4);
|
||||
if ($$ == NULL)
|
||||
MYSQL_YYABORT;
|
||||
}
|
||||
| RANGE_SYM
|
||||
{
|
||||
$$=new (thd->mem_root) Item_string_sys(thd, C_STRING_WITH_LEN("RANGE"));
|
||||
if ($$ == NULL)
|
||||
MYSQL_YYABORT;
|
||||
}
|
||||
;
|
||||
|
||||
/* Lock function */
|
||||
|
@ -396,21 +396,6 @@ static Sys_var_vers_asof Sys_vers_asof_timestamp(
|
||||
SESSION_VAR(vers_asof_timestamp.type), NO_CMD_LINE,
|
||||
Sys_var_vers_asof::asof_keywords, DEFAULT(SYSTEM_TIME_UNSPECIFIED));
|
||||
|
||||
#ifdef VERS_EXPERIMENTAL
|
||||
static Sys_var_mybool Sys_vers_force(
|
||||
"debug_system_versioning_force", "Force system versioning for all created tables",
|
||||
SESSION_VAR(vers_force), CMD_LINE(OPT_ARG), DEFAULT(FALSE));
|
||||
|
||||
static const char *vers_show_keywords[]= {"OFF", "RANGE", "ALWAYS", NULL};
|
||||
static Sys_var_enum Sys_vers_show(
|
||||
"debug_system_versioning_show", "Show system fields special rules. "
|
||||
"OFF: don't use special show rules; "
|
||||
"RANGE: show implicit system fields only in range versioned queries; "
|
||||
"ALWAYS: show system fields in all queries",
|
||||
SESSION_VAR(vers_show), CMD_LINE(REQUIRED_ARG),
|
||||
vers_show_keywords, DEFAULT(VERS_SHOW_OFF));
|
||||
#endif
|
||||
|
||||
static Sys_var_mybool Sys_vers_innodb_algorithm_simple(
|
||||
"system_versioning_innodb_algorithm_simple",
|
||||
"Use simple algorithm of timestamp handling in InnoDB instead of TRX_SEES",
|
||||
|
Reference in New Issue
Block a user