diff options
author | Marko Mäkelä <marko.makela@oracle.com> | 2013-08-16 15:45:41 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@oracle.com> | 2013-08-16 15:45:41 +0300 |
commit | fb2a2d25625f54eab60ff902ab667efbd7891ee5 (patch) | |
tree | ceed33fc3ba5e0bf18eef1b4a91fa8abd0d1af38 /storage/innobase/row | |
parent | 318096074e2e195d7c97d6e08360c3966b49daea (diff) | |
download | mariadb-git-fb2a2d25625f54eab60ff902ab667efbd7891ee5.tar.gz |
Bug#17312846 CHECK TABLE ASSERTION FAILURE
DICT_TABLE_GET_FORMAT(CLUST_INDEX->TABLE) >= 1
The function row_sel_sec_rec_is_for_clust_rec() was incorrectly
preparing to compare a NULL column prefix in a secondary index with a
non-NULL column in a clustered index.
This can trigger an assertion failure in 5.1 plugin and later. In the
built-in InnoDB of MySQL 5.1 and earlier, we would apparently only do
some extra work, by trimming the clustered index field for the
comparison.
The code might actually have worked properly apart from this debug
assertion failure. It is merely doing some extra work in fetching a
BLOB column, and then comparing it to NULL (which would return the
same result, no matter what the BLOB contents is).
While the test case involves CHECK TABLE, this could theoretically
occur during any read that uses a secondary index on a column prefix
of a column that can be NULL.
rb#3101 approved by Mattias Jonsson
Diffstat (limited to 'storage/innobase/row')
-rw-r--r-- | storage/innobase/row/row0sel.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c index 2137facf638..1a3f4d4a189 100644 --- a/storage/innobase/row/row0sel.c +++ b/storage/innobase/row/row0sel.c @@ -107,7 +107,8 @@ row_sel_sec_rec_is_for_clust_rec( dict_col_get_clust_pos(col, clust_index), &clust_len); sec_field = rec_get_nth_field(sec_rec, sec_offs, i, &sec_len); - if (ifield->prefix_len > 0 && clust_len != UNIV_SQL_NULL) { + if (ifield->prefix_len > 0 && clust_len != UNIV_SQL_NULL + && sec_len != UNIV_SQL_NULL) { clust_len = dtype_get_at_most_n_mbchars( col->prtype, col->mbminlen, col->mbmaxlen, |