diff options
author | Alexander Barkov <bar@mariadb.com> | 2021-12-28 17:43:40 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2021-12-28 17:53:56 +0400 |
commit | eb019e3d6c9772c1caa10ee788a4d4c3be116a64 (patch) | |
tree | 3cc837ad0d4d0bbc3e9b7c7ed2cb988641a4e9ee /sql/sql_select.cc | |
parent | 97695675c5db88eb7f2e0249dd693f070de16f06 (diff) | |
download | mariadb-git-bb-10.3-bar-MDEV-18918.tar.gz |
MDEV-18918 SQL mode EMPTY_STRING_IS_NULL breaks RBR upon CREATE TABLE .. SELECTbb-10.3-bar-MDEV-18918
Removing DEFAULT from INFORMATION_SCHEMA columns.
DEFAULT in read-only tables is rather meaningless.
Upgrade should go smoothly.
Also fixes:
MDEV-20254 Problems with EMPTY_STRING_IS_NULL and I_S tables
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 40ecc45df45..21996ffcc07 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -17842,8 +17842,15 @@ create_tmp_table(THD *thd, TMP_TABLE_PARAM *param, List<Item> &fields, The test for item->marker == 4 is ensure we don't create a group-by key over a bit field as heap tables can't handle that. */ - Field *new_field= (param->schema_table) ? - item->create_field_for_schema(thd, table) : + Field *new_field; + if (param->schema_table) + { + if ((new_field= item->create_field_for_schema(thd, table))) + new_field->flags|= NO_DEFAULT_VALUE_FLAG; + } + else + { + new_field= create_tmp_field(thd, table, item, type, ©_func, tmp_from_field, &default_field[fieldnr], group != 0, @@ -17858,7 +17865,7 @@ create_tmp_table(THD *thd, TMP_TABLE_PARAM *param, List<Item> &fields, */ item->marker == 4 || param->bit_fields_as_long, force_copy_fields); - + } if (unlikely(!new_field)) { if (unlikely(thd->is_fatal_error)) |