diff options
author | unknown <anozdrin/alik@quad.opbmk> | 2008-03-22 11:32:24 +0300 |
---|---|---|
committer | unknown <anozdrin/alik@quad.opbmk> | 2008-03-22 11:32:24 +0300 |
commit | 28cd75fec42e327950056617c7dea8ae4d2f6395 (patch) | |
tree | b3aa1f1d53c2b22c84865fac7a02fa96bddf0d35 /sql/unireg.cc | |
parent | 9965de17bab9c84472c3dc8c92f22c7d98da8f87 (diff) | |
download | mariadb-git-28cd75fec42e327950056617c7dea8ae4d2f6395.tar.gz |
Fix for Bug#34274: Invalid handling of 'DEFAULT 0'
for YEAR data type.
The problem was that for some unknown reason 0 was not allowed
as a default value for YEAR data type. That was coded before BK.
However the Manual does not say a word about such a limitation.
Also, it looks inconsistent with other data types.
The fix is to allow 0 as a default value.
mysql-test/r/create.result:
Update result file.
mysql-test/t/create.test:
Add a test case for Bug#34274: Invalid handling of 'DEFAULT 0'
for YEAR data type.
sql/unireg.cc:
Allow 0 as a default value for YEAR data type.
Diffstat (limited to 'sql/unireg.cc')
-rw-r--r-- | sql/unireg.cc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sql/unireg.cc b/sql/unireg.cc index 38f09a7946c..abab4632fe4 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -979,9 +979,7 @@ static bool make_empty_rec(THD *thd, File file,enum legacy_db_type table_type, type= (Field::utype) MTYP_TYPENR(field->unireg_check); - if (field->def && - (regfield->real_type() != MYSQL_TYPE_YEAR || - field->def->val_int() != 0)) + if (field->def) { int res= field->def->save_in_field(regfield, 1); /* If not ok or warning of level 'note' */ |