mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fix for bug #31349: ERROR 1062 (23000): Duplicate entry '' for key 'group_key'
Problem: lying to the optimizer that a function (Item_func_inet_ntoa) cannot return NULL values leads to unexpected results (in the case group keys creation/comparison is broken). Fix: Item_func_inet_ntoa::maybe_null should be set properly. mysql-test/r/func_misc.result: Fix for bug #31349: ERROR 1062 (23000): Duplicate entry '' for key 'group_key' - test result. mysql-test/t/func_misc.test: Fix for bug #31349: ERROR 1062 (23000): Duplicate entry '' for key 'group_key' - test case. sql/item_strfunc.h: Fix for bug #31349: ERROR 1062 (23000): Duplicate entry '' for key 'group_key' - set Item_func_inet_ntoa::maybe_null flag.
This commit is contained in:
@ -189,4 +189,12 @@ drop table table_26093;
|
||||
drop function func_26093_a;
|
||||
drop function func_26093_b;
|
||||
|
||||
#
|
||||
# Bug #31349: ERROR 1062 (23000): Duplicate entry '' for key 'group_key'
|
||||
#
|
||||
create table t1 (a int not null);
|
||||
insert into t1 values (-1), (-2);
|
||||
select min(a) from t1 group by inet_ntoa(a);
|
||||
drop table t1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
Reference in New Issue
Block a user