summaryrefslogtreecommitdiff
path: root/mysql-test/t/date_formats.test
diff options
context:
space:
mode:
authorTimothy Smith <timothy.smith@sun.com>2009-01-13 23:29:11 +0100
committerTimothy Smith <timothy.smith@sun.com>2009-01-13 23:29:11 +0100
commit80e659a2edd273c9fa5df42fef012cfd6571752f (patch)
treed0419cb3ff3545c89e255e9621e2c137a6a163c8 /mysql-test/t/date_formats.test
parent50958a346a1b79610defb74fcfffbcd73e8e6326 (diff)
downloadmariadb-git-80e659a2edd273c9fa5df42fef012cfd6571752f.tar.gz
Fix Bug #35261: date_format test fails if new variables LIKE '%e_format' are added
Use SELECT FROM INFORMATION_SCHEMA instead of SHOW VARIABLES LIKE to restrict values correctly.
Diffstat (limited to 'mysql-test/t/date_formats.test')
-rw-r--r--mysql-test/t/date_formats.test21
1 files changed, 14 insertions, 7 deletions
diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test
index e474fac8a2a..e5dc7ffa53e 100644
--- a/mysql-test/t/date_formats.test
+++ b/mysql-test/t/date_formats.test
@@ -6,10 +6,15 @@
drop table if exists t1;
--enable_warnings
---replace_result ROW <format> STATEMENT <format> MIXED <format>
-SHOW GLOBAL VARIABLES LIKE "%e_format";
---replace_result ROW <format> STATEMENT <format> MIXED <format>
-SHOW SESSION VARIABLES LIKE "%e_format";
+SELECT variable_name, variable_value
+FROM information_schema.global_variables
+WHERE variable_name IN ('date_format', 'datetime_format', 'time_format')
+ORDER BY variable_name;
+
+SELECT variable_name, variable_value
+FROM information_schema.session_variables
+WHERE variable_name IN ('date_format', 'datetime_format', 'time_format')
+ORDER BY variable_name;
#
# Test setting a lot of different formats to see which formats are accepted and
@@ -36,8 +41,10 @@ set datetime_format= '%H:%i:%s.%f %m-%d-%Y';
set datetime_format= '%h:%i:%s %p %Y-%m-%d';
set datetime_format= '%h:%i:%s.%f %p %Y-%m-%d';
---replace_result ROW <format> STATEMENT <format> MIXED <format>
-SHOW SESSION VARIABLES LIKE "%e_format";
+SELECT variable_name, variable_value
+FROM information_schema.session_variables
+WHERE variable_name IN ('date_format', 'datetime_format', 'time_format')
+ORDER BY variable_name;
--error 1231
SET time_format='%h:%i:%s';
@@ -121,7 +128,7 @@ SET datetime_format=default;
# Test of str_to_date
#
-# PS doesn't support fraction of a seconds
+# PS doesn't support fractions of a second
--disable_ps_protocol
select str_to_date(concat('15-01-2001',' 2:59:58.999'),
concat('%d-%m-%Y',' ','%H:%i:%s.%f'));