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
8d93a0f7
Commit
8d93a0f7
authored
Jan 12, 2011
by
Evgeny Potemkin
Browse files
Options
Browse Files
Download
Plain Diff
Auto-merged.
parents
04257387
ce692c66
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
2 deletions
+48
-2
mysql-test/r/type_timestamp.result
mysql-test/r/type_timestamp.result
+29
-0
mysql-test/t/type_timestamp.test
mysql-test/t/type_timestamp.test
+18
-0
sql/item.cc
sql/item.cc
+1
-2
No files found.
mysql-test/r/type_timestamp.result
View file @
8d93a0f7
...
@@ -540,3 +540,32 @@ a
...
@@ -540,3 +540,32 @@ a
2010-03-05 11:08:02
2010-03-05 11:08:02
DROP TABLE t1;
DROP TABLE t1;
End of Bug#50888
End of Bug#50888
#
# Bug59330: Incorrect result when comparing an aggregate
# function with TIMESTAMP
#
CREATE TABLE t1 (dt DATETIME, ts TIMESTAMP);
INSERT INTO t1 VALUES('2011-01-06 12:34:30', '2011-01-06 12:34:30');
SELECT MAX(dt), MAX(ts) FROM t1;
MAX(dt) MAX(ts)
2011-01-06 12:34:30 2011-01-06 12:34:30
SELECT MAX(ts) < '2010-01-01 00:00:00' FROM t1;
MAX(ts) < '2010-01-01 00:00:00'
0
SELECT MAX(dt) < '2010-01-01 00:00:00' FROM t1;
MAX(dt) < '2010-01-01 00:00:00'
0
SELECT MAX(ts) > '2010-01-01 00:00:00' FROM t1;
MAX(ts) > '2010-01-01 00:00:00'
1
SELECT MAX(dt) > '2010-01-01 00:00:00' FROM t1;
MAX(dt) > '2010-01-01 00:00:00'
1
SELECT MAX(ts) = '2011-01-06 12:34:30' FROM t1;
MAX(ts) = '2011-01-06 12:34:30'
1
SELECT MAX(dt) = '2011-01-06 12:34:30' FROM t1;
MAX(dt) = '2011-01-06 12:34:30'
1
DROP TABLE t1;
End of 5.5 tests
mysql-test/t/type_timestamp.test
View file @
8d93a0f7
...
@@ -377,3 +377,21 @@ SELECT a FROM t1;
...
@@ -377,3 +377,21 @@ SELECT a FROM t1;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
--
echo
End
of
Bug
#50888
--
echo
End
of
Bug
#50888
--
echo
#
--
echo
# Bug59330: Incorrect result when comparing an aggregate
--
echo
# function with TIMESTAMP
--
echo
#
CREATE
TABLE
t1
(
dt
DATETIME
,
ts
TIMESTAMP
);
INSERT
INTO
t1
VALUES
(
'2011-01-06 12:34:30'
,
'2011-01-06 12:34:30'
);
SELECT
MAX
(
dt
),
MAX
(
ts
)
FROM
t1
;
SELECT
MAX
(
ts
)
<
'2010-01-01 00:00:00'
FROM
t1
;
SELECT
MAX
(
dt
)
<
'2010-01-01 00:00:00'
FROM
t1
;
SELECT
MAX
(
ts
)
>
'2010-01-01 00:00:00'
FROM
t1
;
SELECT
MAX
(
dt
)
>
'2010-01-01 00:00:00'
FROM
t1
;
SELECT
MAX
(
ts
)
=
'2011-01-06 12:34:30'
FROM
t1
;
SELECT
MAX
(
dt
)
=
'2011-01-06 12:34:30'
FROM
t1
;
DROP
TABLE
t1
;
--
echo
End
of
5.5
tests
sql/item.cc
View file @
8d93a0f7
...
@@ -7370,8 +7370,7 @@ Item_cache* Item_cache::get_cache(const Item *item, const Item_result type)
...
@@ -7370,8 +7370,7 @@ Item_cache* Item_cache::get_cache(const Item *item, const Item_result type)
return
new
Item_cache_decimal
();
return
new
Item_cache_decimal
();
case
STRING_RESULT
:
case
STRING_RESULT
:
/* Not all functions that return DATE/TIME are actually DATE/TIME funcs. */
/* Not all functions that return DATE/TIME are actually DATE/TIME funcs. */
if
((
item
->
field_type
()
==
MYSQL_TYPE_DATE
||
if
((
item
->
is_datetime
()
||
item
->
field_type
()
==
MYSQL_TYPE_DATETIME
||
item
->
field_type
()
==
MYSQL_TYPE_TIME
)
&&
item
->
field_type
()
==
MYSQL_TYPE_TIME
)
&&
(
const_cast
<
Item
*>
(
item
))
->
result_as_longlong
())
(
const_cast
<
Item
*>
(
item
))
->
result_as_longlong
())
return
new
Item_cache_datetime
(
item
->
field_type
());
return
new
Item_cache_datetime
(
item
->
field_type
());
...
...
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