Browse Source
MDEV-10201 Bad results for CREATE TABLE t1 (a INT DEFAULT b, b INT DEFAULT 4)
MDEV-10201 Bad results for CREATE TABLE t1 (a INT DEFAULT b, b INT DEFAULT 4)
Optionally do table->update_default_fields() even for INSERT that supposedly provides values for all column. Because these "values" might be DEFAULT, which would need table->update_default_fields() at the end. Also set Item_default_value::used_tables() from the default expression. Non-zero used_field() means that mysql_insert() will initialize all fields to their default values (with restore_record()) even if all columns are later provided with values. Because default expressions may refer to other columns and they must be initialized.pull/313/head
8 changed files with 63 additions and 26 deletions
-
18mysql-test/r/default.result
-
20mysql-test/t/default.test
-
11sql/field.cc
-
12sql/field.h
-
18sql/item.cc
-
2sql/item.h
-
7sql/sql_base.cc
-
1sql/sql_insert.cc
Write
Preview
Loading…
Cancel
Save
Reference in new issue