List:Commits« Previous MessageNext Message »
From:gluh Date:December 26 2005 12:33pm
Subject:bk commit into 5.0 tree (gluh:1.2004) BUG#15533
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.2004 05/12/26 16:33:26 gluh@stripped +3 -0
  Fix for bug#15533 crash, information_schema, function, view
    enable view prepared mode during getting metedata for I_S table

  sql/sql_show.cc
    1.303 05/12/26 16:32:01 gluh@stripped +3 -0
    Fix for bug#15533 crash, information_schema, function, view
      enable view prepared mode during getting metedata for I_S table

  mysql-test/t/information_schema.test
    1.66 05/12/26 16:32:01 gluh@stripped +23 -0
    Fix for bug#15533 crash, information_schema, function, view
      test case

  mysql-test/r/information_schema.result
    1.93 05/12/26 16:32:01 gluh@stripped +16 -0
    Fix for bug#15533 crash, information_schema, function, view
      test case

# 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/Bugs/5.0.15533

--- 1.302/sql/sql_show.cc	Mon Dec 19 16:20:56 2005
+++ 1.303/sql/sql_show.cc	Mon Dec 26 16:32:01 2005
@@ -2045,6 +2045,8 @@ int get_all_tables(THD *thd, TABLE_LIST 
   int error= 1;
   db_type not_used;
   Open_tables_state open_tables_state_backup;
+  bool save_view_prepare_mode= lex->view_prepare_mode;
+  lex->view_prepare_mode= TRUE;
   DBUG_ENTER("get_all_tables");
 
   LINT_INIT(end);
@@ -2230,6 +2232,7 @@ err:
   lex->derived_tables= derived_tables;
   lex->all_selects_list= old_all_select_lex;
   lex->query_tables_last= save_query_tables_last;
+  lex->view_prepare_mode= save_view_prepare_mode;
   *save_query_tables_last= 0;
   lex->sql_command= save_sql_command;
   DBUG_RETURN(error);

--- 1.92/mysql-test/r/information_schema.result	Mon Dec 19 16:20:56 2005
+++ 1.93/mysql-test/r/information_schema.result	Mon Dec 26 16:32:01 2005
@@ -1074,3 +1074,19 @@ character_maximum_length	character_octet
 32	32
 64	64
 drop table t1;
+CREATE TABLE t1 (f1 BIGINT, f2 VARCHAR(20), f3 BIGINT);
+INSERT INTO t1 SET f1 = 1, f2 = 'Schoenenbourg', f3 = 1;
+CREATE FUNCTION func2() RETURNS BIGINT RETURN 1;
+CREATE FUNCTION func1() RETURNS BIGINT
+BEGIN
+RETURN ( SELECT COUNT(*) FROM INFORMATION_SCHEMA.VIEWS);
+END//
+CREATE VIEW v1 AS SELECT 1 FROM t1
+WHERE f3 = (SELECT func2 ());
+SELECT func1();
+func1()
+1
+DROP TABLE t1;
+DROP VIEW v1;
+DROP FUNCTION func1;
+DROP FUNCTION func2;

--- 1.65/mysql-test/t/information_schema.test	Mon Dec 19 16:20:56 2005
+++ 1.66/mysql-test/t/information_schema.test	Mon Dec 26 16:32:01 2005
@@ -767,3 +767,26 @@ create table t1(f1 binary(32), f2 varbin
 select character_maximum_length, character_octet_length
 from information_schema.columns where table_name='t1';
 drop table t1;
+
+#
+# Bug#15533 crash, information_schema, function, view
+#
+CREATE TABLE t1 (f1 BIGINT, f2 VARCHAR(20), f3 BIGINT);
+INSERT INTO t1 SET f1 = 1, f2 = 'Schoenenbourg', f3 = 1;
+
+CREATE FUNCTION func2() RETURNS BIGINT RETURN 1;
+
+delimiter //;
+CREATE FUNCTION func1() RETURNS BIGINT
+BEGIN
+  RETURN ( SELECT COUNT(*) FROM INFORMATION_SCHEMA.VIEWS);
+END//
+delimiter ;//
+
+CREATE VIEW v1 AS SELECT 1 FROM t1
+                    WHERE f3 = (SELECT func2 ());
+SELECT func1();
+DROP TABLE t1;
+DROP VIEW v1;
+DROP FUNCTION func1;
+DROP FUNCTION func2;
Thread
bk commit into 5.0 tree (gluh:1.2004) BUG#15533gluh26 Dec