summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/func_sapdb.result14
-rw-r--r--mysql-test/t/func_sapdb.test18
-rw-r--r--netware/Makefile.am2
-rw-r--r--sql/item_timefunc.h1
4 files changed, 34 insertions, 1 deletions
diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result
index 63f9ac71e74..bbc5390895b 100644
--- a/mysql-test/r/func_sapdb.result
+++ b/mysql-test/r/func_sapdb.result
@@ -268,3 +268,17 @@ timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')<time('00:00:00')
SELECT CAST(time('-73:42:12') AS DECIMAL);
CAST(time('-73:42:12') AS DECIMAL)
-734212
+SELECT TIMEDIFF(TIME('17:00:00'),TIME('17:00:00'))=TIME('00:00:00') AS 1Eq,
+TIMEDIFF(TIME('17:59:00'),TIME('17:00:00'))=TIME('00:00:00') AS 1NEq1,
+TIMEDIFF(TIME('18:00:00'),TIME('17:00:00'))=TIME('00:00:00') AS 1NEq2,
+TIMEDIFF(TIME('17:00:00'),TIME('17:00:00'))= '00:00:00' AS 2Eq,
+TIMEDIFF(TIME('17:59:00'),TIME('17:00:00'))= '00:00:00' AS 2NEq1,
+TIMEDIFF(TIME('18:00:00'),TIME('17:00:00'))= '00:00:00' AS 2NEq2,
+TIMEDIFF(TIME('17:00:00'),TIME('17:00:00'))=TIME(0) AS 3Eq,
+TIMEDIFF(TIME('17:59:00'),TIME('17:00:00'))=TIME(0) AS 3NEq1,
+TIMEDIFF(TIME('18:00:00'),TIME('17:00:00'))=TIME(0) AS 3NEq2,
+TIME(0) AS Time0, TIME('00:00:00') AS Time00, '00:00:00' AS Literal0000,
+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
diff --git a/mysql-test/t/func_sapdb.test b/mysql-test/t/func_sapdb.test
index f37ee0c39f0..1292c475732 100644
--- a/mysql-test/t/func_sapdb.test
+++ b/mysql-test/t/func_sapdb.test
@@ -151,4 +151,22 @@ select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')<time('00:00:00');
SELECT CAST(time('-73:42:12') AS DECIMAL);
+
+#
+# Bug#42525 - TIMEDIFF function
+#
+
+SELECT TIMEDIFF(TIME('17:00:00'),TIME('17:00:00'))=TIME('00:00:00') AS 1Eq,
+ TIMEDIFF(TIME('17:59:00'),TIME('17:00:00'))=TIME('00:00:00') AS 1NEq1,
+ TIMEDIFF(TIME('18:00:00'),TIME('17:00:00'))=TIME('00:00:00') AS 1NEq2,
+ TIMEDIFF(TIME('17:00:00'),TIME('17:00:00'))= '00:00:00' AS 2Eq,
+ TIMEDIFF(TIME('17:59:00'),TIME('17:00:00'))= '00:00:00' AS 2NEq1,
+ TIMEDIFF(TIME('18:00:00'),TIME('17:00:00'))= '00:00:00' AS 2NEq2,
+ TIMEDIFF(TIME('17:00:00'),TIME('17:00:00'))=TIME(0) AS 3Eq,
+ TIMEDIFF(TIME('17:59:00'),TIME('17:00:00'))=TIME(0) AS 3NEq1,
+ TIMEDIFF(TIME('18:00:00'),TIME('17:00:00'))=TIME(0) AS 3NEq2,
+ TIME(0) AS Time0, TIME('00:00:00') AS Time00, '00:00:00' AS Literal0000,
+ TIMEDIFF(TIME('17:59:00'),TIME('17:00:00')),
+ TIMEDIFF(TIME('17:00:00'),TIME('17:59:00'));
+
# End of 5.0 tests
diff --git a/netware/Makefile.am b/netware/Makefile.am
index 0b30da17609..3d0402ce714 100644
--- a/netware/Makefile.am
+++ b/netware/Makefile.am
@@ -94,7 +94,7 @@ EXTRA_DIST= $(BUILT_SOURCES) comp_err.def install_test_db.ncf \
BUILD/compile-netware-standard BUILD/create-patch \
BUILD/cron-build BUILD/crontab BUILD/knetware.imp \
BUILD/mwasmnlm BUILD/mwccnlm BUILD/mwenv BUILD/mwldnlm \
- BUILD/nwbootstrap BUILD/openssl.imp BUILD/save-patch
+ BUILD/nwbuild BUILD/openssl.imp BUILD/save-patch
endif
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index 94b02d1eaf6..9e3c2e8c89f 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -419,6 +419,7 @@ public:
{
return save_time_in_field(field);
}
+ longlong val_int() { return val_int_from_decimal(); }
bool result_as_longlong() { return TRUE; }
};