mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
Merge bk-internal.mysql.com:/home/bk/mysql-5.1-new
into mysql.com:/home/my/mysql-5.1
This commit is contained in:
commit
9c132f3b6b
6 changed files with 78 additions and 51 deletions
|
@ -1860,7 +1860,7 @@ sub mysql_install_db () {
|
|||
}
|
||||
}
|
||||
|
||||
if ( ndbcluster_install_slave() )
|
||||
if ( $use_slaves and ndbcluster_install_slave() )
|
||||
{
|
||||
if ( $opt_force)
|
||||
{
|
||||
|
|
|
@ -18,12 +18,12 @@ select * into outfile 'MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_out
|
|||
drop table t1;
|
||||
create table t1(a int primary key);
|
||||
load data local infile 'MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' into table t1;
|
||||
select * from t1;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
select * from t1;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a
|
||||
1
|
||||
2
|
||||
|
|
|
@ -19,24 +19,30 @@ set spv=spv+1;
|
|||
end while;
|
||||
end//
|
||||
call p1();
|
||||
select * from t1;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
delete from t1;
|
||||
create procedure p2()
|
||||
begin
|
||||
declare a int default 4;
|
||||
create table t2 as select a;
|
||||
end//
|
||||
call p2();
|
||||
select * from t2;
|
||||
SELECT * FROM t2 ORDER BY a;
|
||||
a
|
||||
4
|
||||
select * from t2;
|
||||
SELECT * FROM t2 ORDER BY a;
|
||||
a
|
||||
4
|
||||
drop procedure p1;
|
||||
|
@ -61,43 +67,58 @@ end//
|
|||
call p1(f1(1), f1(2));
|
||||
yes
|
||||
yes
|
||||
select * from t1;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a
|
||||
1
|
||||
1
|
||||
2
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
create table t2(a int);
|
||||
insert into t2 values (10),(11);
|
||||
select a,f1(a) from t2;
|
||||
SELECT a,f1(a) FROM t2 ORDER BY a;
|
||||
a f1(a)
|
||||
10 11
|
||||
11 12
|
||||
insert into t2 select f1(3);
|
||||
select 'master:',a from t1;
|
||||
SELECT 'master:',a FROM t1 ORDER BY a;
|
||||
master: a
|
||||
master: 1
|
||||
master: 1
|
||||
master: 2
|
||||
master: 2
|
||||
master: 3
|
||||
master: 3
|
||||
master: 4
|
||||
master: 5
|
||||
master: 5
|
||||
master: 6
|
||||
master: 7
|
||||
master: 8
|
||||
master: 10
|
||||
master: 11
|
||||
master: 3
|
||||
select 'slave:',a from t1;
|
||||
SELECT 'slave:',a FROM t1 ORDER BY a;
|
||||
slave: a
|
||||
slave: 1
|
||||
slave: 1
|
||||
slave: 2
|
||||
slave: 2
|
||||
slave: 3
|
||||
slave: 3
|
||||
slave: 4
|
||||
slave: 5
|
||||
slave: 5
|
||||
slave: 6
|
||||
slave: 7
|
||||
slave: 8
|
||||
slave: 10
|
||||
slave: 11
|
||||
slave: 3
|
||||
drop procedure p1;
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
|
@ -108,11 +129,11 @@ select * from v1;
|
|||
f1(a)
|
||||
2
|
||||
3
|
||||
select 'master:',a from t1;
|
||||
SELECT 'master:',a FROM t1 ORDER BY a;
|
||||
master: a
|
||||
master: 1
|
||||
master: 2
|
||||
select 'slave:',a from t1;
|
||||
SELECT 'slave:',a FROM t1 ORDER BY a;
|
||||
slave: a
|
||||
slave: 1
|
||||
slave: 2
|
||||
|
@ -123,10 +144,10 @@ set @xx=123;
|
|||
execute s1 using @xx;
|
||||
f1(?)
|
||||
124
|
||||
select 'master:',a from t1;
|
||||
SELECT 'master:',a FROM t1 ORDER BY a;
|
||||
master: a
|
||||
master: 123
|
||||
select 'slave:',a from t1;
|
||||
SELECT 'slave:',a FROM t1 ORDER BY a;
|
||||
slave: a
|
||||
slave: 123
|
||||
delete from t1;
|
||||
|
@ -141,18 +162,18 @@ set spv= spv - 10;
|
|||
end while;
|
||||
end//
|
||||
call p1(15);
|
||||
select 'master:',a from t1;
|
||||
SELECT 'master:',a FROM t1 ORDER BY a;
|
||||
master: a
|
||||
master: 15
|
||||
master: 15
|
||||
master: 6
|
||||
master: 6
|
||||
select 'slave:',a from t1;
|
||||
master: 15
|
||||
master: 15
|
||||
SELECT 'slave:',a FROM t1 ORDER BY a;
|
||||
slave: a
|
||||
slave: 15
|
||||
slave: 15
|
||||
slave: 6
|
||||
slave: 6
|
||||
slave: 15
|
||||
slave: 15
|
||||
drop procedure p1;
|
||||
drop function f1;
|
||||
drop table t1,t2;
|
||||
|
@ -187,26 +208,26 @@ f1()
|
|||
0
|
||||
set @x=30;
|
||||
call p1();
|
||||
select 'master', a from t1;
|
||||
SELECT 'master', a FROM t1 ORDER BY a;
|
||||
master a
|
||||
master 20
|
||||
master 10
|
||||
master 11
|
||||
master 100
|
||||
master 101
|
||||
master 20
|
||||
master 30
|
||||
master 31
|
||||
master 100
|
||||
master 101
|
||||
master 101
|
||||
master 102
|
||||
select 'slave', a from t1;
|
||||
SELECT 'slave', a FROM t1 ORDER BY a;
|
||||
slave a
|
||||
slave 20
|
||||
slave 10
|
||||
slave 11
|
||||
slave 100
|
||||
slave 101
|
||||
slave 20
|
||||
slave 30
|
||||
slave 31
|
||||
slave 100
|
||||
slave 101
|
||||
slave 101
|
||||
slave 102
|
||||
drop table t1;
|
||||
|
|
|
@ -53,11 +53,11 @@ create table t1(a int primary key);
|
|||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
eval load data local infile '$MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' into table t1;
|
||||
system rm $MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile ;
|
||||
select * from t1;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
select * from t1;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
connection master;
|
||||
drop table t1;
|
||||
save_master_pos;
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
##########################################
|
||||
# Change Author: JBM
|
||||
# Change Date: 2006-05-02
|
||||
# Change: Added Order By for NDB testing
|
||||
##########################################
|
||||
|
||||
# Test of replication of stored procedures (WL#2146 for MySQL 5.0)
|
||||
-- source include/master-slave.inc
|
||||
|
||||
|
@ -30,9 +36,9 @@ call p1();
|
|||
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
select * from t1;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
connection master;
|
||||
delete from t1;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
|
||||
# 2. Test SP variable name
|
||||
delimiter //;
|
||||
|
@ -44,10 +50,10 @@ end//
|
|||
delimiter ;//
|
||||
|
||||
call p2();
|
||||
select * from t2;
|
||||
SELECT * FROM t2 ORDER BY a;
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
select * from t2;
|
||||
SELECT * FROM t2 ORDER BY a;
|
||||
|
||||
connection master;
|
||||
drop procedure p1;
|
||||
|
@ -78,19 +84,19 @@ end//
|
|||
delimiter ;//
|
||||
|
||||
call p1(f1(1), f1(2));
|
||||
select * from t1;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
|
||||
create table t2(a int);
|
||||
insert into t2 values (10),(11);
|
||||
select a,f1(a) from t2;
|
||||
SELECT a,f1(a) FROM t2 ORDER BY a;
|
||||
|
||||
# This shouldn't put separate 'call f1(3)' into binlog:
|
||||
insert into t2 select f1(3);
|
||||
select 'master:',a from t1;
|
||||
SELECT 'master:',a FROM t1 ORDER BY a;
|
||||
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
select 'slave:',a from t1;
|
||||
SELECT 'slave:',a FROM t1 ORDER BY a;
|
||||
|
||||
connection master;
|
||||
drop procedure p1;
|
||||
|
@ -102,11 +108,11 @@ delete from t1;
|
|||
insert into t2 values(1),(2);
|
||||
create view v1 as select f1(a) from t2;
|
||||
select * from v1;
|
||||
select 'master:',a from t1;
|
||||
SELECT 'master:',a FROM t1 ORDER BY a;
|
||||
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
select 'slave:',a from t1;
|
||||
SELECT 'slave:',a FROM t1 ORDER BY a;
|
||||
|
||||
connection master;
|
||||
drop view v1;
|
||||
|
@ -116,11 +122,11 @@ delete from t1;
|
|||
prepare s1 from 'select f1(?)';
|
||||
set @xx=123;
|
||||
execute s1 using @xx;
|
||||
select 'master:',a from t1;
|
||||
SELECT 'master:',a FROM t1 ORDER BY a;
|
||||
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
select 'slave:',a from t1;
|
||||
SELECT 'slave:',a FROM t1 ORDER BY a;
|
||||
|
||||
connection master;
|
||||
delete from t1;
|
||||
|
@ -140,10 +146,10 @@ begin
|
|||
end//
|
||||
delimiter ;//
|
||||
call p1(15);
|
||||
select 'master:',a from t1;
|
||||
SELECT 'master:',a FROM t1 ORDER BY a;
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
select 'slave:',a from t1;
|
||||
SELECT 'slave:',a FROM t1 ORDER BY a;
|
||||
|
||||
connection master;
|
||||
drop procedure p1;
|
||||
|
@ -188,10 +194,10 @@ select f1();
|
|||
set @x=30;
|
||||
call p1();
|
||||
|
||||
select 'master', a from t1;
|
||||
SELECT 'master', a FROM t1 ORDER BY a;
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
select 'slave', a from t1;
|
||||
SELECT 'slave', a FROM t1 ORDER BY a;
|
||||
|
||||
connection master;
|
||||
drop table t1;
|
||||
|
|
|
@ -6217,10 +6217,10 @@ static int ndbcluster_end(ha_panic_function type)
|
|||
#ifdef HAVE_NDB_BINLOG
|
||||
{
|
||||
pthread_mutex_lock(&ndbcluster_mutex);
|
||||
for (uint i= 0; i < ndbcluster_open_tables.records; i++)
|
||||
while (ndbcluster_open_tables.records)
|
||||
{
|
||||
NDB_SHARE *share=
|
||||
(NDB_SHARE*) hash_element(&ndbcluster_open_tables, i);
|
||||
(NDB_SHARE*) hash_element(&ndbcluster_open_tables, 0);
|
||||
#ifndef DBUG_OFF
|
||||
fprintf(stderr, "NDB: table share %s with use_count %d not freed\n",
|
||||
share->key, share->use_count);
|
||||
|
|
Loading…
Reference in a new issue