List:Commits« Previous MessageNext Message »
From:gluh Date:January 18 2006 2:29pm
Subject:bk commit into 5.0 tree (gluh:1.2035) BUG#15307
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of gluh. When gluh does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2035 06/01/18 18:29:19 gluh@stripped +6 -0
  Fix for bug#15307 GROUP_CONCAT() with ORDER BY returns empty set on information_schema(2nd ver)
    Fill schema tables with data before filesort if it's necessary

  sql/table.h
    1.122 06/01/18 18:29:13 gluh@stripped +1 -0
    Fix for bug#15307 GROUP_CONCAT() with ORDER BY returns empty set on information_schema(2nd ver)
      Fill schema tables with data before filesort if it's necessary

  sql/sql_show.cc
    1.306 06/01/18 18:29:13 gluh@stripped +11 -1
    Fix for bug#15307 GROUP_CONCAT() with ORDER BY returns empty set on information_schema(2nd ver)
      Fill schema tables with data before filesort if it's necessary

  sql/sql_select.cc
    1.386 06/01/18 18:29:13 gluh@stripped +6 -0
    Fix for bug#15307 GROUP_CONCAT() with ORDER BY returns empty set on information_schema(2nd ver)
      Fill schema tables with data before filesort if it's necessary

  sql/sql_prepare.cc
    1.167 06/01/18 18:29:13 gluh@stripped +2 -0
    Fix for bug#15307 GROUP_CONCAT() with ORDER BY returns empty set on information_schema(2nd ver)
      Fill schema tables with data before filesort if it's necessary

  mysql-test/t/information_schema.test
    1.67 06/01/18 18:29:12 gluh@stripped +9 -0
    Fix for bug#15307 GROUP_CONCAT() with ORDER BY returns empty set on information_schema(2nd ver)
      test case

  mysql-test/r/information_schema.result
    1.95 06/01/18 18:29:12 gluh@stripped +8 -0
    Fix for bug#15307 GROUP_CONCAT() with ORDER BY returns empty set on information_schema(2nd ver)
      test result

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	gluh
# Host:	eagle.intranet.mysql.r18.ru
# Root:	/home/gluh/MySQL/Merge/5.0

--- 1.385/sql/sql_select.cc	Sat Jan 14 02:28:40 2006
+++ 1.386/sql/sql_select.cc	Wed Jan 18 18:29:13 2006
@@ -11582,6 +11582,12 @@ create_sort_index(THD *thd, JOIN *join, 
 	goto err;
     }
   }
+
+  /* Fill schema tables with data before filesort if it's necessary */
+  if ((join->select_lex->options & OPTION_SCHEMA_TABLE) &&
+      get_schema_tables_result(join))
+    goto err;
+
   if (table->s->tmp_table)
     table->file->info(HA_STATUS_VARIABLE);	// Get record count
   table->sort.found_records=filesort(thd, table,sortorder, length,

--- 1.305/sql/sql_show.cc	Thu Jan 12 16:04:45 2006
+++ 1.306/sql/sql_show.cc	Wed Jan 18 18:29:13 2006
@@ -3844,7 +3844,16 @@ bool get_schema_tables_result(JOIN *join
     TABLE_LIST *table_list= tab->table->pos_in_table_list;
     if (table_list->schema_table && thd->fill_derived_tables())
     {
-      if (&lex->unit != lex->current_select->master_unit()) // is subselect
+      bool is_subselect= (&lex->unit != lex->current_select->master_unit());
+      /*
+        The schema table is already processed and 
+        the statement is not a subselect.
+        So we don't need to handle this table again.
+      */
+      if (table_list->is_schema_table_processed && !is_subselect)
+        continue;
+
+      if (is_subselect) // is subselect
       {
         table_list->table->file->extra(HA_EXTRA_RESET_STATE);
         table_list->table->file->delete_all_rows();
@@ -3857,6 +3866,7 @@ bool get_schema_tables_result(JOIN *join
       if (table_list->schema_table->fill_table(thd, table_list,
                                                tab->select_cond))
         result= 1;
+      table_list->is_schema_table_processed= TRUE;
     }
   }
   thd->no_warnings_for_error= 0;

--- 1.121/sql/table.h	Wed Nov 30 23:27:08 2005
+++ 1.122/sql/table.h	Wed Jan 18 18:29:13 2006
@@ -515,6 +515,7 @@ typedef struct st_table_list
   st_select_lex_unit *derived;		/* SELECT_LEX_UNIT of derived table */
   ST_SCHEMA_TABLE *schema_table;        /* Information_schema table */
   st_select_lex	*schema_select_lex;
+  bool is_schema_table_processed;
   /*
     True when the view field translation table is used to convert
     schema table fields for backwards compatibility with SHOW command.

--- 1.94/mysql-test/r/information_schema.result	Thu Jan 12 04:02:48 2006
+++ 1.95/mysql-test/r/information_schema.result	Wed Jan 18 18:29:12 2006
@@ -1084,3 +1084,11 @@ DROP TABLE t1;
 DROP VIEW v1;
 DROP FUNCTION func1;
 DROP FUNCTION func2;
+select column_type, group_concat(table_schema, '.', table_name), count(*) as num
+from information_schema.columns where
+table_schema='information_schema' and
+(column_type = 'varchar(7)' or column_type = 'varchar(20)')
+group by column_type order by num;
+column_type	group_concat(table_schema, '.', table_name)	num
+varchar(20)	information_schema.COLUMNS	1
+varchar(7)	information_schema.ROUTINES,information_schema.VIEWS	2

--- 1.66/mysql-test/t/information_schema.test	Tue Jan  3 14:25:13 2006
+++ 1.67/mysql-test/t/information_schema.test	Wed Jan 18 18:29:12 2006
@@ -790,3 +790,12 @@ DROP TABLE t1;
 DROP VIEW v1;
 DROP FUNCTION func1;
 DROP FUNCTION func2;
+
+#
+# Bug#15307 GROUP_CONCAT() with ORDER BY returns empty set on information_schema
+#
+select column_type, group_concat(table_schema, '.', table_name), count(*) as num
+from information_schema.columns where
+table_schema='information_schema' and
+(column_type = 'varchar(7)' or column_type = 'varchar(20)')
+group by column_type order by num;

--- 1.166/sql/sql_prepare.cc	Wed Nov 23 11:00:46 2005
+++ 1.167/sql/sql_prepare.cc	Wed Jan 18 18:29:13 2006
@@ -2111,6 +2111,8 @@ void reinit_stmt_before_use(THD *thd, LE
       were closed in the end of previous prepare or execute call.
     */
     tables->table= 0;
+    /* Reset is_schema_table_processed value(needed for I_S tables */
+    tables->is_schema_table_processed= FALSE;
 
     if (tables->prep_on_expr)
     {
Thread
bk commit into 5.0 tree (gluh:1.2035) BUG#15307gluh18 Jan