Description:
InnoDB memcached plugin results in error if the container table charset is multi byte.
How to repeat:
1. setup innodb memcached
2. change the charset of test.demo_test like below
mysql> alter table demo_test modify c1 varchar(32) character set utf8;
mysql> alter table demo_test modify c2 varchar(1024) character set utf8;
3. restart the server, and plugin fails to initialize with the following error message
Failed to initialize instance. Error code: 13
Suggested fix:
=== modified file 'plugin/innodb_memcached/innodb_memcache/src/innodb_config.c'
--- plugin/innodb_memcached/innodb_memcache/src/innodb_config.c 2012-10-04 09:17:53 +0000
+++ plugin/innodb_memcached/innodb_memcache/src/innodb_config.c 2012-10-04 09:21:50 +0000
@@ -895,7 +895,9 @@
if (strcmp(name, cinfo[CONTAINER_KEY].col_name) == 0) {
/* Key column must be CHAR or VARCHAR type */
if (col_meta.type != IB_VARCHAR
- && col_meta.type != IB_CHAR) {
+ && col_meta.type != IB_CHAR
+ && col_meta.type != IB_VARCHAR_ANYCHARSET
+ && col_meta.type != IB_CHAR_ANYCHARSET) {
err = DB_DATA_MISMATCH;
goto func_exit;
}
Description: InnoDB memcached plugin results in error if the container table charset is multi byte. How to repeat: 1. setup innodb memcached 2. change the charset of test.demo_test like below mysql> alter table demo_test modify c1 varchar(32) character set utf8; mysql> alter table demo_test modify c2 varchar(1024) character set utf8; 3. restart the server, and plugin fails to initialize with the following error message Failed to initialize instance. Error code: 13 Suggested fix: === modified file 'plugin/innodb_memcached/innodb_memcache/src/innodb_config.c' --- plugin/innodb_memcached/innodb_memcache/src/innodb_config.c 2012-10-04 09:17:53 +0000 +++ plugin/innodb_memcached/innodb_memcache/src/innodb_config.c 2012-10-04 09:21:50 +0000 @@ -895,7 +895,9 @@ if (strcmp(name, cinfo[CONTAINER_KEY].col_name) == 0) { /* Key column must be CHAR or VARCHAR type */ if (col_meta.type != IB_VARCHAR - && col_meta.type != IB_CHAR) { + && col_meta.type != IB_CHAR + && col_meta.type != IB_VARCHAR_ANYCHARSET + && col_meta.type != IB_CHAR_ANYCHARSET) { err = DB_DATA_MISMATCH; goto func_exit; }