mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-20417 Assertion `(m_ptr == __null) == item->null_value' failed in VDec::VDec(Item*)
This commit is contained in:
@ -1267,5 +1267,35 @@ f
|
|||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
SET sql_mode=DEFAULT;
|
SET sql_mode=DEFAULT;
|
||||||
#
|
#
|
||||||
|
# MDEV-20417 Assertion `(m_ptr == __null) == item->null_value' failed in VDec::VDec(Item*)
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (a TIMESTAMP(4), b TIMESTAMP DEFAULT 0) ENGINE=MyISAM;
|
||||||
|
INSERT IGNORE INTO t1 VALUES ('2001-01-01','2002-01-01'),('2003-01-01','2004-01-01');
|
||||||
|
SELECT * FROM t1 WHERE DEFAULT(b) - a;
|
||||||
|
a b
|
||||||
|
Warnings:
|
||||||
|
Warning 1916 Got overflow when converting '-20010101000000' to UNSIGNED INT. Value truncated
|
||||||
|
Warning 1916 Got overflow when converting '-20030101000000' to UNSIGNED INT. Value truncated
|
||||||
|
SELECT LEFT('', DEFAULT(b)-a) FROM t1;
|
||||||
|
LEFT('', DEFAULT(b)-a)
|
||||||
|
|
||||||
|
|
||||||
|
Warnings:
|
||||||
|
Warning 1916 Got overflow when converting '-20010101000000' to UNSIGNED INT. Value truncated
|
||||||
|
Warning 1916 Got overflow when converting '-20030101000000' to UNSIGNED INT. Value truncated
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (a TIMESTAMP(4), b TIMESTAMP DEFAULT 0) ENGINE=MyISAM;
|
||||||
|
INSERT IGNORE INTO t1 (a) VALUES ('2001-01-01'),('2003-01-01');
|
||||||
|
SELECT * FROM t1 WHERE (SELECT MIN(b) FROM t1) - a;
|
||||||
|
a b
|
||||||
|
Warnings:
|
||||||
|
Warning 1916 Got overflow when converting '-20010101000000' to UNSIGNED INT. Value truncated
|
||||||
|
Warning 1916 Got overflow when converting '-20030101000000' to UNSIGNED INT. Value truncated
|
||||||
|
SELECT (SELECT MIN(b) FROM t1) - a FROM t1;
|
||||||
|
(SELECT MIN(b) FROM t1) - a
|
||||||
|
-20010101000000.0000
|
||||||
|
-20030101000000.0000
|
||||||
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
# End of 10.4 tests
|
# End of 10.4 tests
|
||||||
#
|
#
|
||||||
|
@ -837,6 +837,24 @@ SELECT GREATEST(a,b) AS f FROM t1 ORDER BY 1 DESC;
|
|||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
SET sql_mode=DEFAULT;
|
SET sql_mode=DEFAULT;
|
||||||
|
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-20417 Assertion `(m_ptr == __null) == item->null_value' failed in VDec::VDec(Item*)
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (a TIMESTAMP(4), b TIMESTAMP DEFAULT 0) ENGINE=MyISAM;
|
||||||
|
INSERT IGNORE INTO t1 VALUES ('2001-01-01','2002-01-01'),('2003-01-01','2004-01-01');
|
||||||
|
SELECT * FROM t1 WHERE DEFAULT(b) - a;
|
||||||
|
SELECT LEFT('', DEFAULT(b)-a) FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (a TIMESTAMP(4), b TIMESTAMP DEFAULT 0) ENGINE=MyISAM;
|
||||||
|
INSERT IGNORE INTO t1 (a) VALUES ('2001-01-01'),('2003-01-01');
|
||||||
|
SELECT * FROM t1 WHERE (SELECT MIN(b) FROM t1) - a;
|
||||||
|
SELECT (SELECT MIN(b) FROM t1) - a FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # End of 10.4 tests
|
--echo # End of 10.4 tests
|
||||||
--echo #
|
--echo #
|
||||||
|
@ -2439,7 +2439,7 @@ public:
|
|||||||
Datetime to_datetime(THD *thd) const
|
Datetime to_datetime(THD *thd) const
|
||||||
{
|
{
|
||||||
if (is_zero_datetime())
|
if (is_zero_datetime())
|
||||||
return Datetime();
|
return Datetime::zero();
|
||||||
return Timestamp::to_datetime(thd);
|
return Timestamp::to_datetime(thd);
|
||||||
}
|
}
|
||||||
bool is_zero_datetime() const { return m_is_zero_datetime; }
|
bool is_zero_datetime() const { return m_is_zero_datetime; }
|
||||||
@ -2487,7 +2487,7 @@ public:
|
|||||||
Datetime to_datetime(THD *thd) const
|
Datetime to_datetime(THD *thd) const
|
||||||
{
|
{
|
||||||
return is_zero_datetime() ?
|
return is_zero_datetime() ?
|
||||||
Datetime() :
|
Datetime::zero() :
|
||||||
Datetime(thd, Timestamp(*this).tv());
|
Datetime(thd, Timestamp(*this).tv());
|
||||||
}
|
}
|
||||||
bool is_zero_datetime() const
|
bool is_zero_datetime() const
|
||||||
|
Reference in New Issue
Block a user