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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
50ad9d1f
Commit
50ad9d1f
authored
Jan 13, 2009
by
Matthias Leich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge of fix for bug
41776 type_date.test may fail if run around midnight. into GCA tree.
parent
f557d377
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
13 deletions
+31
-13
mysql-test/r/type_date.result
mysql-test/r/type_date.result
+8
-5
mysql-test/t/type_date.test
mysql-test/t/type_date.test
+23
-8
No files found.
mysql-test/r/type_date.result
View file @
50ad9d1f
...
...
@@ -65,12 +65,15 @@ CREATE TABLE t1(AFIELD INT);
INSERT INTO t1 VALUES(1);
CREATE TABLE t2(GMT VARCHAR(32));
INSERT INTO t2 VALUES('GMT-0800');
SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) FROM t1, t2 GROUP BY t1.AFIELD;
DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT))
SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ', t2.GMT))
FROM t1, t2 GROUP BY t1.AFIELD;
DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ', t2.GMT))
Wed, 06 March 2002 10:11:12 GMT-0800
INSERT INTO t1 VALUES(1);
SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)), DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) FROM t1,t2 GROUP BY t1.AFIELD;
DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT))
SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ', t2.GMT)),
DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ', t2.GMT))
FROM t1,t2 GROUP BY t1.AFIELD;
DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ', t2.GMT)) DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ', t2.GMT))
Wed, 06 March 2002 10:11:12 GMT-0800 Wed, 06 March 2002 10:11:12 GMT-0800
drop table t1,t2;
CREATE TABLE t1 (f1 time default NULL, f2 time default NULL);
...
...
@@ -155,7 +158,7 @@ str_to_date( '', a )
0000-00-00 00:00:00
NULL
DROP TABLE t1;
CREATE TABLE t1 (a DATE, b
int
, PRIMARY KEY (a,b));
CREATE TABLE t1 (a DATE, b
INT
, PRIMARY KEY (a,b));
INSERT INTO t1 VALUES (DATE(NOW()), 1);
SELECT COUNT(*) FROM t1 WHERE a = NOW();
COUNT(*)
...
...
mysql-test/t/type_date.test
View file @
50ad9d1f
...
...
@@ -75,9 +75,12 @@ CREATE TABLE t1(AFIELD INT);
INSERT
INTO
t1
VALUES
(
1
);
CREATE
TABLE
t2
(
GMT
VARCHAR
(
32
));
INSERT
INTO
t2
VALUES
(
'GMT-0800'
);
SELECT
DATE_FORMAT
(
"2002-03-06 10:11:12"
,
CONCAT
(
'%a, %d %M %Y %H:%i:%s '
,
t2
.
GMT
))
FROM
t1
,
t2
GROUP
BY
t1
.
AFIELD
;
SELECT
DATE_FORMAT
(
"2002-03-06 10:11:12"
,
CONCAT
(
'%a, %d %M %Y %H:%i:%s '
,
t2
.
GMT
))
FROM
t1
,
t2
GROUP
BY
t1
.
AFIELD
;
INSERT
INTO
t1
VALUES
(
1
);
SELECT
DATE_FORMAT
(
"2002-03-06 10:11:12"
,
CONCAT
(
'%a, %d %M %Y %H:%i:%s '
,
t2
.
GMT
)),
DATE_FORMAT
(
"2002-03-06 10:11:12"
,
CONCAT
(
'%a, %d %M %Y %H:%i:%s '
,
t2
.
GMT
))
FROM
t1
,
t2
GROUP
BY
t1
.
AFIELD
;
SELECT
DATE_FORMAT
(
"2002-03-06 10:11:12"
,
CONCAT
(
'%a, %d %M %Y %H:%i:%s '
,
t2
.
GMT
)),
DATE_FORMAT
(
"2002-03-06 10:11:12"
,
CONCAT
(
'%a, %d %M %Y %H:%i:%s '
,
t2
.
GMT
))
FROM
t1
,
t2
GROUP
BY
t1
.
AFIELD
;
drop
table
t1
,
t2
;
#
...
...
@@ -90,7 +93,7 @@ SELECT DATE_FORMAT(f1, "%l.%i %p") , DATE_FORMAT(f2, "%l.%i %p") FROM t1;
DROP
TABLE
t1
;
#
# Bug
4937: different date -> string conversion when using SELECT ... UNION
# Bug
#
4937: different date -> string conversion when using SELECT ... UNION
# and INSERT ... SELECT ... UNION
#
...
...
@@ -141,7 +144,7 @@ select * from t1;
drop
table
t1
;
#
# Bug
#30942: select str_to_date from derived table returns varying results
# Bug#30942: select str_to_date from derived table returns varying results
#
CREATE
TABLE
t1
(
a
INT
...
...
@@ -155,10 +158,22 @@ DROP TABLE t1;
#
# Bug
#31221: Optimizer incorrectly identifies impossible WHERE clause
# Bug#31221: Optimizer incorrectly identifies impossible WHERE clause
#
CREATE
TABLE
t1
(
a
DATE
,
b
int
,
PRIMARY
KEY
(
a
,
b
));
CREATE
TABLE
t1
(
a
DATE
,
b
INT
,
PRIMARY
KEY
(
a
,
b
));
## The current sub test could fail (difference to expected result) if we
## have just reached midnight.
## (Bug#41776 type_date.test may fail if run around midnight)
## Therefore we sleep a bit if we are too close to midnight.
## The complete test itself needs in average less than 1 second.
## Therefore a time_distance to midnight of 5 seconds should be sufficient.
if
(
`SELECT CURTIME() > SEC_TO_TIME(24 * 3600 - 5)`
)
{
# We are here when CURTIME() is between '23:59:56' and '23:59:59'.
# So a sleep time of 5 seconds brings us between '00:00:01' and '00:00:04'.
--
real_sleep
5
}
INSERT
INTO
t1
VALUES
(
DATE
(
NOW
()),
1
);
SELECT
COUNT
(
*
)
FROM
t1
WHERE
a
=
NOW
();
EXPLAIN
SELECT
COUNT
(
*
)
FROM
t1
WHERE
a
=
NOW
();
...
...
@@ -174,7 +189,7 @@ EXPLAIN SELECT COUNT(*) FROM t1 WHERE a = NOW();
DROP
TABLE
t1
;
#
# Bug
#28687: Search fails on '0000-00-00' date after sql_mode change
# Bug#28687: Search fails on '0000-00-00' date after sql_mode change
#
CREATE
TABLE
t1
(
a
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