mirror of
https://github.com/MariaDB/server.git
synced 2025-12-10 19:44:09 +03:00
* 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
88 lines
1.7 KiB
Plaintext
88 lines
1.7 KiB
Plaintext
CREATE TABLE t (
|
|
a INTEGER,
|
|
b BLOB GENERATED ALWAYS AS (a) VIRTUAL,
|
|
INDEX (b(57))
|
|
)ENGINE=INNODB;
|
|
INSERT INTO t (a) VALUES (9);
|
|
BEGIN;
|
|
SAVEPOINT a;
|
|
UPDATE t set a = 12;
|
|
DELETE FROM t where a = 12;
|
|
ROLLBACK TO SAVEPOINT a;
|
|
COMMIT;
|
|
CHECK TABLE t;
|
|
Table Op Msg_type Msg_text
|
|
test.t check status OK
|
|
SELECT * FROM t;
|
|
a b
|
|
9 9
|
|
BEGIN;
|
|
INSERT INTO t (a) VALUES (10);
|
|
SELECT * FROM t;
|
|
a b
|
|
9 9
|
|
DROP TABLE t;
|
|
CREATE TABLE t (
|
|
a INTEGER,
|
|
b BLOB GENERATED ALWAYS AS (a) VIRTUAL,
|
|
c INTEGER
|
|
)ENGINE=INNODB;
|
|
INSERT INTO t (a,c) VALUES (9, 10);
|
|
SELECT * FROM t;
|
|
a b c
|
|
9 9 10
|
|
connect con1,localhost,root,,;
|
|
connection con1;
|
|
SET DEBUG_SYNC = 'row_log_apply_after SIGNAL created WAIT_FOR dml_done';
|
|
ALTER TABLE t ADD KEY(b(57)), ALGORITHM=INPLACE;
|
|
connection default;
|
|
SET DEBUG_SYNC = 'now WAIT_FOR created';
|
|
BEGIN;
|
|
INSERT INTO t (a,c) VALUES (10, 12);
|
|
SELECT * FROM t;
|
|
a b c
|
|
9 9 10
|
|
10 10 12
|
|
ROLLBACK;
|
|
SET DEBUG_SYNC = 'now SIGNAL dml_done';
|
|
connection con1;
|
|
disconnect con1;
|
|
connection default;
|
|
SELECT * FROM t;
|
|
a b c
|
|
9 9 10
|
|
DROP TABLE t;
|
|
CREATE TABLE t (
|
|
a INT,
|
|
b INT,
|
|
c INT GENERATED ALWAYS AS(a+b),
|
|
d INT GENERATED ALWAYS AS(a+b+b),
|
|
KEY(c, d)
|
|
)ENGINE=INNODB;
|
|
INSERT INTO t (a,b) VALUES (9, 10);
|
|
SELECT * FROM t;
|
|
a b c d
|
|
9 10 19 29
|
|
connect con1,localhost,root,,;
|
|
connection con1;
|
|
SET DEBUG_SYNC = 'row_log_apply_after SIGNAL created WAIT_FOR dml_done';
|
|
ALTER TABLE t DROP COLUMN c, ALGORITHM=INPLACE;
|
|
connection default;
|
|
SET DEBUG_SYNC = 'now WAIT_FOR created';
|
|
BEGIN;
|
|
INSERT INTO t (a,b) VALUES (10, 12);
|
|
SELECT * FROM t;
|
|
a b c d
|
|
9 10 19 29
|
|
10 12 22 34
|
|
ROLLBACK;
|
|
SET DEBUG_SYNC = 'now SIGNAL dml_done';
|
|
connection con1;
|
|
disconnect con1;
|
|
connection default;
|
|
SELECT * FROM t;
|
|
a b d
|
|
9 10 29
|
|
DROP TABLE t;
|
|
SET DEBUG_SYNC = 'RESET';
|