Bug #3403 Wrong encoding in EXPLAIN SELECT output

This commit is contained in:
bar@bar.intranet.mysql.r18.ru 2004-05-14 13:08:22 +05:00
parent 2fc1d5c146
commit 6ecea2fa93
3 changed files with 23 additions and 3 deletions

View File

@ -44,3 +44,12 @@ explain select count(*) from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
drop table t1;
set names koi8r;
create table ÔÁÂ (ËÏÌ0 int, ËÏÌ1 int, key ÉÎÄ0 (ËÏÌ0), key ÉÎÄ01 (ËÏÌ0,ËÏÌ1));
insert into ÔÁÂ (ËÏÌ0) values (1);
insert into ÔÁÂ (ËÏÌ0) values (2);
explain select ËÏÌ0 from ÔÁÂ where ËÏÌ0=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE ÔÁÂ ref ÉÎÄ0,ÉÎÄ01 ÉÎÄ0 5 const 1 Using where; Using index
drop table ÔÁÂ;
set names latin1;

View File

@ -30,3 +30,14 @@ explain select count(*) from t1;
insert into t1 values(1);
explain select count(*) from t1;
drop table t1;
#
# Bug #3403 Wrong encoding in EXPLAIN SELECT output
#
set names koi8r;
create table ÔÁÂ (ËÏÌ0 int, ËÏÌ1 int, key ÉÎÄ0 (ËÏÌ0), key ÉÎÄ01 (ËÏÌ0,ËÏÌ1));
insert into ÔÁÂ (ËÏÌ0) values (1);
insert into ÔÁÂ (ËÏÌ0) values (2);
explain select ËÏÌ0 from ÔÁÂ where ËÏÌ0=1;
drop table ÔÁÂ;
set names latin1;

View File

@ -9123,7 +9123,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
THD *thd=join->thd;
select_result *result=join->result;
Item *item_null= new Item_null();
CHARSET_INFO *cs= &my_charset_latin1;
CHARSET_INFO *cs= system_charset_info;
DBUG_ENTER("select_describe");
DBUG_PRINT("info", ("Select 0x%lx, type %s, message %s",
(ulong)join->select_lex, join->select_lex->type,
@ -9190,7 +9190,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
{
if (tmp1.length())
tmp1.append(',');
tmp1.append(table->key_info[j].name);
tmp1.append(table->key_info[j].name, 0, system_charset_info);
}
}
}
@ -9209,7 +9209,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
{
if (tmp2.length())
tmp2.append(',');
tmp2.append((*ref)->name());
tmp2.append((*ref)->name(), 0, system_charset_info);
}
item_list.push_back(new Item_string(tmp2.ptr(),tmp2.length(),cs));
}