List:Commits« Previous MessageNext Message »
From:Jorgen Loland Date:November 21 2011 8:52am
Subject:bzr push into mysql-trunk branch (jorgen.loland:3637 to 3638) Bug#13400713
View as plain text  
 3638 Jorgen Loland	2011-11-21
      BUG#13400713: Follow-up patch. Giving internal tmp tables
      a name was a bad idea: may conflict with user defined table
      names and are visible in MYSQL_FIELDs returned to client. 

    modified:
      mysql-test/r/metadata.result
      mysql-test/suite/opt_trace/r/filesort_pq.result
      mysql-test/suite/opt_trace/r/general2_no_prot.result
      mysql-test/suite/opt_trace/r/general2_ps_prot.result
      mysql-test/suite/opt_trace/r/general_no_prot_none.result
      mysql-test/suite/opt_trace/r/general_ps_prot_none.result
      mysql-test/suite/opt_trace/r/security_no_prot.result
      mysql-test/suite/opt_trace/r/security_ps_prot.result
      mysql-test/suite/opt_trace/r/subquery_no_prot.result
      mysql-test/suite/opt_trace/r/subquery_ps_prot.result
      mysql-test/suite/opt_trace/r/temp_table.result
      sql/filesort.cc
      sql/sql_select.cc
 3637 Vasil Dimov	2011-11-21
      Fix Bug#13397030 DO NOT CALC UNNECESSARY CHECKSUMS WHEN VALIDATING A PAGE
      
      When checking if a checksum matches, before this patch, we always
      calculated crc32 even if the selected algo is 'innodb'
      (e.g. innodb_checksum_algotithm=innodb).
      
      This is seen as unnecessary and crc32 should only be calculated if
      the 'innodb' checksum does not match. Same applies for calculating the
      'innodb' checksum if innodb_checksum_algotithm=crc32.
      
      Approved by:	Marko (http://bur03.no.oracle.com/rb/r/814/)

    modified:
      storage/innobase/buf/buf0buf.c
=== modified file 'mysql-test/r/metadata.result'
--- a/mysql-test/r/metadata.result	2011-11-18 12:17:45 +0000
+++ b/mysql-test/r/metadata.result	2011-11-21 08:51:57 +0000
@@ -191,12 +191,12 @@ Catalog	Database	Table	Table_alias	Colum
 2008-01-02	2008-01-02	2008-01-02	2008-01-02	2008-01-02	2008-01-02
 2008-01-03	2008-01-03	2008-01-03	2008-01-03	2008-01-03	2008-01-03
 COALESCE(d, d)	IFNULL(d, d)	IF(i, d, d)	CASE i WHEN i THEN d ELSE d END	GREATEST(d, d)	LEAST(d, d)
-def			intermediate_tmp_table	CASE i WHEN i THEN d ELSE d END	CASE i WHEN i THEN d ELSE d END	10	10	10	Y	128	0	63
-def			intermediate_tmp_table	COALESCE(d, d)	COALESCE(d, d)	10	10	10	Y	128	0	63
-def			intermediate_tmp_table	GREATEST(d, d)	GREATEST(d, d)	10	10	10	Y	128	0	63
-def			intermediate_tmp_table	IF(i, d, d)	IF(i, d, d)	10	10	10	Y	128	0	63
-def			intermediate_tmp_table	IFNULL(d, d)	IFNULL(d, d)	10	10	10	Y	128	0	63
-def			intermediate_tmp_table	LEAST(d, d)	LEAST(d, d)	10	10	10	Y	128	0	63
+def				CASE i WHEN i THEN d ELSE d END	CASE i WHEN i THEN d ELSE d END	10	10	10	Y	128	0	63
+def				COALESCE(d, d)	COALESCE(d, d)	10	10	10	Y	128	0	63
+def				GREATEST(d, d)	GREATEST(d, d)	10	10	10	Y	128	0	63
+def				IF(i, d, d)	IF(i, d, d)	10	10	10	Y	128	0	63
+def				IFNULL(d, d)	IFNULL(d, d)	10	10	10	Y	128	0	63
+def				LEAST(d, d)	LEAST(d, d)	10	10	10	Y	128	0	63
 DROP TABLE t1;
 #
 # Bug#41788 mysql_fetch_field returns org_table == table by a view

=== modified file 'mysql-test/suite/opt_trace/r/filesort_pq.result'
--- a/mysql-test/suite/opt_trace/r/filesort_pq.result	2011-11-18 14:51:40 +0000
+++ b/mysql-test/suite/opt_trace/r/filesort_pq.result	2011-11-21 08:51:57 +0000
@@ -1554,7 +1554,6 @@ SELECT * from t1 ORDER BY rand(2) LIMIT 
           {
             "creating_tmp_table": {
               "tmp_table_info": {
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "row_length": 219,
                 "key_length": 0,
@@ -1568,7 +1567,6 @@ SELECT * from t1 ORDER BY rand(2) LIMIT 
             "filesort_information": [
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "tmp_table_column"
               }
@@ -3949,7 +3947,6 @@ ORDER BY tmp.f1, f0 LIMIT 30	{
           {
             "creating_tmp_table": {
               "tmp_table_info": {
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "row_length": 235,
                 "key_length": 0,
@@ -3963,13 +3960,11 @@ ORDER BY tmp.f1, f0 LIMIT 30	{
             "filesort_information": [
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "f1"
               },
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "f0"
               }
@@ -4237,7 +4232,6 @@ ORDER BY tmp.f1, f0 LIMIT 30 OFFSET 30	{
           {
             "creating_tmp_table": {
               "tmp_table_info": {
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "row_length": 235,
                 "key_length": 0,
@@ -4251,13 +4245,11 @@ ORDER BY tmp.f1, f0 LIMIT 30 OFFSET 30	{
             "filesort_information": [
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "f1"
               },
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "f0"
               }
@@ -4530,7 +4522,6 @@ ORDER BY tmp.f1, f0 LIMIT 30 OFFSET 30	{
           {
             "creating_tmp_table": {
               "tmp_table_info": {
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "row_length": 235,
                 "key_length": 0,
@@ -4544,13 +4535,11 @@ ORDER BY tmp.f1, f0 LIMIT 30 OFFSET 30	{
             "filesort_information": [
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "f1"
               },
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "f0"
               }
@@ -4851,7 +4840,6 @@ ORDER BY tmp.f1, f0 LIMIT 30 OFFSET 30	{
           {
             "creating_tmp_table": {
               "tmp_table_info": {
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "row_length": 235,
                 "key_length": 0,
@@ -4865,13 +4853,11 @@ ORDER BY tmp.f1, f0 LIMIT 30 OFFSET 30	{
             "filesort_information": [
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "f1"
               },
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "f0"
               }
@@ -6153,7 +6139,6 @@ LIMIT 30	{
           {
             "creating_tmp_table": {
               "tmp_table_info": {
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "row_length": 419,
                 "key_length": 0,
@@ -6245,19 +6230,16 @@ LIMIT 30	{
             "filesort_information": [
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "f2"
               },
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "f0"
               },
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "f0"
               }
@@ -6418,7 +6400,6 @@ GROUP BY 1 ORDER BY 2,1 LIMIT 5	{
           {
             "creating_tmp_table": {
               "tmp_table_info": {
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "row_length": 18,
                 "key_length": 9,
@@ -6432,13 +6413,11 @@ GROUP BY 1 ORDER BY 2,1 LIMIT 5	{
             "filesort_information": [
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "count(f2)"
               },
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "f3"
               }
@@ -7772,7 +7751,6 @@ ORDER BY d1.f2 DESC LIMIT 30	{
           {
             "creating_tmp_table": {
               "tmp_table_info": {
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "row_length": 206,
                 "key_length": 0,
@@ -7819,7 +7797,6 @@ ORDER BY d1.f2 DESC LIMIT 30	{
             "filesort_information": [
               {
                 "direction": "desc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "f2"
               }

=== modified file 'mysql-test/suite/opt_trace/r/general2_no_prot.result'
--- a/mysql-test/suite/opt_trace/r/general2_no_prot.result	2011-11-18 14:51:40 +0000
+++ b/mysql-test/suite/opt_trace/r/general2_no_prot.result	2011-11-21 08:51:57 +0000
@@ -956,7 +956,6 @@ TRACE
           {
             "creating_tmp_table": {
               "tmp_table_info": {
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "row_length": 3,
                 "key_length": 0,
@@ -970,7 +969,6 @@ TRACE
             "filesort_information": [
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "f2"
               }
@@ -1365,7 +1363,6 @@ TRACE
                 {
                   "creating_tmp_table": {
                     "tmp_table_info": {
-                      "database": "",
                       "table": "intermediate_tmp_table",
                       "row_length": 22,
                       "key_length": 5,
@@ -1379,7 +1376,6 @@ TRACE
                   "filesort_information": [
                     {
                       "direction": "asc",
-                      "database": "",
                       "table": "intermediate_tmp_table",
                       "field": "b"
                     }
@@ -4898,7 +4894,6 @@ GROUP BY field2 ORDER BY alias1.col_int_
           {
             "creating_tmp_table": {
               "tmp_table_info": {
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "row_length": 18,
                 "key_length": 4,
@@ -4912,7 +4907,6 @@ GROUP BY field2 ORDER BY alias1.col_int_
             "filesort_information": [
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "col_int_key"
               }

=== modified file 'mysql-test/suite/opt_trace/r/general2_ps_prot.result'
--- a/mysql-test/suite/opt_trace/r/general2_ps_prot.result	2011-11-18 14:51:40 +0000
+++ b/mysql-test/suite/opt_trace/r/general2_ps_prot.result	2011-11-21 08:51:57 +0000
@@ -974,7 +974,6 @@ TRACE
           {
             "creating_tmp_table": {
               "tmp_table_info": {
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "row_length": 3,
                 "key_length": 0,
@@ -988,7 +987,6 @@ TRACE
             "filesort_information": [
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "f2"
               }
@@ -1383,7 +1381,6 @@ TRACE
                 {
                   "creating_tmp_table": {
                     "tmp_table_info": {
-                      "database": "",
                       "table": "intermediate_tmp_table",
                       "row_length": 22,
                       "key_length": 5,
@@ -1397,7 +1394,6 @@ TRACE
                   "filesort_information": [
                     {
                       "direction": "asc",
-                      "database": "",
                       "table": "intermediate_tmp_table",
                       "field": "b"
                     }
@@ -4951,7 +4947,6 @@ GROUP BY field2 ORDER BY alias1.col_int_
           {
             "creating_tmp_table": {
               "tmp_table_info": {
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "row_length": 18,
                 "key_length": 4,
@@ -4965,7 +4960,6 @@ GROUP BY field2 ORDER BY alias1.col_int_
             "filesort_information": [
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "col_int_key"
               }

=== modified file 'mysql-test/suite/opt_trace/r/general_no_prot_none.result'
--- a/mysql-test/suite/opt_trace/r/general_no_prot_none.result	2011-11-18 14:51:40 +0000
+++ b/mysql-test/suite/opt_trace/r/general_no_prot_none.result	2011-11-21 08:51:57 +0000
@@ -612,8 +612,7 @@ SELECT (SELECT 1 FROM t6 WHERE d = ifnul
           {
             "creating_tmp_table": {
               "tmp_table_info": {
-                "database": "",
-                "table": "",
+                "table": "intermediate_tmp_table",
                 "row_length": 9,
                 "key_length": 8,
                 "unique_constraint": false,
@@ -1060,8 +1059,7 @@ SELECT * FROM t5 WHERE 5 IN (SELECT 1 FR
           {
             "creating_tmp_table": {
               "tmp_table_info": {
-                "database": "",
-                "table": "",
+                "table": "intermediate_tmp_table",
                 "row_length": 9,
                 "key_length": 8,
                 "unique_constraint": false,
@@ -1342,7 +1340,7 @@ select (@query:=QUERY)+NULL, (@trace:=TR
 NULL	NULL
 select length(@trace);
 length(@trace)
-14553
+14543
 set optimizer_trace_max_mem_size=13900;
 select length(@query)+length(@trace) > @@optimizer_trace_max_mem_size;
 length(@query)+length(@trace) > @@optimizer_trace_max_mem_size
@@ -1351,7 +1349,7 @@ SELECT * FROM t5 WHERE 5 IN (SELECT 1 FR
 c
 select (@missing_bytes:=missing_bytes_beyond_max_mem_size) from information_schema.OPTIMIZER_TRACE;
 (@missing_bytes:=missing_bytes_beyond_max_mem_size)
-777
+761
 select (@query2:=QUERY)+NULL,(@trace2:=TRACE)+NULL from information_schema.OPTIMIZER_TRACE;
 (@query2:=QUERY)+NULL	(@trace2:=TRACE)+NULL
 NULL	NULL
@@ -1359,7 +1357,7 @@ select length(@trace2),
 (length(@trace2) + @missing_bytes) = length(@trace),
 @query2 = @query;
 length(@trace2)	(length(@trace2) + @missing_bytes) = length(@trace)	@query2 = @query
-13776	1	1
+13782	1	1
 select length(@query2) + length(@trace2)
 between (@@optimizer_trace_max_mem_size-200) and (@@optimizer_trace_max_mem_size+200);
 length(@query2) + length(@trace2)
@@ -4019,8 +4017,7 @@ SELECT * FROM t1 WHERE c1=5 UNION SELECT
     {
       "creating_tmp_table": {
         "tmp_table_info": {
-          "database": "",
-          "table": "",
+          "table": "intermediate_tmp_table",
           "row_length": 5,
           "key_length": 5,
           "unique_constraint": false,
@@ -5858,7 +5855,6 @@ trace
           {
             "creating_tmp_table": {
               "tmp_table_info": {
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "row_length": 30,
                 "key_length": 5,
@@ -5872,7 +5868,6 @@ trace
             "filesort_information": [
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "a"
               }
@@ -6263,7 +6258,6 @@ insert into t6 select * from t6 where d>
           {
             "creating_tmp_table": {
               "tmp_table_info": {
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "row_length": 5,
                 "key_length": 0,
@@ -6433,8 +6427,7 @@ update t5, t6 set t6.d=t6.d+t5.c+4-t5.c-
           {
             "creating_tmp_table": {
               "tmp_table_info": {
-                "database": "",
-                "table": "",
+                "table": "intermediate_tmp_table",
                 "row_length": 12,
                 "key_length": 7,
                 "unique_constraint": false,
@@ -10604,8 +10597,7 @@ select TRACE into dumpfile 'MYSQLTEST_VA
     {
       "creating_tmp_table": {
         "tmp_table_info": {
-          "database": "",
-          "table": "",
+          "table": "intermediate_tmp_table",
           "row_length": 9,
           "key_length": 8,
           "unique_constraint": false,

=== modified file 'mysql-test/suite/opt_trace/r/general_ps_prot_none.result'
--- a/mysql-test/suite/opt_trace/r/general_ps_prot_none.result	2011-11-18 14:51:40 +0000
+++ b/mysql-test/suite/opt_trace/r/general_ps_prot_none.result	2011-11-21 08:51:57 +0000
@@ -612,8 +612,7 @@ SELECT (SELECT 1 FROM t6 WHERE d = ifnul
           {
             "creating_tmp_table": {
               "tmp_table_info": {
-                "database": "",
-                "table": "",
+                "table": "intermediate_tmp_table",
                 "row_length": 9,
                 "key_length": 8,
                 "unique_constraint": false,
@@ -1040,8 +1039,7 @@ SELECT * FROM t5 WHERE 5 IN (SELECT 1 FR
           {
             "creating_tmp_table": {
               "tmp_table_info": {
-                "database": "",
-                "table": "",
+                "table": "intermediate_tmp_table",
                 "row_length": 9,
                 "key_length": 8,
                 "unique_constraint": false,
@@ -1322,7 +1320,7 @@ select (@query:=QUERY)+NULL, (@trace:=TR
 NULL	NULL
 select length(@trace);
 length(@trace)
-13775
+13765
 set optimizer_trace_max_mem_size=13900;
 select length(@query)+length(@trace) > @@optimizer_trace_max_mem_size;
 length(@query)+length(@trace) > @@optimizer_trace_max_mem_size
@@ -1339,7 +1337,7 @@ select length(@trace2),
 (length(@trace2) + @missing_bytes) = length(@trace),
 @query2 = @query;
 length(@trace2)	(length(@trace2) + @missing_bytes) = length(@trace)	@query2 = @query
-13775	1	1
+13765	1	1
 select length(@query2) + length(@trace2)
 between (@@optimizer_trace_max_mem_size-200) and (@@optimizer_trace_max_mem_size+200);
 length(@query2) + length(@trace2)
@@ -3989,8 +3987,7 @@ SELECT * FROM t1 WHERE c1=5 UNION SELECT
     {
       "creating_tmp_table": {
         "tmp_table_info": {
-          "database": "",
-          "table": "",
+          "table": "intermediate_tmp_table",
           "row_length": 5,
           "key_length": 5,
           "unique_constraint": false,
@@ -5816,7 +5813,6 @@ trace
           {
             "creating_tmp_table": {
               "tmp_table_info": {
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "row_length": 30,
                 "key_length": 5,
@@ -5830,7 +5826,6 @@ trace
             "filesort_information": [
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "a"
               }
@@ -6221,7 +6216,6 @@ insert into t6 select * from t6 where d>
           {
             "creating_tmp_table": {
               "tmp_table_info": {
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "row_length": 5,
                 "key_length": 0,
@@ -6391,8 +6385,7 @@ update t5, t6 set t6.d=t6.d+t5.c+4-t5.c-
           {
             "creating_tmp_table": {
               "tmp_table_info": {
-                "database": "",
-                "table": "",
+                "table": "intermediate_tmp_table",
                 "row_length": 12,
                 "key_length": 7,
                 "unique_constraint": false,
@@ -10520,8 +10513,7 @@ select TRACE into dumpfile 'MYSQLTEST_VA
     {
       "creating_tmp_table": {
         "tmp_table_info": {
-          "database": "",
-          "table": "",
+          "table": "intermediate_tmp_table",
           "row_length": 9,
           "key_length": 8,
           "unique_constraint": false,

=== modified file 'mysql-test/suite/opt_trace/r/security_no_prot.result'
--- a/mysql-test/suite/opt_trace/r/security_no_prot.result	2011-11-18 14:51:40 +0000
+++ b/mysql-test/suite/opt_trace/r/security_no_prot.result	2011-11-21 08:51:57 +0000
@@ -869,7 +869,7 @@ insert into t2 values(current_user());
 select QUERY, length(TRACE), INSUFFICIENT_PRIVILEGES from information_schema.OPTIMIZER_TRACE;
 QUERY	length(TRACE)	INSUFFICIENT_PRIVILEGES
 insert into t2 values(current_user())	20	0
-insert into t3 select * from t3	2682	0
+insert into t3 select * from t3	2650	0
 # Trace exposed body of trigger, and content of t2/t3, which we
 # could see anyway:
 show create trigger trg2;

=== modified file 'mysql-test/suite/opt_trace/r/security_ps_prot.result'
--- a/mysql-test/suite/opt_trace/r/security_ps_prot.result	2011-11-18 14:51:40 +0000
+++ b/mysql-test/suite/opt_trace/r/security_ps_prot.result	2011-11-21 08:51:57 +0000
@@ -935,7 +935,7 @@ select QUERY, length(TRACE), INSUFFICIEN
 QUERY	length(TRACE)	INSUFFICIENT_PRIVILEGES
 insert into t2 values(current_user())	20	0
 insert into t2 values(current_user())	20	0
-insert into t3 select * from t3	2682	0
+insert into t3 select * from t3	2650	0
 # Trace exposed body of trigger, and content of t2/t3, which we
 # could see anyway:
 show create trigger trg2;

=== modified file 'mysql-test/suite/opt_trace/r/subquery_no_prot.result'
--- a/mysql-test/suite/opt_trace/r/subquery_no_prot.result	2011-11-18 14:51:40 +0000
+++ b/mysql-test/suite/opt_trace/r/subquery_no_prot.result	2011-11-21 08:51:57 +0000
@@ -1735,7 +1735,6 @@ field4,field5,field6	{
           {
             "creating_tmp_table": {
               "tmp_table_info": {
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "row_length": 13,
                 "key_length": 12,
@@ -1756,19 +1755,16 @@ field4,field5,field6	{
             "filesort_information": [
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "col_varchar_key"
               },
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "col_date_key"
               },
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "col_varchar_nokey"
               }

=== modified file 'mysql-test/suite/opt_trace/r/subquery_ps_prot.result'
--- a/mysql-test/suite/opt_trace/r/subquery_ps_prot.result	2011-11-18 14:51:40 +0000
+++ b/mysql-test/suite/opt_trace/r/subquery_ps_prot.result	2011-11-21 08:51:57 +0000
@@ -1713,7 +1713,6 @@ field4,field5,field6	{
           {
             "creating_tmp_table": {
               "tmp_table_info": {
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "row_length": 13,
                 "key_length": 12,
@@ -1734,19 +1733,16 @@ field4,field5,field6	{
             "filesort_information": [
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "col_varchar_key"
               },
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "col_date_key"
               },
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "col_varchar_nokey"
               }

=== modified file 'mysql-test/suite/opt_trace/r/temp_table.result'
--- a/mysql-test/suite/opt_trace/r/temp_table.result	2011-11-18 14:51:40 +0000
+++ b/mysql-test/suite/opt_trace/r/temp_table.result	2011-11-21 08:51:57 +0000
@@ -128,7 +128,6 @@ SELECT uniq, col1 FROM t1 GROUP BY col2,
           {
             "creating_tmp_table": {
               "tmp_table_info": {
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "row_length": 1054,
                 "key_length": 1040,
@@ -142,13 +141,11 @@ SELECT uniq, col1 FROM t1 GROUP BY col2,
             "filesort_information": [
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "col2"
               },
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "uniq"
               }
@@ -297,7 +294,6 @@ SELECT uniq, col1, col2 FROM t1 GROUP BY
           {
             "creating_tmp_table": {
               "tmp_table_info": {
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "row_length": 1050,
                 "key_length": 13,
@@ -311,7 +307,6 @@ SELECT uniq, col1, col2 FROM t1 GROUP BY
             "filesort_information": [
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "uniq"
               }
@@ -471,7 +466,6 @@ SELECT uniq, col1, col2 FROM t1 GROUP BY
           {
             "creating_tmp_table": {
               "tmp_table_info": {
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "row_length": 1050,
                 "key_length": 13,
@@ -485,7 +479,6 @@ SELECT uniq, col1, col2 FROM t1 GROUP BY
             "converting_tmp_table_to_myisam": {
               "cause": "memory_table_size_exceeded",
               "tmp_table_info": {
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "row_length": 1050,
                 "key_length": 13,
@@ -499,7 +492,6 @@ SELECT uniq, col1, col2 FROM t1 GROUP BY
             "filesort_information": [
               {
                 "direction": "asc",
-                "database": "",
                 "table": "intermediate_tmp_table",
                 "field": "uniq"
               }

=== modified file 'sql/filesort.cc'
--- a/sql/filesort.cc	2011-11-10 06:53:27 +0000
+++ b/sql/filesort.cc	2011-11-21 08:51:57 +0000
@@ -122,8 +122,10 @@ static void trace_filesort_information(O
 
     if (sortorder->field)
     {
-      if (sortorder->field->table_name)
+      if (strlen(sortorder->field->table->alias) != 0)
         oto.add_utf8_table(sortorder->field->table);
+      else
+        oto.add_alnum("table", "intermediate_tmp_table");
       oto.add_alnum("field", sortorder->field->field_name ?
                     sortorder->field->field_name : "tmp_table_column");
     }

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2011-11-19 08:26:38 +0000
+++ b/sql/sql_select.cc	2011-11-21 08:51:57 +0000
@@ -3706,7 +3706,7 @@ JOIN::create_intermediate_table(List<Ite
   TABLE* tab= create_tmp_table(thd, &tmp_table_param, *tmp_table_fields,
                                tmp_table_group, select_distinct && !group_list,
                                save_sum_fields, select_options, tmp_rows_limit, 
-                               "intermediate_tmp_table");
+                               "");
   if (!tab)
     DBUG_RETURN(NULL);
 
@@ -18666,12 +18666,14 @@ bool create_myisam_tmp_table(TABLE *tabl
 void trace_tmp_table(Opt_trace_context *trace, const TABLE *table)
 {
   Opt_trace_object trace_tmp(trace, "tmp_table_info");
-  trace_tmp.add_utf8_table(table);
+  if (strlen(table->alias) != 0)
+    trace_tmp.add_utf8_table(table);
+  else
+    trace_tmp.add_alnum("table", "intermediate_tmp_table");
 
   trace_tmp.add("row_length",table->s->reclength).
     add("key_length", table->s->key_info ? 
-        table->s->key_info->key_length : 
-        0).
+        table->s->key_info->key_length : 0).
     add("unique_constraint", table->s->uniques ? true : false);
 
   if (table->s->db_type() == myisam_hton)

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (jorgen.loland:3637 to 3638) Bug#13400713Jorgen Loland21 Nov