diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-07-24 14:54:52 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-08-27 16:59:12 +0200 |
commit | 4070d55735f1642e563b8d60fc2e9771f4963a3f (patch) | |
tree | 1d8569fbc15ec6562b685729424f806800893233 /sql | |
parent | 3aff76f3750cf1ce2a58f093cb46190c2417f3bd (diff) | |
download | mariadb-git-4070d55735f1642e563b8d60fc2e9771f4963a3f.tar.gz |
fix: CHECK and DEFAULT after CREATE ... SELECT
expression defaults and check constraints should behave as
constant default values - copied from fields, not copied from expressions
Diffstat (limited to 'sql')
-rw-r--r-- | sql/field.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/field.cc b/sql/field.cc index 73e6b4edc3c..b5d971d4ce2 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -10482,8 +10482,8 @@ Column_definition::Column_definition(THD *thd, Field *old_field, comment= old_field->comment; decimals= old_field->decimals(); vcol_info= old_field->vcol_info; - default_value= old_field->default_value; - check_constraint= old_field->check_constraint; + default_value= orig_field ? orig_field->default_value : 0; + check_constraint= orig_field ? orig_field->check_constraint : 0; option_list= old_field->option_list; switch (sql_type) { |