mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +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:
@@ -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
|
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
||||||
2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using filesort
|
2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using filesort
|
||||||
DROP TABLE t1,t2;
|
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
|
# End
|
||||||
drop table t0;
|
drop table t0;
|
||||||
|
@@ -1077,5 +1077,33 @@ WHERE ( 8, 89 ) IN ( SELECT b, SUM( DISTINCT b ) FROM t2 GROUP BY b );
|
|||||||
|
|
||||||
DROP TABLE t1,t2;
|
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
|
--echo # End
|
||||||
drop table t0;
|
drop table t0;
|
||||||
|
Reference in New Issue
Block a user