Below is the list of changes that have just been committed into a local
5.1 repository of igor. When igor does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-05-08 17:50:19-07:00, igor@stripped +3 -0
Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into olga.mysql.com:/home/igor/mysql-5.1-opt
MERGE: 1.1810.2868.38
mysql-test/r/loaddata.result@stripped, 2007-05-08 17:50:16-07:00, igor@stripped +0 -0
SCCS merged
MERGE: 1.20.1.8
mysql-test/t/loaddata.test@stripped, 2007-05-08 17:46:34-07:00, igor@stripped +0 -0
Auto merged
MERGE: 1.15.1.7
sql/sql_load.cc@stripped, 2007-05-08 17:46:34-07:00, igor@stripped +0 -0
Auto merged
MERGE: 1.78.1.35
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: igor
# Host: olga.mysql.com
# Root: /home/igor/mysql-5.1-opt/RESYNC
--- 1.123/sql/sql_load.cc 2007-05-08 17:50:26 -07:00
+++ 1.124/sql/sql_load.cc 2007-05-08 17:50:26 -07:00
@@ -605,6 +605,8 @@
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_TOO_FEW_RECORDS,
ER(ER_WARN_TOO_FEW_RECORDS), thd->row_count);
+ if (!field->maybe_null() && field->type() == FIELD_TYPE_TIMESTAMP)
+ ((Field_timestamp*) field)->set_time();
}
else
{
@@ -782,6 +784,8 @@
thd->row_count);
DBUG_RETURN(1);
}
+ if (!field->maybe_null() && field->type() == FIELD_TYPE_TIMESTAMP)
+ ((Field_timestamp*) field)->set_time();
/*
QQ: We probably should not throw warning for each field.
But how about intention to always have the same number
--- 1.31/mysql-test/r/loaddata.result 2007-05-08 17:50:26 -07:00
+++ 1.32/mysql-test/r/loaddata.result 2007-05-08 17:50:26 -07:00
@@ -174,6 +174,25 @@
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;
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (1);
SET NAMES latin1;
--- 1.25/mysql-test/t/loaddata.test 2007-05-08 17:50:26 -07:00
+++ 1.26/mysql-test/t/loaddata.test 2007-05-08 17:50:26 -07:00
@@ -156,6 +156,32 @@
--exec rm $MYSQLTEST_VARDIR/tmp/t1
SET @@SQL_MODE=@OLD_SQL_MODE;
drop table t1,t2;
+
+#
+# Bug#27670: LOAD DATA does not set CURRENT_TIMESTAMP default value for a
+# TIMESTAMP field when no value has been provided.
+#
+create table t1(f1 int, f2 timestamp not null default current_timestamp);
+create table t2(f1 int);
+insert into t2 values(1),(2);
+disable_query_log;
+eval select * into outfile '$MYSQLTEST_VARDIR/tmp/t2' from t2;
+eval load data infile '$MYSQLTEST_VARDIR/tmp/t2' into table t1;
+enable_query_log;
+select f1 from t1 where f2 <> '0000-00-00 00:00:00';
+--exec rm $MYSQLTEST_VARDIR/tmp/t2
+delete from t1;
+disable_query_log;
+eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t2'
+FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n'
+FROM t2;
+eval load data infile '$MYSQLTEST_VARDIR/tmp/t2' into table t1
+FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n';
+enable_query_log;
+select f1 from t1 where f2 <> '0000-00-00 00:00:00';
+--exec rm $MYSQLTEST_VARDIR/tmp/t2
+drop table t1,t2;
+
# End of 5.0 tests
| Thread |
|---|
| • bk commit into 5.1 tree (igor:1.2513) | igor | 9 May |