diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-05-15 17:34:47 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-05-17 11:32:13 +0200 |
commit | 1b2078b4d8aa64bad8bc2b3a201e0cf8c075e6a6 (patch) | |
tree | 5ad2afc8b10d349bdb708632231fa2a6ba94eb63 /sql | |
parent | aa2e1ade17e656446c534c02e9cb0adab50b46e1 (diff) | |
download | mariadb-git-1b2078b4d8aa64bad8bc2b3a201e0cf8c075e6a6.tar.gz |
MDEV-15318 CREATE .. SELECT VALUES produces invalid table structure
When Item_insert_value needs a dummy field,
use zero-length Field_string, not Field_null.
The latter isn't compatible with CREATE ... SELECT.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/item.cc b/sql/item.cc index c5c6df0ec48..135255ee21e 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -8541,10 +8541,10 @@ bool Item_insert_value::fix_fields(THD *thd, Item **items) } else { - Field *tmp_field= field_arg->field; - /* charset doesn't matter here, it's to avoid sigsegv only */ - tmp_field= new Field_null(0, 0, Field::NONE, field_arg->field->field_name, - &my_charset_bin); + static uchar null_bit=1; + /* charset doesn't matter here */ + Field *tmp_field= new Field_string(0, 0, &null_bit, 1, Field::NONE, + field_arg->field->field_name, &my_charset_bin); if (tmp_field) { tmp_field->init(field_arg->field->table); |