summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagne Mahre <magne.mahre@sun.com>2009-11-04 10:17:39 +0100
committerMagne Mahre <magne.mahre@sun.com>2009-11-04 10:17:39 +0100
commit491b8fc755b87c3ef591bed994017f8aecae92b3 (patch)
treecb93480c9817f196d03df0f95357afc99be8aaad
parentb1006c87f7acf3f778f93f97254a7f0bc2308ed0 (diff)
parent913aae59e42986e40a8d471192d817c6fb985a20 (diff)
downloadmariadb-git-491b8fc755b87c3ef591bed994017f8aecae92b3.tar.gz
Backport to 5.6.0
-rw-r--r--mysql-test/r/func_sapdb.result32
-rw-r--r--mysql-test/t/func_sapdb.test18
2 files changed, 26 insertions, 24 deletions
diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result
index 831c2899f66..2d6154cd1f7 100644
--- a/mysql-test/r/func_sapdb.result
+++ b/mysql-test/r/func_sapdb.result
@@ -282,33 +282,33 @@ TIMEDIFF(TIME('17:59:00'),TIME('17:00:00')),
TIMEDIFF(TIME('17:00:00'),TIME('17:59:00'));
1Eq 1NEq1 1NEq2 2Eq 2NEq1 2NEq2 3Eq 3NEq1 3NEq2 Time0 Time00 Literal0000 TIMEDIFF(TIME('17:59:00'),TIME('17:00:00')) TIMEDIFF(TIME('17:00:00'),TIME('17:59:00'))
1 0 0 1 0 0 1 0 0 00:00:00 00:00:00 00:00:00 00:59:00 -00:59:00
-SELECT sec_to_time(3020399)=time('838:59:59');
-sec_to_time(3020399)=time('838:59:59')
+SELECT sec_to_time(3020399)=TIME('838:59:59');
+sec_to_time(3020399)=TIME('838:59:59')
1
-SELECT sec_to_time(-3020399)=time('-838:59:59');
-sec_to_time(-3020399)=time('-838:59:59')
+SELECT sec_to_time(-3020399)=TIME('-838:59:59');
+sec_to_time(-3020399)=TIME('-838:59:59')
1
SELECT sec_to_time(-3020399)='-838:59:59';
sec_to_time(-3020399)='-838:59:59'
1
-SELECT time(sec_to_time(-3020399))=time('-838:59:59');
-time(sec_to_time(-3020399))=time('-838:59:59')
+SELECT time(sec_to_time(-3020399))=TIME('-838:59:59');
+time(sec_to_time(-3020399))=TIME('-838:59:59')
1
-SELECT time(sec_to_time(-3020399))=time('-838:59:58');
-time(sec_to_time(-3020399))=time('-838:59:58')
+SELECT time(sec_to_time(-3020399))=TIME('-838:59:58');
+time(sec_to_time(-3020399))=TIME('-838:59:58')
0
SELECT maketime(-1,0,1)='-01:00:01';
maketime(-1,0,1)='-01:00:01'
1
-SELECT TIME(maketime(-1,0,1))=TIME('-01:00:01');
-TIME(maketime(-1,0,1))=TIME('-01:00:01')
+SELECT TIME(maketime(-1,0,1))=CAST('-01:00:01' AS TIME);
+TIME(maketime(-1,0,1))=CAST('-01:00:01' AS TIME)
1
-SELECT maketime(-1,0,1)=TIME('-01:00:01');
-maketime(-1,0,1)=TIME('-01:00:01')
+SELECT maketime(-1,0,1)=CAST('-01:00:01' AS TIME);
+maketime(-1,0,1)=CAST('-01:00:01' AS TIME)
1
-SELECT maketime(1,0,1)=TIME('01:00:01');
-maketime(1,0,1)=TIME('01:00:01')
+SELECT maketime(1,0,1)=CAST('01:00:01' AS TIME);
+maketime(1,0,1)=CAST('01:00:01' AS TIME)
1
-SELECT maketime(1,0,1)=TIME('01:00:02');
-maketime(1,0,1)=TIME('01:00:02')
+SELECT maketime(1,0,1)=CAST('01:00:02' AS TIME);
+maketime(1,0,1)=CAST('01:00:02' AS TIME)
0
diff --git a/mysql-test/t/func_sapdb.test b/mysql-test/t/func_sapdb.test
index 6fed52e1b84..89eae5955aa 100644
--- a/mysql-test/t/func_sapdb.test
+++ b/mysql-test/t/func_sapdb.test
@@ -173,20 +173,22 @@ SELECT TIMEDIFF(TIME('17:00:00'),TIME('17:00:00'))=TIME('00:00:00') AS 1Eq,
# Bug#42661 - sec_to_time() and signedness
#
-SELECT sec_to_time(3020399)=time('838:59:59');
-SELECT sec_to_time(-3020399)=time('-838:59:59');
+SELECT sec_to_time(3020399)=TIME('838:59:59');
+SELECT sec_to_time(-3020399)=TIME('-838:59:59');
SELECT sec_to_time(-3020399)='-838:59:59';
-SELECT time(sec_to_time(-3020399))=time('-838:59:59');
-SELECT time(sec_to_time(-3020399))=time('-838:59:58');
+SELECT time(sec_to_time(-3020399))=TIME('-838:59:59');
+SELECT time(sec_to_time(-3020399))=TIME('-838:59:58');
#
# Bug#42662 - maketime() and signedness
#
+# TIME(...) and CAST(... AS TIME) go through the same code-path here,
+# but we'll explicitly show show that both work in case the ever changes.
SELECT maketime(-1,0,1)='-01:00:01';
-SELECT TIME(maketime(-1,0,1))=TIME('-01:00:01');
-SELECT maketime(-1,0,1)=TIME('-01:00:01');
-SELECT maketime(1,0,1)=TIME('01:00:01');
-SELECT maketime(1,0,1)=TIME('01:00:02');
+SELECT TIME(maketime(-1,0,1))=CAST('-01:00:01' AS TIME);
+SELECT maketime(-1,0,1)=CAST('-01:00:01' AS TIME);
+SELECT maketime(1,0,1)=CAST('01:00:01' AS TIME);
+SELECT maketime(1,0,1)=CAST('01:00:02' AS TIME);
# End of 5.0 tests