MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Tatiana A. Nurnberg Date:November 2 2009 7:42am
Subject:bzr commit into mysql-pe branch (azundris:3645)
View as plain text  
#At file:///Users/tnurnberg/forest/48295/60-48295/ based on revid:azundris@stripped

 3645 Tatiana A. Nurnberg	2009-11-01 [merge]
      manual merge

    modified:
      mysql-test/r/explain.result
      mysql-test/t/explain.test
      sql/item_subselect.cc
=== modified file 'mysql-test/r/explain.result'
--- a/mysql-test/r/explain.result	2009-09-28 15:58:30 +0000
+++ b/mysql-test/r/explain.result	2009-11-02 07:41:05 +0000
@@ -197,6 +197,22 @@ dt
 2001-01-01 01:01:01
 drop tables t1, t2;
 set optimizer_switch=default;
+#
+# Bug#48295:
+# explain extended crash with subquery and ONLY_FULL_GROUP_BY sql_mode
+#
+CREATE TABLE t1 (f1 INT);
+SELECT @@session.sql_mode INTO @old_sql_mode;
+SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
+EXPLAIN EXTENDED SELECT 1 FROM t1
+WHERE f1 > ALL( SELECT t.f1 FROM t1,t1 AS t );
+ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
+SHOW WARNINGS;
+Level	Code	Message
+Error	1140	Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
+Note	1003	select 1 AS `1` from `test`.`t1` where <not>(<exists>(...))
+SET SESSION sql_mode=@old_sql_mode;
+DROP TABLE t1;
 End of 5.1 tests.
 explain select 1;
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr

=== modified file 'mysql-test/t/explain.test'
--- a/mysql-test/t/explain.test	2009-09-28 15:58:30 +0000
+++ b/mysql-test/t/explain.test	2009-11-02 07:41:05 +0000
@@ -168,6 +168,26 @@ SELECT OUTR.dt FROM t1 AS OUTR WHERE OUT
 drop tables t1, t2;
 set optimizer_switch=default;
 
+--echo #
+--echo # Bug#48295:
+--echo # explain extended crash with subquery and ONLY_FULL_GROUP_BY sql_mode
+--echo #
+
+CREATE TABLE t1 (f1 INT);
+
+SELECT @@session.sql_mode INTO @old_sql_mode;
+SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
+
+# EXPLAIN EXTENDED (with subselect). used to crash. should give NOTICE.
+--error ER_MIX_OF_GROUP_FUNC_AND_FIELDS
+EXPLAIN EXTENDED SELECT 1 FROM t1
+                          WHERE f1 > ALL( SELECT t.f1 FROM t1,t1 AS t );
+SHOW WARNINGS;
+
+SET SESSION sql_mode=@old_sql_mode;
+
+DROP TABLE t1;
+
 --echo End of 5.1 tests.
 
 --enable_metadata

=== modified file 'sql/item_subselect.cc'
--- a/sql/item_subselect.cc	2009-09-04 16:47:33 +0000
+++ b/sql/item_subselect.cc	2009-11-02 07:41:05 +0000
@@ -377,9 +377,14 @@ void Item_subselect::update_used_tables(
 
 void Item_subselect::print(String *str, enum_query_type query_type)
 {
-  str->append('(');
-  engine->print(str, query_type);
-  str->append(')');
+  if (engine)
+  {
+    str->append('(');
+    engine->print(str, query_type);
+    str->append(')');
+  }
+  else
+    str->append("(...)");
 }
 
 


Attachment: [text/bzr-bundle] bzr/azundris@mysql.com-20091102074105-t8nv7795dlsqo91q.bundle
Thread
bzr commit into mysql-pe branch (azundris:3645)Tatiana A. Nurnberg2 Nov