Skip to content

Commit

Permalink
MDEV-19216 Assertion ...SYS_FOREIGN failed in btr_node_ptr_max_size
Browse files Browse the repository at this point in the history
btr_node_ptr_max_size(): Handle BINARY(0) and VARBINARY(0)
as special cases, similar to CHAR(0) and VARCHAR(0).
  • Loading branch information
dr-m committed Jul 3, 2023
1 parent 0105220 commit b808848
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
7 changes: 7 additions & 0 deletions mysql-test/suite/innodb/r/data_types.result
Expand Up @@ -174,3 +174,10 @@ DROP TABLE t1;
CREATE TABLE t1 (c VARCHAR(0), KEY(c)) ENGINE=InnoDB;
INSERT INTO t1 VALUES ('');
DROP TABLE t1;
#
# MDEV-19216 Assertion ...SYS_FOREIGN failed in btr_node_ptr_max_size
#
CREATE TABLE t1 (b BINARY(0), v VARBINARY(0), KEY(b), KEY(v)) ENGINE=InnoDB;
INSERT INTO t1 SET b='',v='';
DROP TABLE t1;
# End of 10.4 tests
10 changes: 10 additions & 0 deletions mysql-test/suite/innodb/t/data_types.test
Expand Up @@ -136,3 +136,13 @@ DROP TABLE t1;
CREATE TABLE t1 (c VARCHAR(0), KEY(c)) ENGINE=InnoDB;
INSERT INTO t1 VALUES ('');
DROP TABLE t1;

--echo #
--echo # MDEV-19216 Assertion ...SYS_FOREIGN failed in btr_node_ptr_max_size
--echo #

CREATE TABLE t1 (b BINARY(0), v VARBINARY(0), KEY(b), KEY(v)) ENGINE=InnoDB;
INSERT INTO t1 SET b='',v='';
DROP TABLE t1;

--echo # End of 10.4 tests
5 changes: 4 additions & 1 deletion storage/innobase/btr/btr0cur.cc
Expand Up @@ -1148,10 +1148,13 @@ static ulint btr_node_ptr_max_size(const dict_index_t* index)
break;
}
/* fall through */
case DATA_FIXBINARY:
case DATA_BINARY:
case DATA_VARMYSQL:
case DATA_CHAR:
case DATA_MYSQL:
/* CHAR(0) and VARCHAR(0) are possible
/* BINARY(0), VARBINARY(0),
CHAR(0) and VARCHAR(0) are possible
data type definitions in MariaDB.
The InnoDB internal SQL parser maps
CHAR to DATA_VARCHAR, so DATA_CHAR (or
Expand Down

0 comments on commit b808848

Please sign in to comment.