mariadb/mysql-test/suite/versioning
Aleksey Midenkov 04b06f69e6 MDEV-37008 ROW START/END columns added with ALTER TABLE are never INVISIBLE
FIXME: commit message

invisible property in Alter_column and
add_alter_alter_list(). mysql_prepare_alter_table() takes this value
for new column definition.

Vers_parse_info::fix_alter_info() is more fine-grained on throwing
ER_VERS_ALTER_SYSTEM_FIELD. Now it does not fail on visibility change.

mysqltest: At line 78: query 'alter table t add column trx_start
timestamp(6) as row start' succeeded - should have failed with error
ER_MISSING (4125)...

In Vers_parse_info::fix_alter_info() we override data from parser:

9059          as_row= start_end_t(start, end);
9060          period= as_row;

Then Vers_parse_info::check_conditions() fails to find error:

9180      if (!as_row.start || !as_row.end)
9181      {
9182        my_error(ER_MISSING, MYF(0), table_name.str,
9183                    as_row.start ? "AS ROW END" : "AS ROW START");
9184        return true;
9185      }

But as_row is used when creating frm:

529       if (create_info->versioned())
530       {
531         *pos++= EXTRA2_PERIOD_FOR_SYSTEM_TIME;
532         *pos++= 2 * frm_fieldno_size;
533         store_frm_fieldno(pos, get_fieldno_by_name(create_info, create_fields,
534                                            create_info->vers_info.as_row.start));
535         pos+= frm_fieldno_size;
536         store_frm_fieldno(pos, get_fieldno_by_name(create_info, create_fields,
537                                            create_info->vers_info.as_row.end));
538         pos+= frm_fieldno_size;
539       }

There should be other info for it to take start/end indexes.

Parser stage and prepare stage data
separation. Vers_parse_info::as_row and period are left untouched (the
exception is fix_create_like() where as_row
2025-07-21 17:25:28 +03:00
..
r MDEV-37008 ROW START/END columns added with ALTER TABLE are never INVISIBLE 2025-07-21 17:25:28 +03:00
t MDEV-37008 ROW START/END columns added with ALTER TABLE are never INVISIBLE 2025-07-21 17:25:28 +03:00
common.inc Merge 11.4 into 11.6 2024-10-03 16:09:56 +03:00
common.opt Tests: versioning suite fix when no test_versioning plugin 2019-07-09 10:01:54 +03:00
common_finish.inc Merge branch '10.6' into 10.9 2023-08-04 08:01:06 +02:00
disabled.def MDEV-14820 System versioning is applied incorrectly to CTEs 2018-05-12 10:16:45 +02:00
engines.combinations MDEV-16937 Strict SQL with system versioned tables causes issues (10.4) 2020-05-29 11:45:19 +03:00
engines.inc versioning/common.inc must "have_innodb" 2017-12-05 17:42:27 +03:00
innodb.combinations MDEV-17038 ALTER TABLE CHANGE COLUMN c1 c1 bigint NOT NULL - generates error if table uses SYSTEM VERSIONING 2018-11-01 16:42:06 +02:00
innodb.inc MDEV-17038 ALTER TABLE CHANGE COLUMN c1 c1 bigint NOT NULL - generates error if table uses SYSTEM VERSIONING 2018-11-01 16:42:06 +02:00
key_type.combinations versioning test suite fixes 2019-10-10 00:20:34 +03:00
key_type.inc versioning test suite fixes 2019-10-10 00:20:34 +03:00
sys_time.inc MDEV-32188 make TIMESTAMP use whole 32-bit unsigned range 2024-05-27 12:39:02 +02:00
wait_system_clock.inc fix tests on windows 2018-01-13 02:01:35 +01:00