List:Commits« Previous MessageNext Message »
From:Tor Didriksen Date:January 17 2012 11:36am
Subject:bzr push into mysql-trunk branch (tor.didriksen:3458 to 3459)
View as plain text  
 3459 Tor Didriksen	2012-01-17 [merge]
      merge opt-backporting => opt-team

    modified:
      mysql-test/r/group_by.result
      mysql-test/t/group_by.test
      sql/item_subselect.cc
 3458 Tor Didriksen	2012-01-17 [merge]
      NULL merge opt-backporting => opt-team

=== modified file 'mysql-test/r/group_by.result'
--- a/mysql-test/r/group_by.result	2012-01-17 09:27:34 +0000
+++ b/mysql-test/r/group_by.result	2012-01-17 11:35:06 +0000
@@ -2448,3 +2448,15 @@ Warnings:
 Note	1003	/* select#1 */ select NULL AS `field1` from `test`.`t1` join `test`.`t3` `alias2` where 0 group by `field1`
 DROP TABLE t1,t2,t3;
 DROP VIEW view1;
+CREATE TABLE t1 (col_varchar_nokey varchar(1) DEFAULT NULL);
+INSERT INTO t1 VALUES ('v'),('c');
+EXPLAIN EXTENDED SELECT (SELECT 150) AS field5
+FROM (SELECT * FROM t1) AS alias1
+GROUP BY field5;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	<derived3>	ALL	NULL	NULL	NULL	NULL	2	100.00	
+3	DERIVED	t1	ALL	NULL	NULL	NULL	NULL	2	100.00	
+Warnings:
+Note	1249	Select 2 was reduced during optimization
+Note	1003	/* select#1 */ select 150 AS `field5` from (/* select#3 */ select `test`.`t1`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t1`) `alias1` group by `field5`
+DROP TABLE t1;

=== modified file 'mysql-test/t/group_by.test'
--- a/mysql-test/t/group_by.test	2012-01-16 14:26:28 +0000
+++ b/mysql-test/t/group_by.test	2012-01-17 09:45:08 +0000
@@ -1713,6 +1713,9 @@ DROP TABLE t1,t2;
 --echo # Bug#13591138 - ASSERTION NAME && !IS_AUTOGENERATED_NAME IN
 --echo # ITEM::PRINT_FOR_ORDER ON EXPLAIN EXT
 --echo #
+
+# There was a bug with Item_direct_view_ref
+
 CREATE TABLE t1 (  
   pk int(11) NOT NULL AUTO_INCREMENT,
   col_datetime_key datetime NOT NULL,
@@ -1755,3 +1758,14 @@ GROUP BY
 
 DROP TABLE t1,t2,t3;
 DROP VIEW view1;
+
+# And a bug with Item_singlerow_subselect:
+
+CREATE TABLE t1 (col_varchar_nokey varchar(1) DEFAULT NULL);
+INSERT INTO t1 VALUES ('v'),('c');
+
+EXPLAIN EXTENDED SELECT (SELECT 150) AS field5
+FROM (SELECT * FROM t1) AS alias1
+GROUP BY field5;
+
+DROP TABLE t1;

=== modified file 'sql/item_subselect.cc'
--- a/sql/item_subselect.cc	2011-12-15 15:15:37 +0000
+++ b/sql/item_subselect.cc	2012-01-17 09:45:08 +0000
@@ -217,6 +217,7 @@ bool Item_subselect::fix_fields(THD *thd
 	unit->outer_select()->having= substitution; // correct HAVING for PS
 
       (*ref)= substitution;
+      substitution->is_autogenerated_name= is_autogenerated_name;
       substitution->name= name;
       if (have_to_be_excluded)
 	engine->exclude();

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (tor.didriksen:3458 to 3459) Tor Didriksen17 Jan