mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 20:12:31 +01:00
MDEV-14221 Assertion `0' failed in Item::field_type_for_temporal_comparison
This commit is contained in:
parent
892cf2de13
commit
d8a9b524f2
3 changed files with 31 additions and 0 deletions
|
@ -843,5 +843,16 @@ Warning 1292 Incorrect datetime value: '1'
|
|||
Warning 1292 Incorrect datetime value: '1'
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-14221 Assertion `0' failed in Item::field_type_for_temporal_comparison
|
||||
#
|
||||
CREATE TABLE t1 (d DATE);
|
||||
INSERT INTO t1 VALUES ('1985-05-13'),('1989-12-24');
|
||||
SELECT d, COUNT(*) FROM t1 GROUP BY d WITH ROLLUP HAVING CASE d WHEN '2017-05-25' THEN 0 ELSE 1 END;
|
||||
d COUNT(*)
|
||||
1985-05-13 1
|
||||
1989-12-24 1
|
||||
NULL 2
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 10.1 tests
|
||||
#
|
||||
|
|
|
@ -576,6 +576,15 @@ SELECT DATE(a), DATE(b), DATE(c) FROM t1;
|
|||
SELECT DATE(COALESCE(a)), DATE(COALESCE(b)), DATE(COALESCE(c)) FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-14221 Assertion `0' failed in Item::field_type_for_temporal_comparison
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (d DATE);
|
||||
INSERT INTO t1 VALUES ('1985-05-13'),('1989-12-24');
|
||||
SELECT d, COUNT(*) FROM t1 GROUP BY d WITH ROLLUP HAVING CASE d WHEN '2017-05-25' THEN 0 ELSE 1 END;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.1 tests
|
||||
|
|
11
sql/item.h
11
sql/item.h
|
@ -2581,6 +2581,17 @@ public:
|
|||
Field *result_field;
|
||||
Item_null_result(THD *thd): Item_null(thd), result_field(0) {}
|
||||
bool is_result_field() { return result_field != 0; }
|
||||
#if MARIADB_VERSION_ID < 100300
|
||||
enum_field_types field_type() const
|
||||
{
|
||||
return result_field->type();
|
||||
}
|
||||
#else
|
||||
const Type_handler *type_handler() const
|
||||
{
|
||||
return result_field->type_handler();
|
||||
}
|
||||
#endif
|
||||
void save_in_result_field(bool no_conversions)
|
||||
{
|
||||
save_in_field(result_field, no_conversions);
|
||||
|
|
Loading…
Reference in a new issue