mirror of
https://github.com/MariaDB/server.git
synced 2026-05-04 14:15:33 +02:00
Fix for bug #22029: str_to_date returning NULL, while date_format works using identical format.
The problem appears when we have a space followed by a non-format symbol. Fix: properly skip spaces. mysql-test/r/date_formats.result: Fix for bug #22029: str_to_date returning NULL, while date_format works using identical format. - test result. mysql-test/t/date_formats.test: Fix for bug #22029: str_to_date returning NULL, while date_format works using identical format. - test case. sql/item_timefunc.cc: Fix for bug #22029: str_to_date returning NULL, while date_format works using identical format. - skipping pre-spaces between each argument moved.
This commit is contained in:
parent
78f47b1b10
commit
89a4a3e92c
3 changed files with 21 additions and 4 deletions
|
|
@ -530,4 +530,13 @@ DATE_FORMAT('%Y-%m-%d %H:%i:%s', 1151414896)
|
|||
NULL
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect datetime value: '%Y-%m-%d %H:%i:%s'
|
||||
select str_to_date('04 /30/2004', '%m /%d/%Y');
|
||||
str_to_date('04 /30/2004', '%m /%d/%Y')
|
||||
2004-04-30
|
||||
select str_to_date('04/30 /2004', '%m /%d /%Y');
|
||||
str_to_date('04/30 /2004', '%m /%d /%Y')
|
||||
2004-04-30
|
||||
select str_to_date('04/30/2004 ', '%m/%d/%Y ');
|
||||
str_to_date('04/30/2004 ', '%m/%d/%Y ')
|
||||
2004-04-30
|
||||
"End of 4.1 tests"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue