Commit f90f2c58 authored by unknown's avatar unknown
Browse files

Merge pnousiainen@bk-internal.mysql.com:/home/bk/mysql-5.0

into  mysql.com:/space/pekka/ndb/version/my50

parents 63da222a 8a5ca696
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ static int port= 0;
static const char* sock= 0;
static const char* user = 0;
static char* pass = 0;
static char *charset= 0;

static ulonglong start_position, stop_position;
#define start_position_mot ((my_off_t)start_position)
@@ -707,6 +708,9 @@ static struct my_option my_long_options[] =
   "Used to reserve file descriptors for usage by this program",
   (gptr*) &open_files_limit, (gptr*) &open_files_limit, 0, GET_ULONG,
   REQUIRED_ARG, MY_NFILE, 8, OS_FILE_LIMIT, 0, 1, 0},
  {"set-charset", OPT_SET_CHARSET,
   "Add 'SET NAMES character_set' to the output.", (gptr*) &charset,
   (gptr*) &charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
  {"short-form", 's', "Just show the queries, no extra info.",
   (gptr*) &short_form, (gptr*) &short_form, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
   0, 0},
@@ -1430,6 +1434,13 @@ int main(int argc, char** argv)
          "/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,"
          "COMPLETION_TYPE=0*/;\n");

  if (charset)
    fprintf(result_file,
            "\n/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;"
            "\n/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;"
            "\n/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;"  
            "\n/*!40101 SET NAMES %s */;\n", charset);

  for (save_stop_position= stop_position, stop_position= ~(my_off_t)0 ;
       (--argc >= 0) && !stop_passed ; )
  {
@@ -1454,6 +1465,12 @@ int main(int argc, char** argv)
  if (disable_log_bin)
    fprintf(result_file, "/*!32316 SET SQL_LOG_BIN=@OLD_SQL_LOG_BIN*/;\n");

  if (charset)
    fprintf(result_file,
            "/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\n"
            "/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\n"
            "/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\n");

  if (tmpdir.list)
    free_tmpdir(&tmpdir);
  if (result_file != stdout)
+56 −1
Original line number Diff line number Diff line
drop table if exists t1,t2;
drop view if exists v1,v2;
drop function if exists f1;
drop function if exists f2;
use INFORMATION_SCHEMA;
show tables;
Tables_in_information_schema
@@ -24,10 +28,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 +42,58 @@ select max(f1) from t1 into ret_val;
return ret_val;
end|
create view v1 as select f1 from t1 where f1 = func1(f1);
create function func2() returns int return 1;
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 table t1;
select table_name, table_type, table_comment from information_schema.tables
where table_schema='inf%' and func2();
table_name	table_type	table_comment
v1	VIEW	View 'inf%.v1' references invalid table(s) or column(s) or function(s) or define
select table_name, table_type, table_comment from information_schema.tables
where table_schema='inf%' and func2();
table_name	table_type	table_comment
v1	VIEW	View 'inf%.v1' references invalid table(s) or column(s) or function(s) or define
drop view v1;
drop function func1;
drop table t1;
drop function func2;
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;
+59 −1
Original line number Diff line number Diff line
-- source include/testdb_only.inc

--disable_warnings
drop table if exists t1,t2;
drop view if exists v1,v2;
drop function if exists f1;
drop function if exists f2;
--enable_warnings

use INFORMATION_SCHEMA;
--replace_result Tables_in_INFORMATION_SCHEMA Tables_in_information_schema
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;

#
# Bug#18113 SELECT * FROM information_schema.xxx crashes server
# Bug#17204 second CALL to procedure 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
@@ -18,6 +27,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 +38,63 @@ begin
end|
delimiter ;|
create view v1 as select f1 from t1 where f1 = func1(f1);
create function func2() returns int return 1;

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 table t1;
select table_name, table_type, table_comment from information_schema.tables
where table_schema='inf%' and func2();
select table_name, table_type, table_comment from information_schema.tables
where table_schema='inf%' and func2();
drop view v1;
drop function func1;
drop table t1;
drop function func2;

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;
+2 −0
Original line number Diff line number Diff line
@@ -148,3 +148,5 @@ drop function bug15728_insert;
drop table t1, t2;

# End of 5.0 tests

sync_slave_with_master;
+14 −8
Original line number Diff line number Diff line
@@ -138,11 +138,14 @@ void Guardian_thread::process_instance(Instance *instance,
        break;
    case JUST_CRASHED:
      if (current_time - current_node->crash_moment <= 2)
      {
        if (instance->is_crashed())
        {
          instance->start();
          log_info("guardian: starting instance %s",
                   instance->options.instance_name);
        }
      }
      else
        current_node->state= CRASHED;
      break;
@@ -151,6 +154,8 @@ void Guardian_thread::process_instance(Instance *instance,
          monitoring_interval)
      {
        if ((current_node->restart_counter < restart_retry))
        {
          if (instance->is_crashed())
          {
            instance->start();
            current_node->last_checked= current_time;
@@ -158,6 +163,7 @@ void Guardian_thread::process_instance(Instance *instance,
            log_info("guardian: restarting instance %s",
                     instance->options.instance_name);
          }
        }
        else
          current_node->state= CRASHED_AND_ABANDONED;
      }
Loading