summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <joerg@trift2.>2007-11-16 10:42:32 +0100
committerunknown <joerg@trift2.>2007-11-16 10:42:32 +0100
commit1f373cb146aadfaa788fc712ea0ecd2ca2cad3dc (patch)
treecbd1fa926ff6b6581a4679dc619da1991f322f0b /mysql-test
parent1490691e31deb4577402120a80c5a448d3a28d6d (diff)
parent1140bed510c0857d4d757c637d8ec10621c2354c (diff)
downloadmariadb-git-1f373cb146aadfaa788fc712ea0ecd2ca2cad3dc.tar.gz
Merge trift2.:/MySQL/M50/mysql-5.0
into trift2.:/MySQL/M50/push-5.0
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/bigint.result6
-rw-r--r--mysql-test/t/bigint.test9
-rw-r--r--mysql-test/t/type_datetime.test19
3 files changed, 31 insertions, 3 deletions
diff --git a/mysql-test/r/bigint.result b/mysql-test/r/bigint.result
index 064304b27aa..b0d114f1655 100644
--- a/mysql-test/r/bigint.result
+++ b/mysql-test/r/bigint.result
@@ -170,6 +170,12 @@ t2.value64=t1.value64;
value64 value32 value64 value32
9223372036854775807 2 9223372036854775807 4
drop table t1, t2;
+create table t1 (sint64 bigint not null);
+insert into t1 values (-9223372036854775808);
+select * from t1;
+sint64
+-9223372036854775808
+drop table t1;
create table t1 select 1 as 'a';
show create table t1;
Table Create Table
diff --git a/mysql-test/t/bigint.test b/mysql-test/t/bigint.test
index 002dfad9981..f96350686af 100644
--- a/mysql-test/t/bigint.test
+++ b/mysql-test/t/bigint.test
@@ -113,6 +113,15 @@ t2.value64=t1.value64;
drop table t1, t2;
+# Test for BUG#30069, can't handle bigint -9223372036854775808 on
+# x86_64, with some GCC versions and optimizations.
+
+create table t1 (sint64 bigint not null);
+insert into t1 values (-9223372036854775808);
+select * from t1;
+
+drop table t1;
+
# End of 4.1 tests
#
diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test
index 08a94384aec..219af2336e1 100644
--- a/mysql-test/t/type_datetime.test
+++ b/mysql-test/t/type_datetime.test
@@ -155,13 +155,13 @@ set @@sql_mode='ansi,traditional';
insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38');
insert into t1 set dt='2007-03-23 13:49:38',da=dt;
# Test error handling
---error 1292
+--error ER_TRUNCATED_WRONG_VALUE
insert into t1 values ('2007-03-32','2007-03-23 13:49:38');
select * from t1;
drop table t1;
---error 1067
+--error ER_INVALID_DEFAULT
create table t1 (da date default '1962-03-32 23:33:34', dt datetime default '1962-03-03');
---error 1067
+--error ER_INVALID_DEFAULT
create table t1 (t time default '916:00:00 a');
set @@sql_mode= @org_mode;
@@ -169,6 +169,19 @@ set @@sql_mode= @org_mode;
#
# Bug#27590: Wrong DATE/DATETIME comparison.
#
+## The following sub test will fail (difference to expected result) if the
+## select curdate() < now(), f1 < now(), cast(f1 as date) < now() from t1;
+## runs exact at midnight ('00:00:00').
+## ( Bug#29290 type_datetime.test failure in 5.1 )
+## Therefore we sleep a bit if we are too close to midnight.
+## The complete test itself needs around 1 second.
+## Therefore a time_distance to midnight of 5 seconds should be sufficient.
+if (`SELECT CURTIME() > SEC_TO_TIME(24 * 3600 - 5)`)
+{
+ # We are here when CURTIME() is between '23:59:56' and '23:59:59'.
+ # So a sleep time of 5 seconds brings us between '00:00:01' and '00:00:04'.
+ --real_sleep 5
+}
create table t1 (f1 date, f2 datetime, f3 timestamp);
insert into t1(f1) values(curdate());
select curdate() < now(), f1 < now(), cast(f1 as date) < now() from t1;