summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@oracle.com>2012-10-22 22:10:33 +0300
committerMarko Mäkelä <marko.makela@oracle.com>2012-10-22 22:10:33 +0300
commitd13554b1f90f7bef1d31ef66dc90eb6738a9f90f (patch)
tree0cf2434e74e16fce838b47a3b2177115312fc3af /storage
parent62503f9cf5af989107e887925816add9b4aec950 (diff)
downloadmariadb-git-d13554b1f90f7bef1d31ef66dc90eb6738a9f90f.tar.gz
Backport from 5.6: Bug#14769820 ASSERT FLEN == LEN
IN ALTER TABLE ... ADD UNIQUE KEY A bogus debug assertion failure occurred when reporting a duplicate key on a column prefix of a CHAR column. This is a regression from Bug#14729221 IN-PLACE ALTER TABLE REPORTS '' INSTEAD OF REAL DUPLICATE VALUE FOR PREFIX KEYS. The assertion is only present when UNIV_DEBUG is defined (which it is in debug builds starting from MySQL 5.5). It is a case of overasserting. Fix approved by Inaam Rana on IM.
Diffstat (limited to 'storage')
-rw-r--r--storage/innodb_plugin/handler/handler0alter.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/storage/innodb_plugin/handler/handler0alter.cc b/storage/innodb_plugin/handler/handler0alter.cc
index 7095077b788..0422abb0021 100644
--- a/storage/innodb_plugin/handler/handler0alter.cc
+++ b/storage/innodb_plugin/handler/handler0alter.cc
@@ -108,13 +108,17 @@ innobase_col_to_mysql(
/* These column types should never be shipped to MySQL. */
ut_ad(0);
- case DATA_CHAR:
case DATA_FIXBINARY:
case DATA_FLOAT:
case DATA_DOUBLE:
case DATA_DECIMAL:
/* Above are the valid column types for MySQL data. */
ut_ad(flen == len);
+ /* fall through */
+ case DATA_CHAR:
+ /* We may have flen > len when there is a shorter
+ prefix on a CHAR column. */
+ ut_ad(flen >= len);
#else /* UNIV_DEBUG */
default:
#endif /* UNIV_DEBUG */