diff options
author | Alexander Barkov <bar@mariadb.com> | 2019-08-29 12:35:19 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2019-09-03 09:51:35 +0400 |
commit | ef00ac4c86daf3294c46a45358da636763fb0049 (patch) | |
tree | 833c4c4696dfe423eea4531b436b5080a0cb6077 /sql/field.h | |
parent | dc719597ee0b11da722e9813639e8b48018a8c10 (diff) | |
download | mariadb-git-ef00ac4c86daf3294c46a45358da636763fb0049.tar.gz |
Part2: MDEV-18156 Assertion `0' failed or `btr_validate_index(index, 0, false)' in row_upd_sec_index_entry or error code 126: Index is corrupted upon DELETE with PAD_CHAR_TO_FULL_LENGTH
This patch allows the server to open old tables that have
"bad" generated columns (i.e. indexed virtual generated columns,
persistent generated columns) that depend on sql_mode,
for general things like SELECT, INSERT, DROP, etc.
Warning are issued in such cases.
Only these commands are now disallowed and return an error:
- CREATE TABLE introducing a "bad" generated column
- ALTER TABLE introducing a "bad" generated column
- CREATE INDEX introdicing a "bad" generated column
(i.e. adding an index on a virtual generated column
that depends on sql_mode).
Note, these commands are allowed:
- ALTER TABLE removing a "bad" generate column
- ALTER TABLE removing an index from a "bad" virtual generated column
- DROP INDEX removing an index from a "bad" virtual generated column
but only if the table does not have any "bad" columns as a result.
Diffstat (limited to 'sql/field.h')
-rw-r--r-- | sql/field.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/field.h b/sql/field.h index 9333d1492fd..c82febd956e 100644 --- a/sql/field.h +++ b/sql/field.h @@ -697,7 +697,8 @@ protected: val_str(&result); return to->store(result.ptr(), result.length(), charset()); } - void error_generated_column_function_is_not_allowed(THD *thd) const; + void error_generated_column_function_is_not_allowed(THD *thd, bool error) + const; static void do_field_int(Copy_field *copy); static void do_field_real(Copy_field *copy); static void do_field_string(Copy_field *copy); @@ -1175,7 +1176,7 @@ public: } bool stored_in_db() const { return !vcol_info || vcol_info->stored_in_db; } - bool check_vcol_sql_mode_dependency(THD *) const; + bool check_vcol_sql_mode_dependency(THD *, vcol_init_mode mode) const; virtual sql_mode_t value_depends_on_sql_mode() const { |