Commit 88dd50b8 authored by Alexander Barkov's avatar Alexander Barkov

After-merge cleanup for MDEV-27207 + MDEV-31719

Something went wrong during a merge (from 10.5 to 10.6)
of 68403eed
(fixing bugs MDEV-27207 and MDEV-31719).

Originally (in 10.5) the fix was done in_inet6::set() in
plugin/type_inet/sql_type_inet.cc.
In 10.6 this code resides in a different place:
in the method in_fbt::set() of a template class
in sql/sql_type_fixedbin.h.

During the merge:
- the fix did not properly migrate to in_fbt::set()
- the related MTR tests disappeared

This patch fixes in_fbt::set() properly and restores MTR tests.
parent ca5c122a
......@@ -2257,3 +2257,29 @@ a m
::10 1
DROP VIEW v1;
DROP TABLE t1, t2;
#
# MDEV-27207 Assertion `!m_null_value' failed in int FixedBinTypeBundle<FbtImpl>::cmp_item_fbt::compare or in cmp_item_inet6::compare
#
CREATE TABLE t1 (a CHAR,b INET6);
SELECT * FROM t1 WHERE (a,b) IN (('',''),('',''));
a b
Warnings:
Warning 1292 Incorrect inet6 value: ''
Warning 1292 Incorrect inet6 value: ''
INSERT INTO t1 VALUES ('','::'),('','::');
SELECT * FROM t1 WHERE (a,b) IN (('',''),('',''));
a b
Warnings:
Warning 1292 Incorrect inet6 value: ''
Warning 1292 Incorrect inet6 value: ''
DROP TABLE t1;
#
# MDEV-31719 Wrong result of: WHERE inet6_column IN ('','::1')
#
CREATE OR REPLACE TABLE t1 (a INET6);
INSERT INTO t1 VALUES ('::');
SELECT * FROM t1 WHERE a IN ('','::1');
a
Warnings:
Warning 1292 Incorrect inet6 value: ''
DROP TABLE t1;
......@@ -1656,3 +1656,22 @@ SELECT * FROM v1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
DROP VIEW v1;
DROP TABLE t1, t2;
--echo #
--echo # MDEV-27207 Assertion `!m_null_value' failed in int FixedBinTypeBundle<FbtImpl>::cmp_item_fbt::compare or in cmp_item_inet6::compare
--echo #
CREATE TABLE t1 (a CHAR,b INET6);
SELECT * FROM t1 WHERE (a,b) IN (('',''),('',''));
INSERT INTO t1 VALUES ('','::'),('','::');
SELECT * FROM t1 WHERE (a,b) IN (('',''),('',''));
DROP TABLE t1;
--echo #
--echo # MDEV-31719 Wrong result of: WHERE inet6_column IN ('','::1')
--echo #
CREATE OR REPLACE TABLE t1 (a INET6);
INSERT INTO t1 VALUES ('::');
SELECT * FROM t1 WHERE a IN ('','::1');
DROP TABLE t1;
......@@ -776,10 +776,12 @@ class Type_handler_fbt: public Type_handler
Fbt *buff= &((Fbt *) base)[pos];
Fbt_null value(item);
if (value.is_null())
{
*buff= Fbt::zero();
else
return true;
}
*buff= value;
return FALSE;
return false;
}
uchar *get_value(Item *item) override
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment