Commit 0cddfc08 authored by unknown's avatar unknown
Browse files

Merge perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new

into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb


mysql-test/t/ndb_autodiscover3.test:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
parents b6920c54 4b8d3d32
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -64,17 +64,26 @@ pk u o
insert into t1 values (1,1,1);
drop table t1;
create table t1 (x integer not null primary key, y varchar(32), z integer, key(z)) engine = ndb;
insert into t1 values (1,'one',1), (2,'two',2),(3,"three",3);
insert into t1 values (1,'one',1);
begin;
select * from t1 where x = 1 for update;
x	y	z
1	one	1
begin;
select * from t1 where x = 2 for update;
select * from t1 where x = 1 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
rollback;
rollback;
insert into t1 values (2,'two',2),(3,"three",3);
begin;
select * from t1 where x = 1 for update;
x	y	z
2	two	2
1	one	1
select * from t1 where x = 1 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t1 where x = 2 for update;
x	y	z
2	two	2
rollback;
commit;
begin;
+64 −3
Original line number Diff line number Diff line
@@ -286,10 +286,10 @@ INSERT INTO t1 VALUES
(406990,67,'2006-02-23 18:01:45'),(148815,67,'2005-10-25 15:34:17'),
(148812,67,'2005-10-25 15:30:01'),(245651,67,'2005-12-08 15:58:27'),
(154503,67,'2005-10-28 11:52:38');
create table t11 select * from t1 where b = 67 AND (c IS NULL OR c > NOW()) order by 3 asc;
create table t12 select * from t1 where b = 67 AND (c IS NULL OR c > NOW()) order by 3 desc;
create table t11 engine = ndbcluster select * from t1 where b = 67 AND (c IS NULL OR c > NOW()) order by 3 asc;
create table t12 engine = ndbcluster select * from t1 where b = 67 AND (c IS NULL OR c > NOW()) order by 3 desc;
create table t21 select * from t1 where b = 67 AND (c IS NULL OR c > '2005-12-08') order by 3 asc;
create table t22 select * from t1 where b = 67 AND (c IS NULL OR c > '2005-12-08') order by 3 desc;
create table t22 engine = ndbcluster select * from t1 where b = 67 AND (c IS NULL OR c > '2005-12-08') order by 3 desc;
select * from t11 order by 1,2,3;
a	b	c
254	67	NULL
@@ -366,4 +366,65 @@ a b c
406993	67	2006-02-27 11:20:57
406994	67	2006-02-27 11:26:46
406995	67	2006-02-28 11:55:00
select t12.a from t11, t12 where t11.a in(255,256) and t11.a = t12.a and t11.c is null order by t12.a;
a
255
256
update t22 set c = '2005-12-08 15:58:27' where a = 255;
select * from t22 order by 1,2,3;
a	b	c
1	67	2006-02-23 15:01:35
254	67	NULL
255	67	2005-12-08 15:58:27
256	67	NULL
1120	67	NULL
1133	67	NULL
4101	67	NULL
9199	67	NULL
223456	67	NULL
245651	67	2005-12-08 15:58:27
245652	67	2005-12-08 15:58:27
245653	67	2005-12-08 15:59:07
245654	67	2005-12-08 15:59:08
245655	67	2005-12-08 15:59:08
398340	67	2006-02-20 04:38:53
398341	67	2006-02-20 04:48:44
398545	67	2006-02-20 04:53:13
406631	67	2006-02-23 10:49:42
406988	67	2006-02-23 17:07:22
406989	67	2006-02-23 17:08:46
406990	67	2006-02-23 18:01:45
406991	67	2006-02-24 16:42:32
406992	67	2006-02-24 16:47:18
406993	67	2006-02-27 11:20:57
406994	67	2006-02-27 11:26:46
406995	67	2006-02-28 11:55:00
select t21.* from t21,t22 where t21.a = t22.a and 
t22.a in (select t12.a from t11, t12 where t11.a in(255,256) and t11.a = t12.a and t11.c is null) and t22.c is null order by t21.a;
a	b	c
256	67	NULL
delete from t22 where a > 245651;
update t22 set b = a + 1;
select * from t22 order by 1,2,3;
a	b	c
1	2	2006-02-23 15:01:35
254	255	NULL
255	256	2005-12-08 15:58:27
256	257	NULL
1120	1121	NULL
1133	1134	NULL
4101	4102	NULL
9199	9200	NULL
223456	223457	NULL
245651	245652	2005-12-08 15:58:27
select c, count(*)
from t21 
inner join t22 using (a)
where t22.b in (2,256,257,1121,1134,4102,9200,223457,245652)
group by c
order by c;
c	count(*)
NULL	7
2005-12-08 15:58:27	1
2006-02-23 15:01:35	1
DROP TABLE t1, t11, t12, t21, t22;
+3 −0
Original line number Diff line number Diff line
@@ -2,6 +2,9 @@
-- source include/have_multi_ndb.inc
-- source include/not_embedded.inc

# see bug#21563
-- source include/have_binlog_format_row.inc

--disable_warnings
drop table if exists t1, t2;
--enable_warnings
+13 −2
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ drop table t1;

create table t1 (x integer not null primary key, y varchar(32), z integer, key(z)) engine = ndb;

insert into t1 values (1,'one',1), (2,'two',2),(3,"three",3); 
insert into t1 values (1,'one',1);

# PK access
connection con1;
@@ -82,11 +82,22 @@ select * from t1 where x = 1 for update;

connection con2;
begin;
select * from t1 where x = 2 for update;
--error 1205
select * from t1 where x = 1 for update;
rollback;

connection con1;
rollback;
insert into t1 values (2,'two',2),(3,"three",3); 
begin;
select * from t1 where x = 1 for update;

connection con2;
--error 1205
select * from t1 where x = 1 for update;
select * from t1 where x = 2 for update;
rollback;

connection con1;
commit;

+22 −3
Original line number Diff line number Diff line
@@ -228,13 +228,32 @@ INSERT INTO t1 VALUES
(148812,67,'2005-10-25 15:30:01'),(245651,67,'2005-12-08 15:58:27'),
(154503,67,'2005-10-28 11:52:38');

create table t11 select * from t1 where b = 67 AND (c IS NULL OR c > NOW()) order by 3 asc;
create table t12 select * from t1 where b = 67 AND (c IS NULL OR c > NOW()) order by 3 desc;
create table t11 engine = ndbcluster select * from t1 where b = 67 AND (c IS NULL OR c > NOW()) order by 3 asc;
create table t12 engine = ndbcluster select * from t1 where b = 67 AND (c IS NULL OR c > NOW()) order by 3 desc;
create table t21 select * from t1 where b = 67 AND (c IS NULL OR c > '2005-12-08') order by 3 asc;
create table t22 select * from t1 where b = 67 AND (c IS NULL OR c > '2005-12-08') order by 3 desc;
create table t22 engine = ndbcluster select * from t1 where b = 67 AND (c IS NULL OR c > '2005-12-08') order by 3 desc;

select * from t11 order by 1,2,3;
select * from t12 order by 1,2,3;
select * from t21 order by 1,2,3;
select * from t22 order by 1,2,3;

# join tests
select t12.a from t11, t12 where t11.a in(255,256) and t11.a = t12.a and t11.c is null order by t12.a;

update t22 set c = '2005-12-08 15:58:27' where a = 255;
select * from t22 order by 1,2,3;
select t21.* from t21,t22 where t21.a = t22.a and 
t22.a in (select t12.a from t11, t12 where t11.a in(255,256) and t11.a = t12.a and t11.c is null) and t22.c is null order by t21.a;

delete from t22 where a > 245651;
update t22 set b = a + 1;
select * from t22 order by 1,2,3;
select c, count(*)
from t21 
inner join t22 using (a)
where t22.b in (2,256,257,1121,1134,4102,9200,223457,245652)
group by c
order by c;

DROP TABLE t1, t11, t12, t21, t22;
Loading