Commit 002d7efa authored by unknown's avatar unknown
Browse files

Merge kboortz@bk-internal.mysql.com:/home/bk/mysql-5.1

into  mysql.com:/home/kent/bk/main/mysql-5.1


sql/ha_ndbcluster_binlog.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
storage/ndb/include/kernel/signaldata/Extent.hpp:
  Auto merged
storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/diskpage.hpp:
  Auto merged
storage/ndb/src/kernel/blocks/lgman.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/print_file.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/tsman.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/tsman.hpp:
  Auto merged
storage/ndb/ndbapi-examples/mgmapi_logevent2/mgmapi_logevent2.cpp:
  Auto merged
parents 3099886c 0968cc9d
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -95,6 +95,14 @@ enum ha_key_alg {
  HA_KEY_ALG_FULLTEXT=	4		/* FULLTEXT (MyISAM tables) */
};

        /* Storage media types */ 

enum ha_storage_media {
  HA_SM_DEFAULT=        0,		/* Not specified (engine default) */
  HA_SM_DISK=           1,		/* DISK storage */
  HA_SM_MEMORY=         2		/* MAIN MEMORY storage */
};

	/* The following is parameter to ha_extra() */

enum ha_extra_function {
+45 −0
Original line number Diff line number Diff line
@@ -354,3 +354,48 @@ select * from t1 where a = 12;
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 order by a;
a	b
1	300
2	200
3	100
alter table t1 order by b;
select * from t1 order by b;
a	b
3	100
2	200
1	300
drop table t1;
End of 5.1 tests
+76 −0
Original line number Diff line number Diff line
@@ -773,4 +773,80 @@ a b
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 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ show binlog events from <binlog_start>;
Log_name	Pos	Event_type	Server_id	End_log_pos	Info
master-bin.000001	#	Query	#	#	BEGIN
master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
master-bin.000001	#	Table_map	#	#	table_id: # (mysql.apply_status)
master-bin.000001	#	Table_map	#	#	table_id: # (mysql.ndb_apply_status)
master-bin.000001	#	Write_rows	#	#	table_id: #
master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
master-bin.000001	#	Query	#	#	COMMIT
+40 −0
Original line number Diff line number Diff line
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 procedure test_cursor;
drop table t1,t2;
end of 5.1 tests
Loading