Skip to content

Commit

Permalink
MDEV-26742 Assertion `field->type_handler() == this' failed in FixedB…
Browse files Browse the repository at this point in the history
…inTypeBundle<NATIVE_LEN, MAX_CHAR_LEN>::Type_handler_fbt::stored_field_cmp_to_item

The bug was fixed in 10.5 using INET6 specific tests.

This bugs adds only UUID specific tests (no code changes).
  • Loading branch information
abarkov authored and vuvova committed Oct 29, 2021
1 parent b9f19f7 commit 4300f50
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 4 deletions.
24 changes: 22 additions & 2 deletions plugin/type_uuid/mysql-test/type_uuid/type_uuid_innodb.result
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Start of 10.5 tests
# Start of 10.7 tests
#
#
# MDEV-4958 Adding datatype UUID
Expand Down Expand Up @@ -179,5 +179,25 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref a a 17 const 1 Using where; Using index
DROP TABLE t1;
#
# End of 10.5 tests
# MDEV-26742 Assertion `field->type_handler() == this' failed in FixedBinTypeBundle<NATIVE_LEN, MAX_CHAR_LEN>::Type_handler_fbt::stored_field_cmp_to_item
#
CREATE TABLE t1 ( pk uuid, c text) engine=myisam;
INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000000',1);
CREATE TABLE t2 ( d text, KEY (d)) engine=innodb ;
Warnings:
Note 1071 Specified key was too long; max key length is 3072 bytes
INSERT INTO t2 VALUES (2);
SELECT * FROM t2 JOIN t1 ON ( t1.pk > t2.d);
d pk c
Warnings:
Warning 1292 Incorrect uuid value: '2'
EXPLAIN SELECT * FROM t2 JOIN t1 ON ( t1.pk > t2.d);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1
1 SIMPLE t2 ALL d NULL NULL NULL 1 Using where
UPDATE t2 JOIN t1 ON ( t1.pk > t2.d) SET t1.c = 1;
ERROR 22007: Incorrect uuid value: '2'
DROP TABLE t1, t2;
#
# End of 10.7 tests
#
19 changes: 17 additions & 2 deletions plugin/type_uuid/mysql-test/type_uuid/type_uuid_innodb.test
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--source include/have_innodb.inc

--echo #
--echo # Start of 10.5 tests
--echo # Start of 10.7 tests
--echo #

--echo #
Expand All @@ -12,5 +12,20 @@ SET default_storage_engine=InnoDB;
--source type_uuid_engines.inc

--echo #
--echo # End of 10.5 tests
--echo # MDEV-26742 Assertion `field->type_handler() == this' failed in FixedBinTypeBundle<NATIVE_LEN, MAX_CHAR_LEN>::Type_handler_fbt::stored_field_cmp_to_item
--echo #

CREATE TABLE t1 ( pk uuid, c text) engine=myisam;
INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000000',1);
CREATE TABLE t2 ( d text, KEY (d)) engine=innodb ;
INSERT INTO t2 VALUES (2);
SELECT * FROM t2 JOIN t1 ON ( t1.pk > t2.d);
EXPLAIN SELECT * FROM t2 JOIN t1 ON ( t1.pk > t2.d);
--error ER_TRUNCATED_WRONG_VALUE
UPDATE t2 JOIN t1 ON ( t1.pk > t2.d) SET t1.c = 1;
DROP TABLE t1, t2;


--echo #
--echo # End of 10.7 tests
--echo #

0 comments on commit 4300f50

Please sign in to comment.