Loading client/mysql.cc +2 −2 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ #include <locale.h> #endif const char *VER= "14.9"; const char *VER= "14.10"; /* Don't try to make a nice table if the data is too big */ #define MAX_COLUMN_LENGTH 1024 Loading Loading @@ -235,7 +235,7 @@ static COMMANDS commands[] = { { "connect",'r', com_connect,1, "Reconnect to the server. Optional arguments are db and host." }, { "delimiter", 'd', com_delimiter, 1, "Set query delimiter. " }, "Set statement delimiter. NOTE: Takes the rest of the line as new delimiter." }, #ifdef USE_POPEN { "edit", 'e', com_edit, 0, "Edit command with $EDITOR."}, #endif Loading heap/hp_hash.c +11 −0 Original line number Diff line number Diff line Loading @@ -255,6 +255,9 @@ ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key) if (*pos) /* Found null */ { nr^= (nr << 1) | 1; /* Add key pack length (2) to key for VARCHAR segments */ if (seg->type == HA_KEYTYPE_VARTEXT1) key+= 2; continue; } pos++; Loading Loading @@ -390,6 +393,9 @@ ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key) if (*pos) { nr^= (nr << 1) | 1; /* Add key pack length (2) to key for VARCHAR segments */ if (seg->type == HA_KEYTYPE_VARTEXT1) key+= 2; continue; } pos++; Loading Loading @@ -584,8 +590,13 @@ int hp_key_cmp(HP_KEYDEF *keydef, const byte *rec, const byte *key) if (found_null != (int) *key++) return 1; if (found_null) { /* Add key pack length (2) to key for VARCHAR segments */ if (seg->type == HA_KEYTYPE_VARTEXT1) key+= 2; continue; } } if (seg->type == HA_KEYTYPE_TEXT) { CHARSET_INFO *cs= seg->charset; Loading myisam/mi_key.c +3 −0 Original line number Diff line number Diff line Loading @@ -242,7 +242,10 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old, { k_length-=length; if (keyseg->flag & (HA_VAR_LENGTH_PART | HA_BLOB_PART)) { k_length-=2; /* Skip length */ old+= 2; } continue; /* Found NULL */ } } Loading mysql-test/include/varchar.inc +10 −0 Original line number Diff line number Diff line Loading @@ -226,3 +226,13 @@ create table t1 (v varchar(65530), key(v(10))); insert into t1 values(repeat('a',65530)); select length(v) from t1 where v=repeat('a',65530); drop table t1; # # Bug #9489: problem with hash indexes # create table t1(a int, b varchar(12), key ba(b, a)); insert into t1 values (1, 'A'), (20, NULL); explain select * from t1 where a=20 and b is null; select * from t1 where a=20 and b is null; drop table t1; mysql-test/r/bdb.result +9 −0 Original line number Diff line number Diff line Loading @@ -1858,6 +1858,15 @@ select length(v) from t1 where v=repeat('a',65530); length(v) 65530 drop table t1; create table t1(a int, b varchar(12), key ba(b, a)); insert into t1 values (1, 'A'), (20, NULL); explain select * from t1 where a=20 and b is null; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref ba ba 20 const,const 1 Using where select * from t1 where a=20 and b is null; a b 20 NULL drop table t1; create table t1 (v varchar(65530), key(v)); Warnings: Warning 1071 Specified key was too long; max key length is 255 bytes Loading Loading
client/mysql.cc +2 −2 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ #include <locale.h> #endif const char *VER= "14.9"; const char *VER= "14.10"; /* Don't try to make a nice table if the data is too big */ #define MAX_COLUMN_LENGTH 1024 Loading Loading @@ -235,7 +235,7 @@ static COMMANDS commands[] = { { "connect",'r', com_connect,1, "Reconnect to the server. Optional arguments are db and host." }, { "delimiter", 'd', com_delimiter, 1, "Set query delimiter. " }, "Set statement delimiter. NOTE: Takes the rest of the line as new delimiter." }, #ifdef USE_POPEN { "edit", 'e', com_edit, 0, "Edit command with $EDITOR."}, #endif Loading
heap/hp_hash.c +11 −0 Original line number Diff line number Diff line Loading @@ -255,6 +255,9 @@ ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key) if (*pos) /* Found null */ { nr^= (nr << 1) | 1; /* Add key pack length (2) to key for VARCHAR segments */ if (seg->type == HA_KEYTYPE_VARTEXT1) key+= 2; continue; } pos++; Loading Loading @@ -390,6 +393,9 @@ ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key) if (*pos) { nr^= (nr << 1) | 1; /* Add key pack length (2) to key for VARCHAR segments */ if (seg->type == HA_KEYTYPE_VARTEXT1) key+= 2; continue; } pos++; Loading Loading @@ -584,8 +590,13 @@ int hp_key_cmp(HP_KEYDEF *keydef, const byte *rec, const byte *key) if (found_null != (int) *key++) return 1; if (found_null) { /* Add key pack length (2) to key for VARCHAR segments */ if (seg->type == HA_KEYTYPE_VARTEXT1) key+= 2; continue; } } if (seg->type == HA_KEYTYPE_TEXT) { CHARSET_INFO *cs= seg->charset; Loading
myisam/mi_key.c +3 −0 Original line number Diff line number Diff line Loading @@ -242,7 +242,10 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old, { k_length-=length; if (keyseg->flag & (HA_VAR_LENGTH_PART | HA_BLOB_PART)) { k_length-=2; /* Skip length */ old+= 2; } continue; /* Found NULL */ } } Loading
mysql-test/include/varchar.inc +10 −0 Original line number Diff line number Diff line Loading @@ -226,3 +226,13 @@ create table t1 (v varchar(65530), key(v(10))); insert into t1 values(repeat('a',65530)); select length(v) from t1 where v=repeat('a',65530); drop table t1; # # Bug #9489: problem with hash indexes # create table t1(a int, b varchar(12), key ba(b, a)); insert into t1 values (1, 'A'), (20, NULL); explain select * from t1 where a=20 and b is null; select * from t1 where a=20 and b is null; drop table t1;
mysql-test/r/bdb.result +9 −0 Original line number Diff line number Diff line Loading @@ -1858,6 +1858,15 @@ select length(v) from t1 where v=repeat('a',65530); length(v) 65530 drop table t1; create table t1(a int, b varchar(12), key ba(b, a)); insert into t1 values (1, 'A'), (20, NULL); explain select * from t1 where a=20 and b is null; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref ba ba 20 const,const 1 Using where select * from t1 where a=20 and b is null; a b 20 NULL drop table t1; create table t1 (v varchar(65530), key(v)); Warnings: Warning 1071 Specified key was too long; max key length is 255 bytes Loading