Commit f6ffd3a1 authored by unknown's avatar unknown
Browse files

5.0 -> 5.1 merge


configure.in:
  Auto merged
mysql-test/lib/mtr_timer.pl:
  Auto merged
mysql-test/r/information_schema.result:
  Auto merged
mysql-test/r/information_schema_db.result:
  Auto merged
mysql-test/r/query_cache_notembedded.result:
  Auto merged
mysql-test/t/information_schema.test:
  Auto merged
mysql-test/t/query_cache_notembedded.test:
  Auto merged
scripts/make_binary_distribution.sh:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
storage/ndb/src/kernel/blocks/backup/Backup.cpp:
  Auto merged
sql/ha_innodb.cc:
  manual merge
sql/sql_insert.cc:
  manual merge
parents c8caeebf 53862e60
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -294,6 +294,13 @@ sub1 sub1
select count(*) from information_schema.ROUTINES;
count(*)
2
create view v1 as select routine_schema, routine_name from information_schema.routines 
order by routine_schema, routine_name;
select * from v1;
routine_schema	routine_name
test	sel2
test	sub1
drop view v1;
select ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES;
ROUTINE_NAME	ROUTINE_DEFINITION
show create function sub1;
+14 −0
Original line number Diff line number Diff line
@@ -33,4 +33,18 @@ create database `inf%`;
use `inf%`;
show tables;
Tables_in_inf%
grant all privileges on `inf%`.* to 'mysqltest_1'@'localhost';
create table t1 (f1 int);
create function func1(curr_int int) returns int
begin
declare ret_val int;
select max(f1) from t1 into ret_val;
return ret_val;
end|
create view v1 as select f1 from t1 where f1 = func1(f1);
select * from information_schema.tables;
drop user mysqltest_1@localhost;
drop view v1;
drop function func1;
drop table t1;
drop database `inf%`;
+30 −0
Original line number Diff line number Diff line
@@ -314,4 +314,34 @@ drop procedure f2;
drop procedure f3;
drop procedure f4;
drop table t1;
reset query cache;
drop function if exists f1;
create table t1 (id int);
create function f1 ()
returns int
begin
declare i_var int;
set i_var = sleep(3);
insert into t1 values(3);
set i_var = sleep(3);
return 0;
end;|
 select f1();
select sleep(4);
sleep(4)
0
select * from t1;
id
3
f1()
0
select * from t1;
id
3
reset query cache;
select * from t1;
id
3
drop table t1;
drop function f1;
set GLOBAL query_cache_size=0;
+5 −0
Original line number Diff line number Diff line
@@ -146,6 +146,11 @@ select a.ROUTINE_NAME, b.name from information_schema.ROUTINES a,
mysql.proc b where a.ROUTINE_NAME = convert(b.name using utf8) order by 1;
select count(*) from information_schema.ROUTINES;

create view v1 as select routine_schema, routine_name from information_schema.routines 
order by routine_schema, routine_name;
select * from v1;
drop view v1;

connect (user1,localhost,mysqltest_1,,);
connection user1;
select ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES;
+31 −0
Original line number Diff line number Diff line
@@ -8,4 +8,35 @@ show tables from INFORMATION_SCHEMA like 'T%';
create database `inf%`;
use `inf%`;
show tables;

#
# Bug#18113 SELECT * FROM information_schema.xxx crashes server
# Crash happened when one selected data from one of INFORMATION_SCHEMA
# tables and in order to build its contents server had to open view which
# used stored function and table or view on which one had not global or
# database-level privileges (e.g. had only table-level or had no
# privileges at all).
#
grant all privileges on `inf%`.* to 'mysqltest_1'@'localhost';
create table t1 (f1 int);
delimiter |;
create function func1(curr_int int) returns int
begin
  declare ret_val int;
  select max(f1) from t1 into ret_val;
  return ret_val;
end|
delimiter ;|
create view v1 as select f1 from t1 where f1 = func1(f1);
connect (user1,localhost,mysqltest_1,,);
connection user1;
--disable_result_log
select * from information_schema.tables;
--enable_result_log
connection default;
drop user mysqltest_1@localhost;
drop view v1;
drop function func1;
drop table t1;

drop database `inf%`;
Loading