diff options
author | evgen@moonbone.local <> | 2007-05-09 00:23:16 +0400 |
---|---|---|
committer | evgen@moonbone.local <> | 2007-05-09 00:23:16 +0400 |
commit | 98fa542a087b84ff003df21314f100cc6b0dc37a (patch) | |
tree | 69ab7b065ce4093f1b8cd0efe745fc437fc35bdf /mysql-test/r/loaddata.result | |
parent | 6bef06edfa9d1e0859e85613734761efec411f12 (diff) | |
download | mariadb-git-98fa542a087b84ff003df21314f100cc6b0dc37a.tar.gz |
Bug#27670: LOAD DATA does not set CURRENT_TIMESTAMP default value for a
TIMESTAMP field when no value has been provided.
The LOAD DATA sets the current time in the TIMESTAMP field with
CURRENT_TIMESTAMP default value when the field is detected as a null.
But when the LOAD DATA command loads data from a file that doesn't contain
enough data for all fields then the rest of fields are simply set to null
without any check. This leads to no value being inserted to such TIMESTAMP
field.
Now the read_sep_field() and the read_fixed_length() functions set current
time to the TIMESTAMP field with CURRENT_TIMESTAMP default value in all cases
when a NULL value is loaded to the field.
Diffstat (limited to 'mysql-test/r/loaddata.result')
-rw-r--r-- | mysql-test/r/loaddata.result | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result index 0478e48025f..f66aa78377d 100644 --- a/mysql-test/r/loaddata.result +++ b/mysql-test/r/loaddata.result @@ -165,3 +165,22 @@ f2 2 SET @@SQL_MODE=@OLD_SQL_MODE; drop table t1,t2; +create table t1(f1 int, f2 timestamp not null default current_timestamp); +create table t2(f1 int); +insert into t2 values(1),(2); +Warnings: +Warning 1261 Row 1 doesn't contain data for all columns +Warning 1261 Row 2 doesn't contain data for all columns +select f1 from t1 where f2 <> '0000-00-00 00:00:00'; +f1 +1 +2 +delete from t1; +Warnings: +Warning 1261 Row 1 doesn't contain data for all columns +Warning 1261 Row 2 doesn't contain data for all columns +select f1 from t1 where f2 <> '0000-00-00 00:00:00'; +f1 +1 +2 +drop table t1,t2; |