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
99f18f0f
Commit
99f18f0f
authored
Jan 19, 2011
by
Martin Hansson
Browse files
Options
Browse Files
Download
Plain Diff
Merge of fix for Bug#59173.
parents
e869aa67
616e2227
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
1 deletion
+23
-1
mysql-test/r/type_datetime.result
mysql-test/r/type_datetime.result
+11
-0
mysql-test/t/type_datetime.test
mysql-test/t/type_datetime.test
+11
-0
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+1
-1
No files found.
mysql-test/r/type_datetime.result
View file @
99f18f0f
...
...
@@ -637,6 +637,17 @@ CAST(CAST('2008-07-29T10:42:51.1234567' AS DateTime) AS DECIMAL(30,7))
20080729104251.1234560
Warnings:
Warning 1292 Truncated incorrect datetime value: '2008-07-29T10:42:51.1234567'
#
# Bug#59173: Failure to handle DATE(TIME) values where Year, Month or
# Day is ZERO
#
CREATE TABLE t1 (dt1 DATETIME);
INSERT INTO t1 (dt1) VALUES ('0000-00-01 00:00:01');
DELETE FROM t1 WHERE dt1 = '0000-00-01 00:00:01';
# Should be empty
SELECT * FROM t1;
dt1
DROP TABLE t1;
End of 5.1 tests
#
# Start of 5.5 tests
...
...
mysql-test/t/type_datetime.test
View file @
99f18f0f
...
...
@@ -445,6 +445,17 @@ SELECT CAST(CAST('00000002006-000008-0000010 000010:0000011:00000012.012345' AS
# show we truncate microseconds from the right
SELECT
CAST
(
CAST
(
'2008-07-29T10:42:51.1234567'
AS
DateTime
)
AS
DECIMAL
(
30
,
7
));
--
echo
#
--
echo
# Bug#59173: Failure to handle DATE(TIME) values where Year, Month or
--
echo
# Day is ZERO
--
echo
#
CREATE
TABLE
t1
(
dt1
DATETIME
);
INSERT
INTO
t1
(
dt1
)
VALUES
(
'0000-00-01 00:00:01'
);
DELETE
FROM
t1
WHERE
dt1
=
'0000-00-01 00:00:01'
;
--
echo
# Should be empty
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
--
echo
End
of
5.1
tests
--
echo
#
...
...
sql/item_cmpfunc.cc
View file @
99f18f0f
...
...
@@ -918,7 +918,7 @@ int Arg_comparator::set_cmp_func(Item_result_field *owner_arg,
cache_converted_constant can't be used here because it can't
correctly convert a DATETIME value from string to int representation.
*/
Item_cache_int
*
cache
=
new
Item_cache_int
();
Item_cache_int
*
cache
=
new
Item_cache_int
(
MYSQL_TYPE_DATETIME
);
/* Mark the cache as non-const to prevent re-caching. */
cache
->
set_used_tables
(
1
);
if
(
!
(
*
a
)
->
is_datetime
())
...
...
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