diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-12-21 11:54:53 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-12-21 12:12:57 +0200 |
commit | c5bb6024a78ac5cea6a4e4d7767946e7f01e880a (patch) | |
tree | 92099251b166e4fe63bc67f6b6d31b6e5624d4f7 /storage | |
parent | 0dafcf529c14b42e2e63d1634da79e0700be16a1 (diff) | |
download | mariadb-git-c5bb6024a78ac5cea6a4e4d7767946e7f01e880a.tar.gz |
MDEV-18039 Assertion failed in btr_node_ptr_max_size for VARCHAR(0)
btr_node_ptr_max_size(): Do not reserve extra space for indexed VARCHAR(0)
columns.
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/btr/btr0cur.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index 3f26803d14b..9cf42a93800 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -754,9 +754,20 @@ static ulint btr_node_ptr_max_size(const dict_index_t* index) field_max_size = dict_col_get_max_size(col); if (UNIV_UNLIKELY(!field_max_size)) { switch (col->mtype) { + case DATA_VARCHAR: + if (!comp + && (!strcmp(index->table->name.m_name, + "SYS_FOREIGN") + || !strcmp(index->table->name.m_name, + "SYS_FOREIGN_COLS"))) { + break; + } + /* fall through */ + case DATA_VARMYSQL: case DATA_CHAR: case DATA_MYSQL: - /* CHAR(0) is a possible data type. + /* 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 DATA_MYSQL) is only coming from the @@ -772,6 +783,7 @@ static ulint btr_node_ptr_max_size(const dict_index_t* index) } continue; } + /* SYS_FOREIGN.ID is defined as CHAR in the InnoDB internal SQL parser, which translates into the incorrect VARCHAR(0). InnoDB does @@ -788,6 +800,7 @@ static ulint btr_node_ptr_max_size(const dict_index_t* index) || !strcmp(index->table->name.m_name, "SYS_FOREIGN_COLS")); ut_ad(!comp); + ut_ad(col->mtype == DATA_VARCHAR); rec_max_size += (srv_page_size == UNIV_PAGE_SIZE_MAX) ? REDUNDANT_REC_MAX_DATA_SIZE |