diff options
author | Nikita Malyavin <nikitamalyavin@gmail.com> | 2021-08-02 14:24:54 +0300 |
---|---|---|
committer | Nikita Malyavin <nikitamalyavin@gmail.com> | 2021-10-20 15:15:21 +0300 |
commit | 1811fd51fbae9e6c1f06ce93faef2bf1279cd3b6 (patch) | |
tree | 09ac85ad2477fd90218fb7a4db3c10bbc497ed59 /mysql-test/suite/gcol/r | |
parent | a8401ad5afd766d2febc63a8bcfedda2978ff44c (diff) | |
download | mariadb-git-1811fd51fbae9e6c1f06ce93faef2bf1279cd3b6.tar.gz |
MDEV-26262 frm is corrupted after ER_EXPRESSION_REFERS_TO_UNINIT_FIELD
This is a duplicate of MDEV-18278 89936f11e965, but I will add an
additional assertion
Description:
The frm corruption should not be reported during CREATE TABLE. Normally
it doesn't, and the data to fill TABLE is taken by open_table_from_share
call. However, the vcol data is stored as SQL string in
table->s->vcol_defs.str and is anyway parsed on each table open.
It is impossible [or hard] to avoid, because it's hard to clone the
expression tree in general (it's easier to parse).
Normally parse_vcol_defs should only fail on semantic errors. If so,
error_reported is set to true. Any other failure is not expected during
table creation. There is either unhandled/unacknowledged error, or
something went really wrong, like memory reject. This all should be
asserted anyway.
Solution:
* Set *error_reported=true for the forward references check;
* Assert for every unacknowledged error during table creation.
Diffstat (limited to 'mysql-test/suite/gcol/r')
-rw-r--r-- | mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result | 6 | ||||
-rw-r--r-- | mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result b/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result index 48c4613f6ca..2c0adc3d493 100644 --- a/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result +++ b/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result @@ -699,6 +699,12 @@ ADD COLUMN c INT AS (1 + DEFAULT(a)) VIRTUAL; affected rows: 1 info: Records: 1 Duplicates: 0 Warnings: 0 DROP TABLE t1; +# +# MDEV-26262 frm is corrupted after ER_EXPRESSION_REFERS_TO_UNINIT_FIELD +# +CREATE TABLE MDEV_26262 (a INT,b INT AS (b) VIRTUAL); +ERROR 01000: Expression for field `b` is referring to uninitialized field `b` +NOT FOUND /Incorrect information in file: './test/MDEV_26262.frm'/ in mysqld.1.err DROP VIEW IF EXISTS v1,v2; DROP TABLE IF EXISTS t1,t2,t3; DROP PROCEDURE IF EXISTS p1; diff --git a/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result b/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result index b7ae6488c95..126a6c5e271 100644 --- a/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result @@ -699,6 +699,12 @@ ADD COLUMN c INT AS (1 + DEFAULT(a)) VIRTUAL; affected rows: 1 info: Records: 1 Duplicates: 0 Warnings: 0 DROP TABLE t1; +# +# MDEV-26262 frm is corrupted after ER_EXPRESSION_REFERS_TO_UNINIT_FIELD +# +CREATE TABLE MDEV_26262 (a INT,b INT AS (b) VIRTUAL); +ERROR 01000: Expression for field `b` is referring to uninitialized field `b` +NOT FOUND /Incorrect information in file: './test/MDEV_26262.frm'/ in mysqld.1.err DROP VIEW IF EXISTS v1,v2; DROP TABLE IF EXISTS t1,t2,t3; DROP PROCEDURE IF EXISTS p1; |