Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
abfd0285
Commit
abfd0285
authored
Nov 22, 2006
by
ramil/ram@myoffice.izhnet.ru
Browse files
Options
Browse Files
Download
Plain Diff
Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into mysql.com:/usr/home/ram/work/bug21789/my51-bug21789
parents
38c04fb5
d40abd87
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
19 deletions
+42
-19
mysql-test/r/date_formats.result
mysql-test/r/date_formats.result
+39
-18
sql-common/my_time.c
sql-common/my_time.c
+3
-1
No files found.
mysql-test/r/date_formats.result
View file @
abfd0285
...
@@ -189,12 +189,12 @@ date format datetime
...
@@ -189,12 +189,12 @@ date format datetime
2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 2003-01-02 02:11:12.123450
2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 2003-01-02 02:11:12.123450
2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 00:11:12.123450
2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 00:11:12.123450
2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 2003-01-02 23:11:12
2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 2003-01-02 23:11:12
10:20:10 %H:%i:%s 0000-00-00
10:20:1
0
10:20:10 %H:%i:%s 0000-00-00
00:00:0
0
10:20:10 %h:%i:%s.%f 0000-00-00
10:20:1
0
10:20:10 %h:%i:%s.%f 0000-00-00
00:00:0
0
10:20:10 %T 0000-00-00
10:20:1
0
10:20:10 %T 0000-00-00
00:00:0
0
10:20:10AM %h:%i:%s%p 0000-00-00
10:20:1
0
10:20:10AM %h:%i:%s%p 0000-00-00
00:00:0
0
10:20:10AM %r 0000-00-00
10:20:1
0
10:20:10AM %r 0000-00-00
00:00:0
0
10:20:10.44AM %h:%i:%s.%f%p 0000-00-00
10:20:10.4400
00
10:20:10.44AM %h:%i:%s.%f%p 0000-00-00
00:00:
00
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 2001-01-15 12:59:58
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 2001-01-15 12:59:58
15 September 2001 %d %M %Y 2001-09-15 00:00:00
15 September 2001 %d %M %Y 2001-09-15 00:00:00
15 SEPTEMB 2001 %d %M %Y 2001-09-15 00:00:00
15 SEPTEMB 2001 %d %M %Y 2001-09-15 00:00:00
...
@@ -211,6 +211,13 @@ Tuesday 52 2001 %W %V %X 2002-01-01 00:00:00
...
@@ -211,6 +211,13 @@ Tuesday 52 2001 %W %V %X 2002-01-01 00:00:00
15-01-2001 %d-%m-%Y %H:%i:%S 2001-01-15 00:00:00
15-01-2001 %d-%m-%Y %H:%i:%S 2001-01-15 00:00:00
15-01-20 %d-%m-%y 2020-01-15 00:00:00
15-01-20 %d-%m-%y 2020-01-15 00:00:00
15-2001-1 %d-%Y-%c 2001-01-15 00:00:00
15-2001-1 %d-%Y-%c 2001-01-15 00:00:00
Warnings:
Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect datetime value: '0000-00-00 10:20:10.440000'
select date,format,DATE(str_to_date(date, format)) as date2 from t1;
select date,format,DATE(str_to_date(date, format)) as date2 from t1;
date format date2
date format date2
2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 2003-01-02
2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 2003-01-02
...
@@ -251,12 +258,12 @@ date format time
...
@@ -251,12 +258,12 @@ date format time
2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 02:11:12.123450
2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 02:11:12.123450
2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 00:11:12.123450
2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 00:11:12.123450
2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 23:11:12
2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 23:11:12
10:20:10 %H:%i:%s
10:20:10
10:20:10 %H:%i:%s
NULL
10:20:10 %h:%i:%s.%f
10:20:10
10:20:10 %h:%i:%s.%f
NULL
10:20:10 %T
10:20:10
10:20:10 %T
NULL
10:20:10AM %h:%i:%s%p
10:20:10
10:20:10AM %h:%i:%s%p
NULL
10:20:10AM %r
10:20:10
10:20:10AM %r
NULL
10:20:10.44AM %h:%i:%s.%f%p
10:20:10.440000
10:20:10.44AM %h:%i:%s.%f%p
NULL
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 12:59:58
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 12:59:58
15 September 2001 %d %M %Y 00:00:00
15 September 2001 %d %M %Y 00:00:00
15 SEPTEMB 2001 %d %M %Y 00:00:00
15 SEPTEMB 2001 %d %M %Y 00:00:00
...
@@ -273,6 +280,13 @@ Tuesday 52 2001 %W %V %X 00:00:00
...
@@ -273,6 +280,13 @@ Tuesday 52 2001 %W %V %X 00:00:00
15-01-2001 %d-%m-%Y %H:%i:%S 00:00:00
15-01-2001 %d-%m-%Y %H:%i:%S 00:00:00
15-01-20 %d-%m-%y 00:00:00
15-01-20 %d-%m-%y 00:00:00
15-2001-1 %d-%Y-%c 00:00:00
15-2001-1 %d-%Y-%c 00:00:00
Warnings:
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10.440000'
select date,format,concat(TIME(str_to_date(date, format))) as time2 from t1;
select date,format,concat(TIME(str_to_date(date, format))) as time2 from t1;
date format time2
date format time2
2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 10:11:12
2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 10:11:12
...
@@ -282,12 +296,12 @@ date format time2
...
@@ -282,12 +296,12 @@ date format time2
2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 02:11:12.123450
2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 02:11:12.123450
2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 00:11:12.123450
2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 00:11:12.123450
2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 23:11:12
2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 23:11:12
10:20:10 %H:%i:%s
10:20:10
10:20:10 %H:%i:%s
NULL
10:20:10 %h:%i:%s.%f
10:20:10
10:20:10 %h:%i:%s.%f
NULL
10:20:10 %T
10:20:10
10:20:10 %T
NULL
10:20:10AM %h:%i:%s%p
10:20:10
10:20:10AM %h:%i:%s%p
NULL
10:20:10AM %r
10:20:10
10:20:10AM %r
NULL
10:20:10.44AM %h:%i:%s.%f%p
10:20:10.440000
10:20:10.44AM %h:%i:%s.%f%p
NULL
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 12:59:58
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 12:59:58
15 September 2001 %d %M %Y 00:00:00
15 September 2001 %d %M %Y 00:00:00
15 SEPTEMB 2001 %d %M %Y 00:00:00
15 SEPTEMB 2001 %d %M %Y 00:00:00
...
@@ -304,6 +318,13 @@ Tuesday 52 2001 %W %V %X 00:00:00
...
@@ -304,6 +318,13 @@ Tuesday 52 2001 %W %V %X 00:00:00
15-01-2001 %d-%m-%Y %H:%i:%S 00:00:00
15-01-2001 %d-%m-%Y %H:%i:%S 00:00:00
15-01-20 %d-%m-%y 00:00:00
15-01-20 %d-%m-%y 00:00:00
15-2001-1 %d-%Y-%c 00:00:00
15-2001-1 %d-%Y-%c 00:00:00
Warnings:
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10.440000'
select concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d'));
select concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d'));
concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d'))
concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d'))
2003-01-02 08:11:02.123456
2003-01-02 08:11:02.123456
...
...
sql-common/my_time.c
View file @
abfd0285
...
@@ -411,7 +411,9 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time,
...
@@ -411,7 +411,9 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time,
if
(
number_of_fields
<
3
||
if
(
number_of_fields
<
3
||
l_time
->
year
>
9999
||
l_time
->
month
>
12
||
l_time
->
year
>
9999
||
l_time
->
month
>
12
||
l_time
->
day
>
31
||
l_time
->
hour
>
23
||
l_time
->
day
>
31
||
l_time
->
hour
>
23
||
l_time
->
minute
>
59
||
l_time
->
second
>
59
)
l_time
->
minute
>
59
||
l_time
->
second
>
59
||
(
l_time
->
year
==
0
&&
l_time
->
month
==
0
&&
l_time
->
day
==
0
&&
(
l_time
->
hour
!=
0
||
l_time
->
minute
!=
0
||
l_time
->
second
!=
0
)))
{
{
/* Only give warning for a zero date if there is some garbage after */
/* Only give warning for a zero date if there is some garbage after */
if
(
!
not_zero_date
)
/* If zero date */
if
(
!
not_zero_date
)
/* If zero date */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment