mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-29924 Assertion `(((nr) % (1LL << 24)) % (int) log_10_int[6 - dec]) == 0' failed in my_time_packed_to_binary on SELECT when using TIME field
when assigning the cached item to the Item_cache for the first time make sure to use Item_cache::setup(), not Item_cache::store(). Because the former copies the metadata (and allocates memory, in case of Item_cache_row), and Item_cache::decimal must be set for comparisons to work correctly.
This commit is contained in:
@ -360,7 +360,7 @@ select cast(1e-6 as time(6));
|
|||||||
cast(1e-6 as time(6))
|
cast(1e-6 as time(6))
|
||||||
00:00:00.000001
|
00:00:00.000001
|
||||||
#
|
#
|
||||||
# Start of 10.4 tests
|
# End of 5.5 tests
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# MDEV-20397 Support TIMESTAMP, DATETIME, TIME in ROUND() and TRUNCATE()
|
# MDEV-20397 Support TIMESTAMP, DATETIME, TIME in ROUND() and TRUNCATE()
|
||||||
@ -907,3 +907,14 @@ a CEILING(a) CEILING_SP(a) CEILING(a)=CEILING_SP(a)
|
|||||||
DROP FUNCTION FLOOR_SP;
|
DROP FUNCTION FLOOR_SP;
|
||||||
DROP FUNCTION CEILING_SP;
|
DROP FUNCTION CEILING_SP;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# MDEV-29924 Assertion `(((nr) % (1LL << 24)) % (int) log_10_int[6 - dec]) == 0' failed in my_time_packed_to_binary on SELECT when using TIME field
|
||||||
|
#
|
||||||
|
create table t1 (c decimal(3,1),d time(6));
|
||||||
|
insert into t1 values (null,0.1),(null,0.1), (0.1,0.2);
|
||||||
|
select c from t1 where c<all (select d from t1);
|
||||||
|
c
|
||||||
|
drop table t1;
|
||||||
|
#
|
||||||
|
# End of 10.4 tests
|
||||||
|
#
|
||||||
|
@ -11,9 +11,8 @@ drop table t1;
|
|||||||
|
|
||||||
select cast(1e-6 as time(6));
|
select cast(1e-6 as time(6));
|
||||||
|
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # Start of 10.4 tests
|
--echo # End of 5.5 tests
|
||||||
--echo #
|
--echo #
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
@ -196,3 +195,15 @@ DROP FUNCTION FLOOR_SP;
|
|||||||
DROP FUNCTION CEILING_SP;
|
DROP FUNCTION CEILING_SP;
|
||||||
|
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-29924 Assertion `(((nr) % (1LL << 24)) % (int) log_10_int[6 - dec]) == 0' failed in my_time_packed_to_binary on SELECT when using TIME field
|
||||||
|
--echo #
|
||||||
|
create table t1 (c decimal(3,1),d time(6));
|
||||||
|
insert into t1 values (null,0.1),(null,0.1), (0.1,0.2);
|
||||||
|
select c from t1 where c<all (select d from t1);
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # End of 10.4 tests
|
||||||
|
--echo #
|
||||||
|
@ -3753,8 +3753,10 @@ int select_max_min_finder_subselect::send_data(List<Item> &items)
|
|||||||
{
|
{
|
||||||
cache= val_item->get_cache(thd);
|
cache= val_item->get_cache(thd);
|
||||||
set_op(val_item->type_handler());
|
set_op(val_item->type_handler());
|
||||||
|
cache->setup(thd, val_item);
|
||||||
}
|
}
|
||||||
cache->store(val_item);
|
else
|
||||||
|
cache->store(val_item);
|
||||||
it->store(0, cache);
|
it->store(0, cache);
|
||||||
}
|
}
|
||||||
it->assigned(1);
|
it->assigned(1);
|
||||||
|
Reference in New Issue
Block a user