1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

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.
This commit is contained in:
Timothy Smith
2009-01-13 23:29:11 +01:00
parent 50958a346a
commit 80e659a2ed
2 changed files with 38 additions and 22 deletions

View File

@ -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'));