summaryrefslogtreecommitdiff
path: root/sql/field.cc
diff options
context:
space:
mode:
authorSachin Setiya <sachin.setiya@mariadb.com>2018-02-01 18:58:55 +0530
committerSachin Setiya <sachin.setiya@mariadb.com>2018-02-01 18:58:55 +0530
commit909a47b0edc6ac84d6345e95e7dde779186b1dbf (patch)
treede6cee4359fc8c26d147a072011031699f02db6b /sql/field.cc
parentf756bb21c53faf15d91f1896cf0787fce813356c (diff)
downloadmariadb-git-bb-mdev-14849.tar.gz
This commit solves a couple of issuesbb-mdev-14849
1st. Create_field does not have function vers_sys_field() kind of handy function, second I think Create_field and Field should not divert much , and Field does have this function. 2nd. Versioning column does not have NOT_NULL_FLAG, since they can never be null. So I have added NOT_NULL_FLAG. 3rd. Since I added NOT_NULL_FLAG this created one issue , versioning column of datatype bigint unsigned were getting NO_DEFAULT_VALUE_FLAG. This makes test like versioning.insert to fail, Reason being If a column gets this flag if we insert 'default' value it will generate error(that is why ) test was failing. So now versioning column wont get NO_DEFAULT_VALUE_FLAG flag.
Diffstat (limited to 'sql/field.cc')
-rw-r--r--sql/field.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/field.cc b/sql/field.cc
index 82a75e98f46..4accd26127e 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -10475,8 +10475,8 @@ bool Column_definition::check(THD *thd)
TIMESTAMP columns get implicit DEFAULT value when
explicit_defaults_for_timestamp is not set.
*/
- if (opt_explicit_defaults_for_timestamp ||
- !is_timestamp_type())
+ if ((opt_explicit_defaults_for_timestamp ||
+ !is_timestamp_type()) && !vers_sys_field())
{
flags|= NO_DEFAULT_VALUE_FLAG;
}