1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MWL#182: Explain running statements: address review feedback

- Add a testcase showing that queries specified in a charset that's different
  from the charset used for warnings, are converted.
This commit is contained in:
Sergey Petrunya
2012-08-09 20:38:09 +04:00
parent 0e5193435a
commit a9dab6da62
2 changed files with 52 additions and 0 deletions

View File

@ -1045,5 +1045,29 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using filesort
DROP TABLE t1,t2;
#
# Check if queries in non-default charsets work.
#
set names cp1251;
select charset('<27><>');
charset('<27><>')
cp1251
select hex('<27><>');
hex('<27><>')
E3FB
set @show_explain_probe_select_id=1;
set debug_dbug='d,show_explain_probe_join_exec_start';
select * from t0 where length('<27><>') = a;
set names utf8;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using where
Warnings:
Note 1003 select * from t0 where length('гы') = a
set names default;
a
2
set debug_dbug='';
set names default;
# End
drop table t0;

View File

@ -1077,5 +1077,33 @@ WHERE ( 8, 89 ) IN ( SELECT b, SUM( DISTINCT b ) FROM t2 GROUP BY b );
DROP TABLE t1,t2;
--echo #
--echo # Check if queries in non-default charsets work.
--echo #
set names cp1251;
# The below are two Russian letters with codes E3FB in cp1251 encoding.
select charset('<27><>');
select hex('<27><>');
set @show_explain_probe_select_id=1;
set debug_dbug='d,show_explain_probe_join_exec_start';
send
select * from t0 where length('<27><>') = a;
connection default;
set names utf8;
--source include/wait_condition.inc
evalp show explain for $thr2;
set names default;
connection con1;
# The constant should be two letters, the last looking like 'bl'
reap;
set debug_dbug='';
set names default;
--echo # End
drop table t0;