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.2097 06/03/29 17:22:52 gluh@stripped +3 -0
Bug#17204 second CALL to procedure crashes Server
Bug#18282 INFORMATION_SCHEMA.TABLES provides inconsistent info about invalid views
use close_tables_for_reopen instead of close_thread_tables and
save & restore query_tables_own_last as it can be changed during view parsing.
It's necessary for views which have SP in definition.
sql/sql_show.cc
1.314 06/03/29 17:21:29 gluh@stripped +4 -2
Bug#17204 second CALL to procedure crashes Server
Bug#18282 INFORMATION_SCHEMA.TABLES provides inconsistent info about invalid views
use close_tables_for_reopen instead of close_thread_tables and
save & restore query_tables_own_last as it can be changed during view parsing.
It's necessary for views which have SP in definition.
mysql-test/t/information_schema_db.test
1.4 06/03/29 17:21:29 gluh@stripped +48 -0
Bug#17204 second CALL to procedure crashes Server
Bug#18282 INFORMATION_SCHEMA.TABLES provides inconsistent info about invalid views
test case
mysql-test/r/information_schema_db.result
1.7 06/03/29 17:21:29 gluh@stripped +41 -0
Bug#17204 second CALL to procedure crashes Server
Bug#18282 INFORMATION_SCHEMA.TABLES provides inconsistent info about invalid views
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.17204
--- 1.313/sql/sql_show.cc Mon Mar 20 14:17:41 2006
+++ 1.314/sql/sql_show.cc Wed Mar 29 17:21:29 2006
@@ -2048,6 +2048,7 @@ int get_all_tables(THD *thd, TABLE_LIST
SELECT_LEX *select_lex= &lex->select_lex;
SELECT_LEX *old_all_select_lex= lex->all_selects_list;
TABLE_LIST **save_query_tables_last= lex->query_tables_last;
+ TABLE_LIST **save_query_tables_own_last= lex->query_tables_own_last;
enum_sql_command save_sql_command= lex->sql_command;
SELECT_LEX *lsel= tables->schema_select_lex;
ST_SCHEMA_TABLE *schema_table= tables->schema_table;
@@ -2118,7 +2119,7 @@ int get_all_tables(THD *thd, TABLE_LIST
show_table_list->db),
show_table_list->alias));
thd->temporary_tables= 0;
- close_thread_tables(thd);
+ close_tables_for_reopen(thd, &show_table_list);
show_table_list->table= 0;
goto err;
}
@@ -2232,7 +2233,7 @@ int get_all_tables(THD *thd, TABLE_LIST
res= schema_table->process_table(thd, show_table_list, table,
res, base_name,
show_table_list->alias);
- close_thread_tables(thd);
+ close_tables_for_reopen(thd, &show_table_list);
if (res)
goto err;
}
@@ -2252,6 +2253,7 @@ err:
lex->derived_tables= derived_tables;
lex->all_selects_list= old_all_select_lex;
lex->query_tables_last= save_query_tables_last;
+ lex->query_tables_own_last= save_query_tables_own_last;
lex->view_prepare_mode= save_view_prepare_mode;
*save_query_tables_last= 0;
lex->sql_command= save_sql_command;
--- 1.6/mysql-test/r/information_schema_db.result Mon Mar 20 13:41:56 2006
+++ 1.7/mysql-test/r/information_schema_db.result Wed Mar 29 17:21:29 2006
@@ -24,10 +24,12 @@ TABLE_CONSTRAINTS
TABLE_PRIVILEGES
TRIGGERS
create database `inf%`;
+create database mbase;
use `inf%`;
show tables;
Tables_in_inf%
grant all privileges on `inf%`.* to 'mysqltest_1'@'localhost';
+grant all privileges on `mbase`.* to 'mysqltest_1'@'localhost';
create table t1 (f1 int);
create function func1(curr_int int) returns int
begin
@@ -36,9 +38,48 @@ select max(f1) from t1 into ret_val;
return ret_val;
end|
create view v1 as select f1 from t1 where f1 = func1(f1);
+use mbase;
+create procedure p1 ()
+begin
+select table_name from information_schema.key_column_usage
+order by table_name;
+end|
+create table t1
+(f1 int(10) unsigned not null,
+f2 varchar(100) not null,
+primary key (f1), unique key (f2));
select * from information_schema.tables;
+call mbase.p1();
+call mbase.p1();
+call mbase.p1();
+use `inf%`;
drop user mysqltest_1@localhost;
drop view v1;
drop function func1;
drop table t1;
drop database `inf%`;
+drop procedure mbase.p1;
+drop database mbase;
+use test;
+create table t1 (i int);
+create function f1 () returns int return (select max(i) from t1);
+create view v1 as select f1();
+create table t2 (id int);
+create function f2 () returns int return (select max(i) from t2);
+create view v2 as select f2();
+drop table t2;
+select table_name, table_type, table_comment from information_schema.tables
+where table_schema='test';
+table_name table_type table_comment
+t1 BASE TABLE
+v1 VIEW VIEW
+v2 VIEW View 'test.v2' references invalid table(s) or column(s) or function(s) or define
+drop table t1;
+select table_name, table_type, table_comment from information_schema.tables
+where table_schema='test';
+table_name table_type table_comment
+v1 VIEW View 'test.v1' references invalid table(s) or column(s) or function(s) or define
+v2 VIEW View 'test.v2' references invalid table(s) or column(s) or function(s) or define
+drop function f1;
+drop function f2;
+drop view v1, v2;
--- 1.3/mysql-test/t/information_schema_db.test Mon Mar 20 13:41:56 2006
+++ 1.4/mysql-test/t/information_schema_db.test Wed Mar 29 17:21:29 2006
@@ -6,6 +6,7 @@ show tables;
--replace_result 'Tables_in_INFORMATION_SCHEMA (T%)' 'Tables_in_information_schema (T%)'
show tables from INFORMATION_SCHEMA like 'T%';
create database `inf%`;
+create database mbase;
use `inf%`;
show tables;
@@ -18,6 +19,7 @@ show tables;
# privileges at all).
#
grant all privileges on `inf%`.* to 'mysqltest_1'@'localhost';
+grant all privileges on `mbase`.* to 'mysqltest_1'@'localhost';
create table t1 (f1 int);
delimiter |;
create function func1(curr_int int) returns int
@@ -28,15 +30,61 @@ begin
end|
delimiter ;|
create view v1 as select f1 from t1 where f1 = func1(f1);
+
+#
+# Bug#17204 second CALL to procedure crashes Server
+#
+use mbase;
+delimiter |;
+create procedure p1 ()
+begin
+select table_name from information_schema.key_column_usage
+order by table_name;
+end|
+delimiter ;|
+
+create table t1
+(f1 int(10) unsigned not null,
+ f2 varchar(100) not null,
+ primary key (f1), unique key (f2));
+
connect (user1,localhost,mysqltest_1,,);
connection user1;
--disable_result_log
select * from information_schema.tables;
+call mbase.p1();
+call mbase.p1();
+call mbase.p1();
--enable_result_log
+
connection default;
+use `inf%`;
drop user mysqltest_1@localhost;
drop view v1;
drop function func1;
drop table t1;
drop database `inf%`;
+drop procedure mbase.p1;
+drop database mbase;
+#
+# Bug#18282 INFORMATION_SCHEMA.TABLES provides inconsistent info about invalid views
+#
+use test;
+create table t1 (i int);
+create function f1 () returns int return (select max(i) from t1);
+create view v1 as select f1();
+create table t2 (id int);
+create function f2 () returns int return (select max(i) from t2);
+create view v2 as select f2();
+
+drop table t2;
+select table_name, table_type, table_comment from information_schema.tables
+where table_schema='test';
+drop table t1;
+select table_name, table_type, table_comment from information_schema.tables
+where table_schema='test';
+drop function f1;
+drop function f2;
+drop view v1, v2;
+
| Thread |
|---|
| • bk commit into 5.0 tree (gluh:1.2097) BUG#18282 | gluh | 29 Mar |