mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 04:22:27 +01:00
Merge of fix for Bug#59173.
This commit is contained in:
commit
4073411145
3 changed files with 23 additions and 1 deletions
|
@ -637,6 +637,17 @@ CAST(CAST('2008-07-29T10:42:51.1234567' AS DateTime) AS DECIMAL(30,7))
|
||||||
20080729104251.1234560
|
20080729104251.1234560
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1292 Truncated incorrect datetime value: '2008-07-29T10:42:51.1234567'
|
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
|
End of 5.1 tests
|
||||||
#
|
#
|
||||||
# Start of 5.5 tests
|
# Start of 5.5 tests
|
||||||
|
|
|
@ -445,6 +445,17 @@ SELECT CAST(CAST('00000002006-000008-0000010 000010:0000011:00000012.012345' AS
|
||||||
# show we truncate microseconds from the right
|
# show we truncate microseconds from the right
|
||||||
SELECT CAST(CAST('2008-07-29T10:42:51.1234567' AS DateTime) AS DECIMAL(30,7));
|
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 End of 5.1 tests
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
|
|
|
@ -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
|
cache_converted_constant can't be used here because it can't
|
||||||
correctly convert a DATETIME value from string to int representation.
|
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. */
|
/* Mark the cache as non-const to prevent re-caching. */
|
||||||
cache->set_used_tables(1);
|
cache->set_used_tables(1);
|
||||||
if (!(*a)->is_datetime())
|
if (!(*a)->is_datetime())
|
||||||
|
|
Loading…
Reference in a new issue