Below is the list of changes that have just been committed into a local
5.1 repository of ksm. When ksm 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@stripped, 2006-12-17 23:08:04+03:00, skozlov@stripped +12 -0
WL#2862
mysql-test/r/ndb_alter_table.result@stripped, 2006-12-17 23:07:59+03:00, skozlov@stripped +45 -0
WL#2862
mysql-test/r/ndb_basic.result@stripped, 2006-12-17 23:08:00+03:00, skozlov@stripped +76 -0
WL#2862
mysql-test/r/ndb_cursor.result@stripped, 2006-12-17 23:08:00+03:00, skozlov@stripped +39 -0
WL#2862
mysql-test/r/ndb_cursor.result@stripped, 2006-12-17 23:08:00+03:00, skozlov@stripped +0 -0
mysql-test/r/ndb_sp.result@stripped, 2006-12-17 23:08:00+03:00, skozlov@stripped +45 -0
WL#2862
mysql-test/r/ndb_sp.result@stripped, 2006-12-17 23:08:00+03:00, skozlov@stripped +0 -0
mysql-test/r/ndb_subquery.result@stripped, 2006-12-17 23:08:00+03:00, skozlov@stripped +35 -4
WL#2862
mysql-test/r/ndb_trigger.result@stripped, 2006-12-17 23:08:00+03:00, skozlov@stripped +28 -3
WL#2862
mysql-test/t/ndb_alter_table.test@stripped, 2006-12-17 23:08:00+03:00, skozlov@stripped +27 -0
WL#2862
mysql-test/t/ndb_basic.test@stripped, 2006-12-17 23:08:00+03:00, skozlov@stripped +53 -0
WL#2862
mysql-test/t/ndb_cursor.test@stripped, 2006-12-17 23:08:00+03:00, skozlov@stripped +46 -0
WL#2862
mysql-test/t/ndb_cursor.test@stripped, 2006-12-17 23:08:00+03:00, skozlov@stripped +0 -0
mysql-test/t/ndb_sp.test@stripped, 2006-12-17 23:08:00+03:00, skozlov@stripped +43 -0
WL#2862
mysql-test/t/ndb_sp.test@stripped, 2006-12-17 23:08:00+03:00, skozlov@stripped +0 -0
mysql-test/t/ndb_subquery.test@stripped, 2006-12-17 23:08:00+03:00, skozlov@stripped +14 -4
WL#2862
mysql-test/t/ndb_trigger.test@stripped, 2006-12-17 23:08:00+03:00, skozlov@stripped +26 -4
WL#2862
# 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: skozlov
# Host: virtop.localdomain
# Root: /space/skozlov/5.1-new-ndb-addfunc
--- 1.1/mysql-test/r/ndb_trigger.result 2006-12-17 23:08:14 +03:00
+++ 1.2/mysql-test/r/ndb_trigger.result 2006-12-17 23:08:14 +03:00
@@ -1,7 +1,9 @@
-drop table if exists t1, t2, t3;
+drop table if exists t1, t2, t3, t4, t5;
create table t1 (id int primary key, a int not null, b decimal (63,30) default 0) engine=ndb;
create table t2 (op char(1), a int not null, b decimal (63,30));
create table t3 select 1 as i;
+create table t4 (a int not null primary key, b int) engine=ndb;
+create table t5 (a int not null primary key, b int) engine=ndb;
create trigger t1_bu before update on t1 for each row
begin
insert into t2 values ("u", old.a, old.b);
@@ -11,7 +13,19 @@
begin
insert into t2 values ("d", old.a, old.b);
end;//
+create trigger t4_au after update on t4
+for each row begin
+update t5 set b = b+1;
+end;
+//
+create trigger t4_ad after delete on t4
+for each row begin
+update t5 set b = b+1;
+end;
+//
insert into t1 values (1, 1, 1.05), (2, 2, 2.05), (3, 3, 3.05), (4, 4, 4.05);
+insert into t4 values (1,1), (2,2), (3,3), (4, 4);
+insert into t5 values (1,0);
update t1 set a=5 where a != 3;
select * from t1 order by id;
id a b
@@ -115,5 +129,16 @@
op a b
d 1 1.050000000000000000000000000000
d 2 2.050000000000000000000000000000
-drop tables t1, t2, t3;
-End of 5.0 tests
+update t4 set b = 10 where a = 1;
+select * from t5 order by a;
+a b
+1 1
+update t5 set b = 0;
+delete from t4 where a = 1;
+select * from t5 order by a;
+a b
+1 1
+drop trigger t4_au;
+drop trigger t4_ad;
+drop table t1, t2, t3, t4, t5;
+End of 5.1 tests
--- 1.1/mysql-test/t/ndb_trigger.test 2006-12-17 23:08:14 +03:00
+++ 1.2/mysql-test/t/ndb_trigger.test 2006-12-17 23:08:14 +03:00
@@ -14,13 +14,15 @@
#
--disable_warnings
-drop table if exists t1, t2, t3;
+drop table if exists t1, t2, t3, t4, t5;
--enable_warnings
create table t1 (id int primary key, a int not null, b decimal (63,30) default 0) engine=ndb;
create table t2 (op char(1), a int not null, b decimal (63,30));
create table t3 select 1 as i;
-
+create table t4 (a int not null primary key, b int) engine=ndb;
+create table t5 (a int not null primary key, b int) engine=ndb;
+
delimiter //;
create trigger t1_bu before update on t1 for each row
begin
@@ -31,8 +33,21 @@
begin
insert into t2 values ("d", old.a, old.b);
end;//
+create trigger t4_au after update on t4
+ for each row begin
+ update t5 set b = b+1;
+ end;
+//
+create trigger t4_ad after delete on t4
+ for each row begin
+ update t5 set b = b+1;
+ end;
+//
delimiter ;//
+
insert into t1 values (1, 1, 1.05), (2, 2, 2.05), (3, 3, 3.05), (4, 4, 4.05);
+insert into t4 values (1,1), (2,2), (3,3), (4, 4);
+insert into t5 values (1,0);
# Check that usual update works as it should
update t1 set a=5 where a != 3;
@@ -86,7 +101,14 @@
load data infile '../std_data_ln/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (id, a);
select * from t1 order by id;
select * from t2 order by op, a, b;
+update t4 set b = 10 where a = 1;
+select * from t5 order by a;
+update t5 set b = 0;
+delete from t4 where a = 1;
+select * from t5 order by a;
+drop trigger t4_au;
+drop trigger t4_ad;
-drop tables t1, t2, t3;
+drop table t1, t2, t3, t4, t5;
---echo End of 5.0 tests
+--echo End of 5.1 tests
--- 1.39/mysql-test/r/ndb_alter_table.result 2006-12-17 23:08:14 +03:00
+++ 1.40/mysql-test/r/ndb_alter_table.result 2006-12-17 23:08:14 +03:00
@@ -354,3 +354,48 @@
a b c
12 403 NULL
drop table t1;
+create table t1 (a int not null, b varchar(10)) engine=ndb;
+show index from t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+alter table t1 add primary key (a);
+show index from t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+t1 0 PRIMARY 1 a A 0 NULL NULL BTREE
+alter table t1 drop primary key;
+show index from t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+drop table t1;
+create table t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ `b` int(11) NOT NULL DEFAULT '0',
+ `c` varchar(254) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+alter table t1 alter b set default 1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ `b` int(11) NOT NULL DEFAULT '1',
+ `c` varchar(254) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 (a int not null, b int not null) engine=ndb;
+insert into t1 values (1, 300), (2, 200), (3, 100);
+select * from t1;
+a b
+3 100
+2 200
+1 300
+alter table t1 order by b;
+select * from t1;
+a b
+1 300
+2 200
+3 100
+drop table t1;
+End of 5.1 tests
--- 1.47/mysql-test/r/ndb_basic.result 2006-12-17 23:08:14 +03:00
+++ 1.48/mysql-test/r/ndb_basic.result 2006-12-17 23:08:14 +03:00
@@ -773,4 +773,80 @@
2 2
3 3
drop table t1, t2;
+create table t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb;
+create table if not exists t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb;
+create table t2 like t1;
+rename table t1 to t10, t2 to t20;
+drop table t10,t20;
+create table t1 (a int not null primary key, b int not null) engine=ndb;
+create table t2 (a int not null primary key, b int not null) engine=ndb;
+insert into t1 values (1,10), (2,20), (3,30);
+insert into t2 values (1,10), (2,20), (3,30);
+select * from t1 order by a;
+a b
+1 10
+2 20
+3 30
+delete from t1 where a > 0 order by a desc limit 1;
+select * from t1 order by a;
+a b
+1 10
+2 20
+delete from t1,t2 using t1,t2 where t1.a = t2.a;
+select * from t2 order by a;
+a b
+3 30
+drop table t1,t2;
+create table t1 (a int not null primary key, b int not null) engine=ndb;
+insert into t1 values (1,10), (2,20), (3,30);
+insert into t1 set a=1, b=100;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+insert ignore into t1 set a=1, b=100;
+select * from t1 order by a;
+a b
+1 10
+2 20
+3 30
+insert into t1 set a=1, b=1000 on duplicate key update b=b+1;
+select * from t1 order by a;
+a b
+1 11
+2 20
+3 30
+drop table t1;
+create table t1 (a int not null primary key, b int not null) engine=ndb;
+create table t2 (c int not null primary key, d int not null) engine=ndb;
+insert into t1 values (1,10), (2,10), (3,30), (4, 30);
+insert into t2 values (1,10), (2,10), (3,30), (4, 30);
+update t1 set a = 1 where a = 3;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+select * from t1 order by a;
+a b
+1 10
+2 10
+3 30
+4 30
+update t1 set b = 1 where a > 1 order by a desc limit 1;
+select * from t1 order by a;
+a b
+1 10
+2 10
+3 30
+4 1
+update t1,t2 set a = 1, c = 1 where a = 3 and c = 3;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+select * from t1 order by a;
+a b
+1 10
+2 10
+3 30
+4 1
+update ignore t1,t2 set a = 1, c = 1 where a = 3 and c = 3;
+select * from t1 order by a;
+a b
+1 10
+2 10
+3 1
+4 1
+drop table t1,t2;
End of 5.1 tests
--- 1.35/mysql-test/t/ndb_alter_table.test 2006-12-17 23:08:14 +03:00
+++ 1.36/mysql-test/t/ndb_alter_table.test 2006-12-17 23:08:14 +03:00
@@ -410,3 +410,30 @@
insert into t1 (b) values (401),(402),(403);
select * from t1 where a = 12;
drop table t1;
+
+# some other ALTER combinations
+# add/drop pk
+create table t1 (a int not null, b varchar(10)) engine=ndb;
+show index from t1;
+alter table t1 add primary key (a);
+show index from t1;
+alter table t1 drop primary key;
+show index from t1;
+drop table t1;
+
+# alter .. alter
+create table t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb;
+show create table t1;
+alter table t1 alter b set default 1;
+show create table t1;
+drop table t1;
+
+# alter .. order by
+create table t1 (a int not null, b int not null) engine=ndb;
+insert into t1 values (1, 300), (2, 200), (3, 100);
+select * from t1;
+alter table t1 order by b;
+select * from t1;
+drop table t1;
+
+--echo End of 5.1 tests
--- 1.46/mysql-test/t/ndb_basic.test 2006-12-17 23:08:14 +03:00
+++ 1.47/mysql-test/t/ndb_basic.test 2006-12-17 23:08:14 +03:00
@@ -747,4 +747,57 @@
select * from t2 order by a;
drop table t1, t2;
+# create table if not exists
+--disable_warnings
+create table t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb;
+create table if not exists t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb;
+--enable_warnings
+
+# create like
+create table t2 like t1;
+
+# multi rename
+rename table t1 to t10, t2 to t20;
+drop table t10,t20;
+
+# delete
+create table t1 (a int not null primary key, b int not null) engine=ndb;
+create table t2 (a int not null primary key, b int not null) engine=ndb;
+insert into t1 values (1,10), (2,20), (3,30);
+insert into t2 values (1,10), (2,20), (3,30);
+select * from t1 order by a;
+delete from t1 where a > 0 order by a desc limit 1;
+select * from t1 order by a;
+delete from t1,t2 using t1,t2 where t1.a = t2.a;
+select * from t2 order by a;
+drop table t1,t2;
+
+# insert ignore
+create table t1 (a int not null primary key, b int not null) engine=ndb;
+insert into t1 values (1,10), (2,20), (3,30);
+--error 1062
+insert into t1 set a=1, b=100;
+insert ignore into t1 set a=1, b=100;
+select * from t1 order by a;
+insert into t1 set a=1, b=1000 on duplicate key update b=b+1;
+select * from t1 order by a;
+drop table t1;
+
+# update
+create table t1 (a int not null primary key, b int not null) engine=ndb;
+create table t2 (c int not null primary key, d int not null) engine=ndb;
+insert into t1 values (1,10), (2,10), (3,30), (4, 30);
+insert into t2 values (1,10), (2,10), (3,30), (4, 30);
+--error 1062
+update t1 set a = 1 where a = 3;
+select * from t1 order by a;
+update t1 set b = 1 where a > 1 order by a desc limit 1;
+select * from t1 order by a;
+--error 1062
+update t1,t2 set a = 1, c = 1 where a = 3 and c = 3;
+select * from t1 order by a;
+update ignore t1,t2 set a = 1, c = 1 where a = 3 and c = 3;
+select * from t1 order by a;
+drop table t1,t2;
+
--echo End of 5.1 tests
--- New file ---
+++ mysql-test/r/ndb_cursor.result 06/12/17 23:08:00
drop table if exists t1;
drop table if exists t2;
create table t1 (
a int not null primary key,
b int not null
) engine=ndb;
create table t2 (
a int not null primary key,
b int not null
) engine=ndb;
insert into t1 values (1,10), (2,20), (3,30), (4, 40);
create procedure test_cursor ()
begin
declare done int default 0;
declare temp_a int;
declare temp_b int;
declare cur1 cursor for select a,b from t1;
declare continue handler for sqlstate '02000' set done = 1;
open cur1;
repeat
fetch cur1 into temp_a, temp_b;
if not done then
insert into t2 values (temp_a, temp_b);
end if;
until done end repeat;
close cur1;
end;
//
select * from t2 order by a;
a b
call test_cursor();
select * from t2 order by a;
a b
1 10
2 20
3 30
4 40
drop table t1,t2;
end of 5.1 tests
--- New file ---
+++ mysql-test/r/ndb_sp.result 06/12/17 23:08:00
drop table if exists t1;
drop table if exists t2;
create table t1 (
a int not null primary key,
b int not null
) engine=ndb;
insert into t1 values (1,10), (2,20), (3,100), (4, 100);
create procedure test_proc1 (in var_in int)
begin
select * from t1 where a = var_in;
end;
create procedure test_proc2 (out var_out int)
begin
select b from t1 where a = 1 into var_out;
end;
create procedure test_proc3 (inout var_inout int)
begin
select b from t1 where a = var_inout into var_inout;
end;
//
call test_proc1(1);
a b
1 10
call test_proc2(@test_var);
select @test_var;
@test_var
10
set @test_var = 1;
call test_proc3(@test_var);
select @test_var;
@test_var
10
alter procedure test_proc1 comment 'new comment';
show create procedure test_proc1;
Procedure sql_mode Create Procedure
test_proc1 CREATE DEFINER=`root`@`localhost` PROCEDURE `test_proc1`(in var_in int)
COMMENT 'new comment'
begin
select * from t1 where a = var_in;
end
drop procedure test_proc1;
drop procedure test_proc2;
drop procedure test_proc3;
drop table t1;
End of 5.1 tests
--- New file ---
+++ mysql-test/t/ndb_cursor.test 06/12/17 23:08:00
-- source include/have_ndb.inc
-- source include/not_embedded.inc
--disable_warnings
drop table if exists t1;
drop table if exists t2;
--enable_warnings
create table t1 (
a int not null primary key,
b int not null
) engine=ndb;
create table t2 (
a int not null primary key,
b int not null
) engine=ndb;
insert into t1 values (1,10), (2,20), (3,30), (4, 40);
delimiter //;
create procedure test_cursor ()
begin
declare done int default 0;
declare temp_a int;
declare temp_b int;
declare cur1 cursor for select a,b from t1;
declare continue handler for sqlstate '02000' set done = 1;
open cur1;
repeat
fetch cur1 into temp_a, temp_b;
if not done then
insert into t2 values (temp_a, temp_b);
end if;
until done end repeat;
close cur1;
end;
//
delimiter ;//
select * from t2 order by a;
call test_cursor();
select * from t2 order by a;
drop table t1,t2;
--echo end of 5.1 tests
--- New file ---
+++ mysql-test/t/ndb_sp.test 06/12/17 23:08:00
-- source include/have_ndb.inc
-- source include/not_embedded.inc
--disable_warnings
drop table if exists t1;
drop table if exists t2;
--enable_warnings
create table t1 (
a int not null primary key,
b int not null
) engine=ndb;
insert into t1 values (1,10), (2,20), (3,100), (4, 100);
delimiter //;
create procedure test_proc1 (in var_in int)
begin
select * from t1 where a = var_in;
end;
create procedure test_proc2 (out var_out int)
begin
select b from t1 where a = 1 into var_out;
end;
create procedure test_proc3 (inout var_inout int)
begin
select b from t1 where a = var_inout into var_inout;
end;
//
delimiter ;//
call test_proc1(1);
call test_proc2(@test_var);
select @test_var;
set @test_var = 1;
call test_proc3(@test_var);
select @test_var;
alter procedure test_proc1 comment 'new comment';
show create procedure test_proc1;
drop procedure test_proc1;
drop procedure test_proc2;
drop procedure test_proc3;
drop table t1;
--echo End of 5.1 tests
--- 1.4/mysql-test/r/ndb_subquery.result 2006-12-17 23:08:14 +03:00
+++ 1.5/mysql-test/r/ndb_subquery.result 2006-12-17 23:08:14 +03:00
@@ -1,11 +1,14 @@
-drop table if exists t1;
-drop table if exists t2;
+drop table if exists t1, t2, t3, t4;
create table t1 (p int not null primary key, u int not null, o int not null,
unique (u), key(o)) engine=ndb;
create table t2 (p int not null primary key, u int not null, o int not null,
unique (u), key(o)) engine=ndb;
+create table t3 (a int not null primary key, b int not null) engine=ndb;
+create table t4 (c int not null primary key, d int not null) engine=ndb;
insert into t1 values (1,1,1),(2,2,2),(3,3,3);
insert into t2 values (1,1,1),(2,2,2),(3,3,3), (4,4,4), (5,5,5);
+insert into t3 values (1,10), (2,10), (3,30), (4, 30);
+insert into t4 values (1,10), (2,10), (3,30), (4, 30);
explain select * from t2 where p NOT IN (select p from t1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL # Using where
@@ -57,5 +60,33 @@
1 1
2 2
3 3
-drop table t1;
-drop table t2;
+select * from t3 where a = any (select c from t4 where c = 1) order by a;
+a b
+1 10
+select * from t3 where a in (select c from t4 where c = 1) order by a;
+a b
+1 10
+select * from t3 where a <> some (select c from t4 where c = 1) order by a;
+a b
+2 10
+3 30
+4 30
+select * from t3 where a > all (select c from t4 where c = 1) order by a;
+a b
+2 10
+3 30
+4 30
+select * from t3 where row(1,10) = (select c,d from t4 where c = 1) order by a;
+a b
+1 10
+2 10
+3 30
+4 30
+select * from t3 where exists (select * from t4 where c = 1) order by a;
+a b
+1 10
+2 10
+3 30
+4 30
+drop table if exists t1, t2, t3, t4;
+End of 5.1 tests
--- 1.6/mysql-test/t/ndb_subquery.test 2006-12-17 23:08:14 +03:00
+++ 1.7/mysql-test/t/ndb_subquery.test 2006-12-17 23:08:14 +03:00
@@ -2,8 +2,7 @@
-- source include/not_embedded.inc
--disable_warnings
-drop table if exists t1;
-drop table if exists t2;
+drop table if exists t1, t2, t3, t4;
--enable_warnings
##########
@@ -14,8 +13,13 @@
create table t2 (p int not null primary key, u int not null, o int not null,
unique (u), key(o)) engine=ndb;
+create table t3 (a int not null primary key, b int not null) engine=ndb;
+create table t4 (c int not null primary key, d int not null) engine=ndb;
+
insert into t1 values (1,1,1),(2,2,2),(3,3,3);
insert into t2 values (1,1,1),(2,2,2),(3,3,3), (4,4,4), (5,5,5);
+insert into t3 values (1,10), (2,10), (3,30), (4, 30);
+insert into t4 values (1,10), (2,10), (3,30), (4, 30);
# Use pk
--replace_column 9 #
@@ -63,7 +67,13 @@
select * from t2 order by 1;
-drop table t1;
-drop table t2;
+select * from t3 where a = any (select c from t4 where c = 1) order by a;
+select * from t3 where a in (select c from t4 where c = 1) order by a;
+select * from t3 where a <> some (select c from t4 where c = 1) order by a;
+select * from t3 where a > all (select c from t4 where c = 1) order by a;
+select * from t3 where row(1,10) = (select c,d from t4 where c = 1) order by a;
+select * from t3 where exists (select * from t4 where c = 1) order by a;
+drop table if exists t1, t2, t3, t4;
+--echo End of 5.1 tests
| Thread |
|---|
| • bk commit into 5.1 tree (skozlov:1.2368) | Serge Kozlov | 17 Dec |