[Commits] Rev 3464: MWL#182: Explain running statements: address review feedback in file:///home/psergey/dev2/5.5-show-explain-r30/

Sergey Petrunya psergey at askmonty.org
Thu Aug 9 19:38:12 EEST 2012


At file:///home/psergey/dev2/5.5-show-explain-r30/

------------------------------------------------------------
revno: 3464
revision-id: psergey at askmonty.org-20120809163809-izpuld11dt8z85uw
parent: psergey at askmonty.org-20120808172400-l3lnfb1tu5tzy4iz
committer: Sergey Petrunya <psergey at askmonty.org>
branch nick: 5.5-show-explain-r30
timestamp: Thu 2012-08-09 20:38:09 +0400
message:
  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.
=== modified file 'mysql-test/r/show_explain.result'
--- a/mysql-test/r/show_explain.result	2012-08-02 13:12:23 +0000
+++ b/mysql-test/r/show_explain.result	2012-08-09 16:38:09 +0000
@@ -1045,5 +1045,29 @@ id	select_type	table	type	possible_keys	
 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('ãû');
+charset('ãû')
+cp1251
+select hex('ãû');
+hex('ãû')
+E3FB
+set @show_explain_probe_select_id=1;
+set debug_dbug='d,show_explain_probe_join_exec_start';
+select * from t0 where length('ãû') = 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;

=== modified file 'mysql-test/t/show_explain.test'
--- a/mysql-test/t/show_explain.test	2012-08-02 13:12:23 +0000
+++ b/mysql-test/t/show_explain.test	2012-08-09 16:38:09 +0000
@@ -1077,5 +1077,33 @@ WHERE ( 8, 89 ) IN ( SELECT b, SUM( DIST
 
 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('ãû');
+select hex('ãû');
+
+set @show_explain_probe_select_id=1;
+set debug_dbug='d,show_explain_probe_join_exec_start';
+
+send
+select * from t0 where length('ãû') = 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;



More information about the commits mailing list