Commit 12085567 authored by gluh@mysql.com's avatar gluh@mysql.com

Fix for bug #9404: information_schema: Weird error messages with SELECT SUM() ... GROUP BY queries

parent 1d71dece
...@@ -635,13 +635,12 @@ int hp_key_cmp(HP_KEYDEF *keydef, const byte *rec, const byte *key) ...@@ -635,13 +635,12 @@ int hp_key_cmp(HP_KEYDEF *keydef, const byte *rec, const byte *key)
key+= 2; /* skip key pack length */ key+= 2; /* skip key pack length */
if (cs->mbmaxlen > 1) if (cs->mbmaxlen > 1)
{ {
uint char_length= seg->length / cs->mbmaxlen; uint char_length1, char_length2;
char_length_key= my_charpos(cs, key, key + char_length_key, char_length1= char_length2= seg->length / cs->mbmaxlen;
char_length); char_length1= my_charpos(cs, key, key + char_length_key, char_length1);
set_if_smaller(char_length_key, seg->length); set_if_smaller(char_length_key, char_length1);
char_length_rec= my_charpos(cs, pos, pos + char_length_rec, char_length2= my_charpos(cs, pos, pos + char_length_rec, char_length2);
char_length); set_if_smaller(char_length_rec, char_length2);
set_if_smaller(char_length_rec, seg->length);
} }
if (cs->coll->strnncollsp(seg->charset, if (cs->coll->strnncollsp(seg->charset,
......
...@@ -734,3 +734,7 @@ x_real NULL NULL ...@@ -734,3 +734,7 @@ x_real NULL NULL
x_float NULL NULL x_float NULL NULL
x_double_precision NULL NULL x_double_precision NULL NULL
drop table t1; drop table t1;
SELECT table_schema, count(*) FROM information_schema.TABLES GROUP BY TABLE_SCHEMA;
table_schema count(*)
information_schema 15
mysql 17
...@@ -473,3 +473,9 @@ SELECT COLUMN_NAME, CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH ...@@ -473,3 +473,9 @@ SELECT COLUMN_NAME, CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH
FROM INFORMATION_SCHEMA.COLUMNS FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME= 't1'; WHERE TABLE_NAME= 't1';
drop table t1; drop table t1;
#
# Bug #9404 information_schema: Weird error messages
# with SELECT SUM() ... GROUP BY queries
#
SELECT table_schema, count(*) FROM information_schema.TABLES GROUP BY TABLE_SCHEMA;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment