Commit 7355e7d5 authored by unknown's avatar unknown
Browse files

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

into  mysql.com:/home/ndbdev/jmiller/clones/mysql-5.1-new

parents db122ce4 bbed1ba9
Loading
Loading
Loading
Loading
+127 −119
Original line number Diff line number Diff line
@@ -4,21 +4,23 @@ ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE 16M
UNDO_BUFFER_SIZE = 1M
ENGINE=NDB;
alter logfile group lg1
add undofile 'undofile02.dat'
initial_size 4M engine=ndb;
ALTER LOGFILE GROUP lg1
ADD UNDOFILE 'undofile02.dat'
INITIAL_SIZE = 4M 
ENGINE=NDB;
CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE 12M
ENGINE NDB;
alter tablespace ts1
add datafile 'datafile02.dat'
initial_size 4M engine=ndb;
ALTER TABLESPACE ts1
ADD DATAFILE 'datafile02.dat'
INITIAL_SIZE = 4M 
ENGINE=NDB;
CREATE TABLE t1
(pk1 int not null primary key, b int not null, c int not null)
tablespace ts1 storage disk
engine ndb;
(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
TABLESPACE ts1 STORAGE DISK
ENGINE=NDB;
INSERT INTO t1 VALUES (0, 0, 0);
SELECT * FROM t1;
pk1	b	c
@@ -130,225 +132,225 @@ COUNT(*)
CREATE LOGFILE GROUP lg2
ADD UNDOFILE 'x.dat'
INITIAL_SIZE 10y
engine = ndb;
ENGINE = NDB;
ERROR HY000: A size parameter was incorrectly specified, either number or on the form 10M
CREATE LOGFILE GROUP lg2
ADD UNDOFILE 'x.dat'
INITIAL_SIZE 10MB
engine=ndb;
ENGINE = NDB;
ERROR HY000: A size parameter was incorrectly specified, either number or on the form 10M
CREATE LOGFILE GROUP lg2
ADD UNDOFILE 'x.dat'
INITIAL_SIZE 10 MB
engine=ndb;
ENGINE = NDB;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MB
engine=ndb' at line 3
ENGINE = NDB' at line 3
CREATE LOGFILE GROUP lg2
ADD UNDOFILE 'x.dat'
INITIAL_SIZE 10 M
engine=ndb;
ENGINE = NDB;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'M
engine=ndb' at line 3
ENGINE = NDB' at line 3
CREATE LOGFILE GROUP lg2
ADD UNDOFILE 'x.dat'
INITIAL_SIZE 1000000000000K
engine=ndb;
ENGINE = NDB;
ERROR HY000: The size number was correct but we don't allow the digit part to be more than 2 billion
DROP TABLE t1;
create table t1 (a int primary key, b char(4) not null, c char(4) not null, key(b)) tablespace ts1 storage disk engine ndb;
insert into t1 values (1,'1','1'), (2,'2','2'), (3,'3','3');
begin;
update t1 set b = '2' where a = 1;
select b from t1 where a = 1;
CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(4) NOT NULL, c CHAR(4) NOT NULL, KEY(b)) TABLESPACE ts1 STORAGE DISK ENGINE = NDB;
INSERT INTO t1 VALUES (1,'1','1'), (2,'2','2'), (3,'3','3');
BEGIN;
UPDATE t1 SET b = '2' WHERE a = 1;
SELECT b FROM t1 WHERE a = 1;
b
2
select * from t1 where a = 1;
SELECT * FROM t1 WHERE a = 1;
a	b	c
1	2	1
update t1 set c = '2' where a = 1;
select b from t1 where a = 1;
UPDATE t1 SET c = '2' WHERE a = 1;
SELECT b FROM t1 WHERE a = 1;
b
2
select * from t1 where a = 1;
SELECT * FROM t1 WHERE a = 1;
a	b	c
1	2	2
update t1 set b = '3' where a = 1;
select b from t1 where a = 1;
UPDATE t1 SET b = '3' WHERE a = 1;
SELECT b FROM t1 WHERE a = 1;
b
3
select * from t1 where a = 1;
SELECT * FROM t1 WHERE a = 1;
a	b	c
1	3	2
commit;
select * from t1 order by 1;
COMMIT;
SELECT * FROM t1 ORDER BY 1;
a	b	c
1	3	2
2	2	2
3	3	3
begin;
update t1 set c = '3' where a = 1;
select b from t1 where a = 1;
BEGIN;
UPDATE t1 SET c = '3' WHERE a = 1;
SELECT b FROM t1 WHERE a = 1;
b
3
select * from t1 where a = 1;
SELECT * FROM t1 WHERE a = 1;
a	b	c
1	3	3
update t1 set b = '4' where a = 1;
select b from t1 where a = 1;
UPDATE t1 SET b = '4' WHERE a = 1;
SELECT b FROM t1 WHERE a = 1;
b
4
select * from t1 where a = 1;
SELECT * FROM t1 WHERE a = 1;
a	b	c
1	4	3
update t1 set c = '4' where a = 1;
select b from t1 where a = 1;
UPDATE t1 SET c = '4' WHERE a = 1;
SELECT b FROM t1 WHERE a = 1;
b
4
select * from t1 where a = 1;
SELECT * FROM t1 WHERE a = 1;
a	b	c
1	4	4
commit;
select * from t1 order by 1;
COMMIT;
SELECT * FROM t1 ORDER BY 1;
a	b	c
1	4	4
2	2	2
3	3	3
update t1 set b = '5' where a = 1;
select * from t1 order by 1;
UPDATE t1 SET b = '5' WHERE a = 1;
SELECT * FROM t1 ORDER BY 1;
a	b	c
1	5	4
2	2	2
3	3	3
update t1 set b = '6'  where b = '5';
select * from t1 order by 1;
UPDATE t1 SET b = '6' WHERE b = '5';
SELECT * FROM t1 ORDER BY 1;
a	b	c
1	6	4
2	2	2
3	3	3
update t1 set b = '7'  where c = '4';
select * from t1 order by 1;
UPDATE t1 SET b = '7'WHERE c = '4';
SELECT * FROM t1 ORDER BY 1;
a	b	c
1	7	4
2	2	2
3	3	3
update t1 set c = '5' where a = 1;
select * from t1 order by 1;
UPDATE t1 SET c = '5' WHERE a = 1;
SELECT * FROM t1 ORDER BY 1;
a	b	c
1	7	5
2	2	2
3	3	3
update t1 set c = '6'  where b = '7';
select * from t1 order by 1;
UPDATE t1 SET c = '6' WHERE b = '7';
SELECT * FROM t1 ORDER BY 1;
a	b	c
1	7	6
2	2	2
3	3	3
update t1 set c = '7'  where c = '6';
select * from t1 order by 1;
UPDATE t1 SET c = '7' WHERE c = '6';
SELECT * FROM t1 ORDER BY 1;
a	b	c
1	7	7
2	2	2
3	3	3
drop table t1;
create table t1 (a int primary key, b varchar(4) not null, c char(4) not null, key(b)) tablespace ts1 storage disk engine ndb;
insert into t1 values (1,'1','1'), (2,'2','2'), (3,'3','3');
begin;
update t1 set b = '2' where a = 1;
select b from t1 where a = 1;
DROP TABLE t1;
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(4) NOT NULL, c CHAR(4) NOT NULL, KEY(b)) TABLESPACE ts1 STORAGE DISK ENGINE NDB;
INSERT INTO t1 VALUE (1,'1','1'), (2,'2','2'), (3,'3','3');
BEGIN;
UPDATE t1 SET b = '2' WHERE a = 1;
SELECT b FROM t1 WHERE a = 1;
b
2
select * from t1 where a = 1;
SELECT * FROM t1 WHERE a = 1;
a	b	c
1	2	1
update t1 set c = '2' where a = 1;
select b from t1 where a = 1;
UPDATE t1 SET c = '2' WHERE a = 1;
SELECT b FROM t1 WHERE a = 1;
b
2
select * from t1 where a = 1;
SELECT * FROM t1 WHERE a = 1;
a	b	c
1	2	2
update t1 set b = '3' where a = 1;
select b from t1 where a = 1;
UPDATE t1 SET b = '3' WHERE a = 1;
SELECT b FROM t1 WHERE a = 1;
b
3
select * from t1 where a = 1;
SELECT * FROM t1 WHERE a = 1;
a	b	c
1	3	2
commit;
select * from t1 order by 1;
COMMIT;
SELECT * FROM t1 ORDER BY 1;
a	b	c
1	3	2
2	2	2
3	3	3
begin;
update t1 set c = '3' where a = 1;
select b from t1 where a = 1;
BEGIN;
UPDATE t1 SET c = '3' WHERE a = 1;
SELECT b FROM t1 WHERE a = 1;
b
3
select * from t1 where a = 1;
SELECT * FROM t1 WHERE a = 1;
a	b	c
1	3	3
update t1 set b = '4' where a = 1;
select b from t1 where a = 1;
UPDATE t1 SET b = '4' WHERE a = 1;
SELECT b FROM t1 WHERE a = 1;
b
4
select * from t1 where a = 1;
SELECT * FROM t1 WHERE a = 1;
a	b	c
1	4	3
update t1 set c = '4' where a = 1;
select b from t1 where a = 1;
UPDATE t1 SET c = '4' WHERE a = 1;
SELECT b FROM t1 WHERE a = 1;
b
4
select * from t1 where a = 1;
SELECT * FROM t1 WHERE a = 1;
a	b	c
1	4	4
commit;
select * from t1 order by 1;
COMMIT;
SELECT * FROM t1 ORDER BY 1;
a	b	c
1	4	4
2	2	2
3	3	3
update t1 set b = '5' where a = 1;
select * from t1 order by 1;
UPDATE t1 SET b = '5' WHERE a = 1;
SELECT * FROM t1 ORDER BY 1;
a	b	c
1	5	4
2	2	2
3	3	3
update t1 set b = '6'  where b = '5';
select * from t1 order by 1;
UPDATE t1 SET b = '6' WHERE b = '5';
SELECT * FROM t1 ORDER BY 1;
a	b	c
1	6	4
2	2	2
3	3	3
update t1 set b = '7'  where c = '4';
select * from t1 order by 1;
UPDATE t1 SET b = '7' WHERE c = '4';
SELECT * FROM t1 ORDER BY 1;
a	b	c
1	7	4
2	2	2
3	3	3
update t1 set c = '5' where a = 1;
select * from t1 order by 1;
UPDATE t1 SET c = '5' WHERE a = 1;
SELECT * FROM t1 ORDER BY 1;
a	b	c
1	7	5
2	2	2
3	3	3
update t1 set c = '6'  where b = '7';
select * from t1 order by 1;
UPDATE t1 SET c = '6' WHERE b = '7';
SELECT * FROM t1 ORDER BY 1;
a	b	c
1	7	6
2	2	2
3	3	3
update t1 set c = '7'  where c = '6';
select * from t1 order by 1;
UPDATE t1 SET c = '7' WHERE c = '6';
SELECT * FROM t1 ORDER BY 1;
a	b	c
1	7	7
2	2	2
3	3	3
drop table t1;
create table t1 (
a int not null primary key,
b text not null
) tablespace ts1 storage disk engine=ndbcluster;
DROP TABLE t1;
CREATE TABLE t1 (
a INT NOT NULL PRIMARY KEY,
b TEXT NOT NULL
) TABLESPACE ts1 STORAGE DISK ENGINE=NDBCLUSTER;
set @x0 = '01234567012345670123456701234567';
set @x0 = concat(@x0,@x0,@x0,@x0,@x0,@x0,@x0,@x0);
set @b1 = 'b1';
@@ -361,37 +363,43 @@ set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
insert into t1 values(1,@b1);
insert into t1 values(2,@b2);
select a,length(b),substr(b,1+2*900,2) from t1 where a=1;
INSERT INTO t1 VALUES(1,@b1);
INSERT INTO t1 VALUES(2,@b2);
SELECT a,length(b),substr(b,1+2*900,2) FROM t1 WHERE a=1;
a	length(b)	substr(b,1+2*900,2)
1	2256	b1
select a,length(b),substr(b,1+2*9000,2) from t1 where a=2;
SELECT a,length(b),substr(b,1+2*9000,2) FROM t1 WHERE a=2;
a	length(b)	substr(b,1+2*9000,2)
2	20000	b2
update t1 set b=@b2 where a=1;
update t1 set b=@b1 where a=2;
select a,length(b),substr(b,1+2*9000,2) from t1 where a=1;
UPDATE t1 SET b=@b2 WHERE a=1;
UPDATE t1 SET b=@b1 WHERE a=2;
SELECT a,length(b),substr(b,1+2*9000,2) FROM t1 WHERE a=1;
a	length(b)	substr(b,1+2*9000,2)
1	20000	b2
select a,length(b),substr(b,1+2*900,2) from t1 where a=2;
SELECT a,length(b),substr(b,1+2*900,2) FROM t1 WHERE a=2;
a	length(b)	substr(b,1+2*900,2)
2	2256	b1
update t1 set b=concat(b,b) where a=1;
update t1 set b=concat(b,b) where a=2;
select a,length(b),substr(b,1+4*9000,2) from t1 where a=1;
UPDATE t1 SET b=concat(b,b) WHERE a=1;
UPDATE t1 SET b=concat(b,b) WHERE a=2;
SELECT a,length(b),substr(b,1+4*9000,2) FROM t1 WHERE a=1;
a	length(b)	substr(b,1+4*9000,2)
1	40000	b2
select a,length(b),substr(b,1+4*900,2) from t1 where a=2;
SELECT a,length(b),substr(b,1+4*900,2) FROM t1 WHERE a=2;
a	length(b)	substr(b,1+4*900,2)
2	4512	b1
delete from t1 where a=1;
delete from t1 where a=2;
select count(*) from t1;
count(*)
DELETE FROM t1 WHERE a=1;
DELETE FROM t1 WHERE a=2;
SELECT COUNT(*) FROM t1;
COUNT(*)
0
drop table t1;
alter tablespace ts1 drop datafile 'datafile.dat' engine = ndb;
alter tablespace ts1 drop datafile 'datafile02.dat' engine = ndb;
drop tablespace ts1 engine = ndb;
drop logfile group lg1 engine = ndb;
DROP TABLE t1;
ALTER TABLESPACE ts1 
DROP DATAFILE 'datafile.dat' 
ENGINE = NDB;
ALTER TABLESPACE ts1 
DROP DATAFILE 'datafile02.dat' 
ENGINE = NDB;
DROP TABLESPACE ts1 
ENGINE = NDB;
DROP LOGFILE GROUP lg1 
ENGINE =NDB;
+182 −0
Original line number Diff line number Diff line
DROP TABLE IF EXISTS t1;
**** Begin Duplicate Statement Testing ****
CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE 16M
UNDO_BUFFER_SIZE = 1M
ENGINE=NDB;
CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE 16M
UNDO_BUFFER_SIZE = 1M
ENGINE=NDB;
ERROR HY000: Failed to create LOGFILE GROUP
ALTER LOGFILE GROUP lg1
ADD UNDOFILE 'undofile02.dat'
INITIAL_SIZE 4M ENGINE NDB;
ALTER LOGFILE GROUP lg1
ADD UNDOFILE 'undofile02.dat'
INITIAL_SIZE 4M ENGINE=NDB;
ERROR HY000: Failed to alter: CREATE UNDOFILE
CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE 12M
ENGINE NDB;
CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE 12M
ENGINE NDB;
ERROR HY000: Failed to create TABLESPACE
ALTER TABLESPACE ts1
ADD DATAFILE 'datafile2.dat'
INITIAL_SIZE 12M
ENGINE=NDB;
ALTER TABLESPACE ts1
ADD DATAFILE 'datafile2.dat'
INITIAL_SIZE 12M
ENGINE=NDB;
ERROR HY000: Failed to alter:  CREATE DATAFILE
CREATE TABLE t1
(pk1 int not null primary key, b int not null, c int not null)
tablespace ts1 storage disk
engine ndb;
CREATE TABLE t1
(pk1 int not null primary key, b int not null, c int not null)
tablespace ts1 storage disk
engine ndb;
ERROR 42S01: Table 't1' already exists
DROP TABLE t1;
ALTER TABLESPACE ts1
DROP DATAFILE 'datafile2.dat' 
ENGINE=NDB;
ALTER TABLESPACE ts1
DROP DATAFILE 'datafile2.dat' 
ENGINE=NDB;
ERROR HY000: Failed to alter:  NO SUCH FILE
ALTER TABLESPACE ts1
DROP DATAFILE 'datafile.dat' 
ENGINE=NDB;
ALTER TABLESPACE ts1
DROP DATAFILE 'datafile.dat' 
ENGINE=NDB;
ERROR HY000: Failed to alter:  NO SUCH FILE
DROP TABLESPACE ts1 
ENGINE=NDB;
DROP TABLESPACE ts1 
ENGINE=NDB;
ERROR HY000: Failed to drop TABLESPACE
DROP LOGFILE GROUP lg1 
ENGINE=NDB;
DROP LOGFILE GROUP lg1 
ENGINE=NDB;
ERROR HY000: Failed to drop LOGFILE GROUP
**** End Duplicate Statement Testing ****

**** Begin Statment CaSe Testing ****
creaTE LOgfilE GrOuP lg1
adD undoFILE 'undofile.dat'
initiAL_siZE 16M
UnDo_BuFfEr_SiZe = 1M
ENGInE=NDb;
altER LOgFiLE GrOUp lg1
AdD UnDOfILe 'undofile02.dat'
INItIAl_SIzE 4M ENgINE nDB;
CrEAtE TABLEspaCE ts1
ADD DATAfilE 'datafile.dat'
UsE LoGFiLE GRoUP lg1
INITiaL_SizE 12M
ENGiNe NDb;
AlTeR tAbLeSpAcE ts1
AdD DaTaFiLe 'datafile2.dat'
InItIaL_SiZe 12M
EnGiNe=NDB;
CREATE TABLE t1
(pk1 int not null primary key, b int not null, c int not null)
TABLEspace ts1 storAGE dISk
ENGine nDb;
DROP TABLE t1;
AlteR TAblespaCE ts1
droP DATAfile 'datafile2.dat' 
ENGINE=NDB;
ALter tablesPACE ts1
dROp dAtAfIlE 'datafile.dat' 
ENGine=Ndb;
DrOp TaBleSpAcE ts1 
engINE=ndB;
DrOp lOgFiLe GrOuP lg1 
EnGiNe=nDb;
**** End Statment CaSe Testing ****

**** Begin = And No = Testing ****
CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE=16M
UNDO_BUFFER_SIZE=1M
ENGINE=NDB;
ALTER LOGFILE GROUP lg1
ADD UNDOFILE 'undofile02.dat'
INITIAL_SIZE=4M 
ENGINE=NDB;
CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE=12M
ENGINE=NDB;
ALTER TABLESPACE ts1
ADD DATAFILE 'datafile2.dat'
INITIAL_SIZE=12M
ENGINE=NDB;
CREATE TABLE t1
(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
TABLESPACE ts1 STORAGE DISK
ENGINE=NDB;
DROP TABLE t1;
ALTER TABLESPACE ts1
DROP DATAFILE 'datafile2.dat'
ENGINE=NDB;
ALTER TABLESPACE ts1
DROP DATAFILE 'datafile.dat'
ENGINE=NDB;
DROP TABLESPACE ts1
ENGINE=NDB;
DROP LOGFILE GROUP lg1
ENGINE=NDB;

**** End of = ****

CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE 16M
UNDO_BUFFER_SIZE 1M
ENGINE NDB;
ALTER LOGFILE GROUP lg1
ADD UNDOFILE 'undofile02.dat'
INITIAL_SIZE 4M
ENGINE NDB;
CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE 12M
ENGINE NDB;
ALTER TABLESPACE ts1
ADD DATAFILE 'datafile2.dat'
INITIAL_SIZE 12M
ENGINE NDB;
CREATE TABLE t1
(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
TABLESPACE ts1 STORAGE DISK
ENGINE NDB;
DROP TABLE t1;
ALTER TABLESPACE ts1
DROP DATAFILE 'datafile2.dat'
ENGINE NDB;
ALTER TABLESPACE ts1
DROP DATAFILE 'datafile.dat'
ENGINE NDB;
DROP TABLESPACE ts1
ENGINE NDB;
DROP LOGFILE GROUP lg1
ENGINE NDB;
**** End = And No =  ****
+163 −129
Original line number Diff line number Diff line
#################################
# Author: JO
# Org Date: ?
# Purpose: To test basic Cluster Disk Data 
#################################
# Change Author: JBM
# Change Date: 2006-01-11
# Change: Cleanup and test rename
#################################

-- source include/have_ndb.inc

--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings

#
##################################
# Basic test of disk tables for NDB
#

#
# Start by creating a logfile group
#
##################################

CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
@@ -18,13 +25,14 @@ INITIAL_SIZE 16M
UNDO_BUFFER_SIZE = 1M
ENGINE=NDB;

alter logfile group lg1
add undofile 'undofile02.dat'
initial_size 4M engine=ndb;
ALTER LOGFILE GROUP lg1
ADD UNDOFILE 'undofile02.dat'
INITIAL_SIZE = 4M 
ENGINE=NDB;

#
###################################################
# Create a tablespace connected to the logfile group
#
###################################################

CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
@@ -32,18 +40,19 @@ USE LOGFILE GROUP lg1
INITIAL_SIZE 12M
ENGINE NDB;

alter tablespace ts1
add datafile 'datafile02.dat'
initial_size 4M engine=ndb;
ALTER TABLESPACE ts1
ADD DATAFILE 'datafile02.dat'
INITIAL_SIZE = 4M 
ENGINE=NDB;

#
########################################
# Create a table using this tablespace
#
########################################

CREATE TABLE t1
(pk1 int not null primary key, b int not null, c int not null)
tablespace ts1 storage disk
engine ndb;
(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
TABLESPACE ts1 STORAGE DISK
ENGINE=NDB;

INSERT INTO t1 VALUES (0, 0, 0);
SELECT * FROM t1;
@@ -152,128 +161,138 @@ INSERT INTO t1 VALUES

SELECT COUNT(*) FROM t1;

#
####################################
# Test error cases with size numbers
#
####################################
--error ER_WRONG_SIZE_NUMBER
CREATE LOGFILE GROUP lg2
ADD UNDOFILE 'x.dat'
INITIAL_SIZE 10y
engine = ndb;
ENGINE = NDB;

--error ER_WRONG_SIZE_NUMBER
CREATE LOGFILE GROUP lg2
ADD UNDOFILE 'x.dat'
INITIAL_SIZE 10MB
engine=ndb;
ENGINE = NDB;

--error 1064
CREATE LOGFILE GROUP lg2
ADD UNDOFILE 'x.dat'
INITIAL_SIZE 10 MB
engine=ndb;
ENGINE = NDB;

--error 1064
CREATE LOGFILE GROUP lg2
ADD UNDOFILE 'x.dat'
INITIAL_SIZE 10 M
engine=ndb;
ENGINE = NDB;

--error ER_SIZE_OVERFLOW_ERROR
CREATE LOGFILE GROUP lg2
ADD UNDOFILE 'x.dat'
INITIAL_SIZE 1000000000000K
engine=ndb;
ENGINE = NDB;

DROP TABLE t1;

############################
# Test update of mm/dd part
create table t1 (a int primary key, b char(4) not null, c char(4) not null, key(b)) tablespace ts1 storage disk engine ndb;
insert into t1 values (1,'1','1'), (2,'2','2'), (3,'3','3');
begin;
update t1 set b = '2' where a = 1;
select b from t1 where a = 1;
select * from t1 where a = 1;
update t1 set c = '2' where a = 1;
select b from t1 where a = 1;
select * from t1 where a = 1;
update t1 set b = '3' where a = 1;
select b from t1 where a = 1;
select * from t1 where a = 1;
commit;
select * from t1 order by 1;
begin;
update t1 set c = '3' where a = 1;
select b from t1 where a = 1;
select * from t1 where a = 1;
update t1 set b = '4' where a = 1;
select b from t1 where a = 1;
select * from t1 where a = 1;
update t1 set c = '4' where a = 1;
select b from t1 where a = 1;
select * from t1 where a = 1;
commit;
select * from t1 order by 1;
update t1 set b = '5' where a = 1;
select * from t1 order by 1;
update t1 set b = '6'  where b = '5';
select * from t1 order by 1;
update t1 set b = '7'  where c = '4';
select * from t1 order by 1;
update t1 set c = '5' where a = 1;
select * from t1 order by 1;
update t1 set c = '6'  where b = '7';
select * from t1 order by 1;
update t1 set c = '7'  where c = '6';
select * from t1 order by 1;
drop table t1;
create table t1 (a int primary key, b varchar(4) not null, c char(4) not null, key(b)) tablespace ts1 storage disk engine ndb;
insert into t1 values (1,'1','1'), (2,'2','2'), (3,'3','3');
begin;
update t1 set b = '2' where a = 1;
select b from t1 where a = 1;
select * from t1 where a = 1;
update t1 set c = '2' where a = 1;
select b from t1 where a = 1;
select * from t1 where a = 1;
update t1 set b = '3' where a = 1;
select b from t1 where a = 1;
select * from t1 where a = 1;
commit;
select * from t1 order by 1;
begin;
update t1 set c = '3' where a = 1;
select b from t1 where a = 1;
select * from t1 where a = 1;
update t1 set b = '4' where a = 1;
select b from t1 where a = 1;
select * from t1 where a = 1;
update t1 set c = '4' where a = 1;
select b from t1 where a = 1;
select * from t1 where a = 1;
commit;
select * from t1 order by 1;
update t1 set b = '5' where a = 1;
select * from t1 order by 1;
update t1 set b = '6'  where b = '5';
select * from t1 order by 1;
update t1 set b = '7'  where c = '4';
select * from t1 order by 1;
update t1 set c = '5' where a = 1;
select * from t1 order by 1;
update t1 set c = '6'  where b = '7';
select * from t1 order by 1;
update t1 set c = '7'  where c = '6';
select * from t1 order by 1;
drop table t1;
############################

CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(4) NOT NULL, c CHAR(4) NOT NULL, KEY(b)) TABLESPACE ts1 STORAGE DISK ENGINE = NDB;
INSERT INTO t1 VALUES (1,'1','1'), (2,'2','2'), (3,'3','3');
BEGIN;
UPDATE t1 SET b = '2' WHERE a = 1;
SELECT b FROM t1 WHERE a = 1;
SELECT * FROM t1 WHERE a = 1;
UPDATE t1 SET c = '2' WHERE a = 1;
SELECT b FROM t1 WHERE a = 1;
SELECT * FROM t1 WHERE a = 1;
UPDATE t1 SET b = '3' WHERE a = 1;
SELECT b FROM t1 WHERE a = 1;
SELECT * FROM t1 WHERE a = 1;
COMMIT;
SELECT * FROM t1 ORDER BY 1;
BEGIN;
UPDATE t1 SET c = '3' WHERE a = 1;
SELECT b FROM t1 WHERE a = 1;
SELECT * FROM t1 WHERE a = 1;
UPDATE t1 SET b = '4' WHERE a = 1;
SELECT b FROM t1 WHERE a = 1;
SELECT * FROM t1 WHERE a = 1;
UPDATE t1 SET c = '4' WHERE a = 1;
SELECT b FROM t1 WHERE a = 1;
SELECT * FROM t1 WHERE a = 1;
COMMIT;
SELECT * FROM t1 ORDER BY 1;
UPDATE t1 SET b = '5' WHERE a = 1;
SELECT * FROM t1 ORDER BY 1;
UPDATE t1 SET b = '6' WHERE b = '5';
SELECT * FROM t1 ORDER BY 1;
UPDATE t1 SET b = '7'WHERE c = '4';
SELECT * FROM t1 ORDER BY 1;
UPDATE t1 SET c = '5' WHERE a = 1;
SELECT * FROM t1 ORDER BY 1;
UPDATE t1 SET c = '6' WHERE b = '7';
SELECT * FROM t1 ORDER BY 1;
UPDATE t1 SET c = '7' WHERE c = '6';
SELECT * FROM t1 ORDER BY 1;
DROP TABLE t1;

#####

CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(4) NOT NULL, c CHAR(4) NOT NULL, KEY(b)) TABLESPACE ts1 STORAGE DISK ENGINE NDB;
INSERT INTO t1 VALUE (1,'1','1'), (2,'2','2'), (3,'3','3');
BEGIN;
UPDATE t1 SET b = '2' WHERE a = 1;
SELECT b FROM t1 WHERE a = 1;
SELECT * FROM t1 WHERE a = 1;
UPDATE t1 SET c = '2' WHERE a = 1;
SELECT b FROM t1 WHERE a = 1;
SELECT * FROM t1 WHERE a = 1;
UPDATE t1 SET b = '3' WHERE a = 1;
SELECT b FROM t1 WHERE a = 1;
SELECT * FROM t1 WHERE a = 1;
COMMIT;
SELECT * FROM t1 ORDER BY 1;
BEGIN;
UPDATE t1 SET c = '3' WHERE a = 1;
SELECT b FROM t1 WHERE a = 1;
SELECT * FROM t1 WHERE a = 1;
UPDATE t1 SET b = '4' WHERE a = 1;
SELECT b FROM t1 WHERE a = 1;
SELECT * FROM t1 WHERE a = 1;
UPDATE t1 SET c = '4' WHERE a = 1;
SELECT b FROM t1 WHERE a = 1;
SELECT * FROM t1 WHERE a = 1;
COMMIT;
SELECT * FROM t1 ORDER BY 1;
UPDATE t1 SET b = '5' WHERE a = 1;
SELECT * FROM t1 ORDER BY 1;
UPDATE t1 SET b = '6' WHERE b = '5';
SELECT * FROM t1 ORDER BY 1;
UPDATE t1 SET b = '7' WHERE c = '4';
SELECT * FROM t1 ORDER BY 1;
UPDATE t1 SET c = '5' WHERE a = 1;
SELECT * FROM t1 ORDER BY 1;
UPDATE t1 SET c = '6' WHERE b = '7';
SELECT * FROM t1 ORDER BY 1;
UPDATE t1 SET c = '7' WHERE c = '6';
SELECT * FROM t1 ORDER BY 1;
DROP TABLE t1;

########################
# Test for blobs...
create table t1 (
  a int not null primary key,
  b text not null
) tablespace ts1 storage disk engine=ndbcluster;
########################

CREATE TABLE t1 (
  a INT NOT NULL PRIMARY KEY,
  b TEXT NOT NULL
) TABLESPACE ts1 STORAGE DISK ENGINE=NDBCLUSTER;

# b1 length 2000+256 (blob part aligned)
#########################################
set @x0 = '01234567012345670123456701234567';
set @x0 = concat(@x0,@x0,@x0,@x0,@x0,@x0,@x0,@x0);
set @b1 = 'b1';
@@ -282,31 +301,46 @@ set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
set @b1 = concat(@b1,@x0);
# b2 length 20000
##########################################
set @b2 = 'b2';
set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);

insert into t1 values(1,@b1);
insert into t1 values(2,@b2);
select a,length(b),substr(b,1+2*900,2) from t1 where a=1;
select a,length(b),substr(b,1+2*9000,2) from t1 where a=2;
update t1 set b=@b2 where a=1;
update t1 set b=@b1 where a=2;
select a,length(b),substr(b,1+2*9000,2) from t1 where a=1;
select a,length(b),substr(b,1+2*900,2) from t1 where a=2;
update t1 set b=concat(b,b) where a=1;
update t1 set b=concat(b,b) where a=2;
select a,length(b),substr(b,1+4*9000,2) from t1 where a=1;
select a,length(b),substr(b,1+4*900,2) from t1 where a=2;
delete from t1 where a=1;
delete from t1 where a=2;
select count(*) from t1;
drop table t1;

alter tablespace ts1 drop datafile 'datafile.dat' engine = ndb;
alter tablespace ts1 drop datafile 'datafile02.dat' engine = ndb;
drop tablespace ts1 engine = ndb;

drop logfile group lg1 engine = ndb;
INSERT INTO t1 VALUES(1,@b1);
INSERT INTO t1 VALUES(2,@b2);
SELECT a,length(b),substr(b,1+2*900,2) FROM t1 WHERE a=1;
SELECT a,length(b),substr(b,1+2*9000,2) FROM t1 WHERE a=2;
UPDATE t1 SET b=@b2 WHERE a=1;
UPDATE t1 SET b=@b1 WHERE a=2;
SELECT a,length(b),substr(b,1+2*9000,2) FROM t1 WHERE a=1;
SELECT a,length(b),substr(b,1+2*900,2) FROM t1 WHERE a=2;
UPDATE t1 SET b=concat(b,b) WHERE a=1;
UPDATE t1 SET b=concat(b,b) WHERE a=2;
SELECT a,length(b),substr(b,1+4*9000,2) FROM t1 WHERE a=1;
SELECT a,length(b),substr(b,1+4*900,2) FROM t1 WHERE a=2;
DELETE FROM t1 WHERE a=1;
DELETE FROM t1 WHERE a=2;
SELECT COUNT(*) FROM t1;
DROP TABLE t1;

###################
# Test Cleanup
###################

ALTER TABLESPACE ts1 
DROP DATAFILE 'datafile.dat' 
ENGINE = NDB;

ALTER TABLESPACE ts1 
DROP DATAFILE 'datafile02.dat' 
ENGINE = NDB;

DROP TABLESPACE ts1 
ENGINE = NDB;

DROP LOGFILE GROUP lg1 
ENGINE =NDB;

#End 5.1 test case
+257 −0

File added.

Preview size limit exceeded, changes collapsed.