mariadb/mysql-test/suite/gcol/r/innodb_wl8114.result
Sergei Golubchik 1cae1af6f9 MDEV-5800 InnoDB support for indexed vcols
* remove old 5.2+ InnoDB support for virtual columns
  * enable corresponding parts of the innodb-5.7 sources
  * copy corresponding test cases from 5.7
  * copy detailed Alter_inplace_info::HA_ALTER_FLAGS flags from 5.7
     - and more detailed detection of changes in fill_alter_inplace_info()
  * more "innodb compatibility hooks" in sql_class.cc to
     - create/destroy/reset a THD (used by background purge threads)
     - find a prelocked table by name
     - open a table (from a background purge thread)

  * different from 5.7:
    - new service thread "thd_destructor_proxy" to make sure all THDs are
      destroyed at the correct point in time during the server shutdown
    - proper opening/closing of tables for vcol evaluations in
       + FK checks (use already opened prelocked tables)
       + purge threads (open the table, MDLock it, add it to tdc, close
         when not needed)
    - cache open tables in vc_templ
    - avoid unnecessary allocations, reuse table->record[0] and table->s->default_values
    - not needed in 5.7, because it overcalculates:
      + tell the server to calculate vcols for an on-going inline ADD INDEX
      + calculate vcols for correct error messages

  * update other engines (mroonga/tokudb) accordingly
2016-12-12 20:27:42 +01:00

52 lines
1.8 KiB
Text

CREATE TABLE t_8114 (a int) ENGINE = INNODB;
ALTER TABLE t_8114 ADD b INT GENERATED ALWAYS AS (a) VIRTUAL;
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE "%t_8114";
NAME
test/t_8114
SELECT NAME, POS, MTYPE, PRTYPE, LEN FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS WHERE TABLE_ID IN (SELECT TABLE_ID FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE "%t_8114");
NAME POS MTYPE PRTYPE LEN
a 0 6 1027 4
b 65537 6 9219 4
INSERT INTO t_8114 VALUES (9, default);
INSERT INTO t_8114 VALUES (3, default);
INSERT INTO t_8114 VALUES (1, default);
INSERT INTO t_8114 VALUES (5, default);
SELECT * FROM t_8114;
a b
9 9
3 3
1 1
5 5
DROP TABLE t_8114;
CREATE TABLE t_8114 (Column_1 CHAR(5) GENERATED ALWAYS AS (PI()+5), Column_2 CHAR(5)) engine=innodb;
SELECT NAME, FLAG, N_COLS FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE "%t_8114";
NAME FLAG N_COLS
test/t_8114 33 4
SELECT NAME, POS, MTYPE, PRTYPE, LEN FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS WHERE TABLE_ID IN (SELECT TABLE_ID FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE "%t_8114");
NAME POS MTYPE PRTYPE LEN
Column_2 0 2 524542 5
Column_1 65536 2 532734 5
INSERT INTO t_8114 VALUES (default, "aa");
INSERT INTO t_8114 VALUES (default, "bb");
INSERT INTO t_8114 VALUES (default, "ee");
INSERT INTO t_8114 VALUES (default, "pp");
SELECT * FROM t_8114;
Column_1 Column_2
8.142 aa
8.142 bb
8.142 ee
8.142 pp
ALTER TABLE t_8114 DROP Column_1;
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE "%t_8114";
NAME
test/t_8114
SELECT NAME, POS, MTYPE, PRTYPE, LEN FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS WHERE TABLE_ID IN (SELECT TABLE_ID FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE "%t_8114");
NAME POS MTYPE PRTYPE LEN
Column_2 0 2 524542 5
SELECT * FROM t_8114;
Column_2
aa
bb
ee
pp
DROP TABLE t_8114;