Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
62fe3811
Commit
62fe3811
authored
May 11, 2004
by
magnus@neptunus.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated ndb_* test cases
Added two new, ndb_replace and ndb_minmax
parent
beff6a44
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
252 additions
and
22 deletions
+252
-22
mysql-test/r/ndb_index.result
mysql-test/r/ndb_index.result
+0
-6
mysql-test/r/ndb_index_ordered.result
mysql-test/r/ndb_index_ordered.result
+1
-1
mysql-test/r/ndb_index_unique.result
mysql-test/r/ndb_index_unique.result
+6
-6
mysql-test/r/ndb_minmax.result
mysql-test/r/ndb_minmax.result
+120
-0
mysql-test/r/ndb_replace.result
mysql-test/r/ndb_replace.result
+21
-0
mysql-test/t/ndb_index.test
mysql-test/t/ndb_index.test
+5
-2
mysql-test/t/ndb_index_ordered.test
mysql-test/t/ndb_index_ordered.test
+1
-1
mysql-test/t/ndb_index_unique.test
mysql-test/t/ndb_index_unique.test
+6
-6
mysql-test/t/ndb_minmax.test
mysql-test/t/ndb_minmax.test
+65
-0
mysql-test/t/ndb_replace.test
mysql-test/t/ndb_replace.test
+27
-0
No files found.
mysql-test/r/ndb_index.result
View file @
62fe3811
...
...
@@ -45,12 +45,6 @@ port67 node78 pop98 1
select port, accessnode, pop, accesstype from t1 where pop='pop98' order by accesstype;
port accessnode pop accesstype
port67 node78 pop98 1
select port, accessnode, pop, accesstype from t1 where pop='POP98';
port accessnode pop accesstype
port67 node78 pop98 1
select port, accessnode, pop, accesstype from t1 where pop='POP98' order by accesstype;
port accessnode pop accesstype
port67 node78 pop98 1
select port, accessnode, pop, accesstype from t1 where pop='foo';
port accessnode pop accesstype
select port, accessnode, pop, accesstype from t1 where accesstype=1;
...
...
mysql-test/r/ndb_index_ordered.result
View file @
62fe3811
...
...
@@ -122,7 +122,7 @@ drop table t1;
CREATE TABLE t1 (
a int unsigned NOT NULL PRIMARY KEY,
b int unsigned not null,
c int unsigned not null
,
c int unsigned not null
) engine = ndb;
create index a1 on t1 (b, c);
insert into t1 values (1, 2, 13);
...
...
mysql-test/r/ndb_index_unique.result
View file @
62fe3811
...
...
@@ -32,13 +32,13 @@ INSERT INTO t1 VALUES (8,'dummy');
CREATE TABLE t2 (
cid bigint(20) unsigned NOT NULL auto_increment,
cap varchar(255) NOT NULL default '',
PRIMARY KEY (cid)
,
PRIMARY KEY (cid)
) engine=ndbcluster;
CREATE TABLE t3 (
gid bigint(20) unsigned NOT NULL auto_increment,
gn varchar(255) NOT NULL default '',
must tinyint(4) default NULL,
PRIMARY KEY (gid)
,
PRIMARY KEY (gid)
) engine=ndbcluster;
INSERT INTO t3 VALUES (1,'V1',NULL);
CREATE TABLE t4 (
...
...
@@ -46,7 +46,7 @@ uid bigint(20) unsigned NOT NULL default '0',
gid bigint(20) unsigned NOT NULL,
rid bigint(20) unsigned NOT NULL default '-1',
cid bigint(20) unsigned NOT NULL default '-1',
UNIQUE KEY m (uid,gid,rid,cid)
,
UNIQUE KEY m (uid,gid,rid,cid)
) engine=ndbcluster;
INSERT INTO t4 VALUES (1,1,2,4);
INSERT INTO t4 VALUES (1,1,2,3);
...
...
@@ -55,14 +55,14 @@ INSERT INTO t4 VALUES (1,1,10,8);
CREATE TABLE t5 (
rid bigint(20) unsigned NOT NULL auto_increment,
rl varchar(255) NOT NULL default '',
PRIMARY KEY (rid)
,
PRIMARY KEY (rid)
) engine=ndbcluster;
CREATE TABLE t6 (
uid bigint(20) unsigned NOT NULL auto_increment,
un varchar(250) NOT NULL default '',
uc smallint(5) unsigned NOT NULL default '0',
PRIMARY KEY (uid),
UNIQUE KEY nc (un,uc)
,
UNIQUE KEY nc (un,uc)
) engine=ndbcluster;
INSERT INTO t6 VALUES (1,'test',8);
INSERT INTO t6 VALUES (2,'test2',9);
...
...
@@ -73,7 +73,7 @@ uid bigint(20) unsigned NOT NULL default '0',
gid bigint(20) unsigned NOT NULL,
rid bigint(20) unsigned NOT NULL default '-1',
cid bigint(20) unsigned NOT NULL default '-1',
UNIQUE KEY m (uid,gid,rid,cid)
,
UNIQUE KEY m (uid,gid,rid,cid)
) engine=ndbcluster;
INSERT INTO t7 VALUES(1, 1, 1, 1, 1);
INSERT INTO t7 VALUES(2, 2, 1, 1, 1);
...
...
mysql-test/r/ndb_minmax.result
0 → 100644
View file @
62fe3811
drop table if exists t1, t2;
CREATE TABLE t1 (
a int PRIMARY KEY
) engine = ndb;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (3);
INSERT INTO t1 VALUES (4);
INSERT INTO t1 VALUES (5);
INSERT INTO t1 VALUES (6);
select MAX(a) from t1;
MAX(a)
6
select MAX(a) from t1;
MAX(a)
6
select MAX(a) from t1;
MAX(a)
6
select MAX(a) from t1;
MAX(a)
6
select MIN(a) from t1;
MIN(a)
1
select MIN(a) from t1;
MIN(a)
1
select MIN(a) from t1;
MIN(a)
1
select * from t1 order by a;
a
1
2
3
4
5
6
select MIN(a) from t1;
MIN(a)
1
select MAX(a) from t1;
MAX(a)
6
select MAX(a) from t1;
MAX(a)
6
select * from t1 order by a;
a
1
2
3
4
5
6
drop table t1;
CREATE TABLE t2 (
a int PRIMARY KEY,
b int not null,
c int not null,
KEY(b),
UNIQUE(c)
) engine = ndb;
INSERT INTO t2 VALUES (1, 5, 1);
INSERT INTO t2 VALUES (2, 2, 7);
INSERT INTO t2 VALUES (3, 3, 3);
INSERT INTO t2 VALUES (4, 4, 4);
INSERT INTO t2 VALUES (5, 5, 5);
INSERT INTO t2 VALUES (6, 6, 6);
INSERT INTO t2 VALUES (7, 2, 10);
INSERT INTO t2 VALUES (8, 10, 2);
select MAX(a) from t2;
MAX(a)
8
select MAX(b) from t2;
MAX(b)
10
select MAX(c) from t2;
MAX(c)
10
select MIN(a) from t2;
MIN(a)
1
select MIN(b) from t2;
MIN(b)
2
select MIN(c) from t2;
MIN(c)
1
select * from t2 order by a;
a b c
1 5 1
2 2 7
3 3 3
4 4 4
5 5 5
6 6 6
7 2 10
8 10 2
select MIN(b) from t2;
MIN(b)
2
select MAX(a) from t2;
MAX(a)
8
select MAX(c) from t2;
MAX(c)
10
select * from t2 order by a;
a b c
1 5 1
2 2 7
3 3 3
4 4 4
5 5 5
6 6 6
7 2 10
8 10 2
drop table t2;
mysql-test/r/ndb_replace.result
0 → 100644
View file @
62fe3811
drop table if exists t1;
CREATE TABLE t1 (
gesuchnr int(11) DEFAULT '0' NOT NULL,
benutzer_id int(11) DEFAULT '0' NOT NULL,
PRIMARY KEY (gesuchnr,benutzer_id)
) engine=ndbcluster;
replace into t1 (gesuchnr,benutzer_id) values (2,1);
replace into t1 (gesuchnr,benutzer_id) values (1,1);
replace into t1 (gesuchnr,benutzer_id) values (1,1);
insert into t1 (gesuchnr, benutzer_id) value (3,2);
replace into t1 (gesuchnr,benutzer_id) values (1,1);
replace into t1 (gesuchnr,benutzer_id) values (1,1);
insert into t1 (gesuchnr,benutzer_id) values (1,1);
ERROR 23000: Can't write, duplicate key in table 't1'
replace into t1 (gesuchnr,benutzer_id) values (1,1);
select * from t1 order by gesuchnr;
gesuchnr benutzer_id
1 1
2 1
3 2
drop table t1;
mysql-test/t/ndb_index.test
View file @
62fe3811
...
...
@@ -42,8 +42,11 @@ select port, accessnode, pop, accesstype from t1 where pop='pop98';
select
port
,
accessnode
,
pop
,
accesstype
from
t1
where
pop
=
'pop98'
;
select
port
,
accessnode
,
pop
,
accesstype
from
t1
where
pop
=
'pop98'
;
select
port
,
accessnode
,
pop
,
accesstype
from
t1
where
pop
=
'pop98'
order
by
accesstype
;
select
port
,
accessnode
,
pop
,
accesstype
from
t1
where
pop
=
'POP98'
;
select
port
,
accessnode
,
pop
,
accesstype
from
t1
where
pop
=
'POP98'
order
by
accesstype
;
# The following two querys will not return any rows since
# the index used for access is case sensitive
# They are thus disabled for now
#select port, accessnode, pop, accesstype from t1 where pop='POP98';
#select port, accessnode, pop, accesstype from t1 where pop='POP98' order by accesstype;
select
port
,
accessnode
,
pop
,
accesstype
from
t1
where
pop
=
'foo'
;
# Test select using accesstype
...
...
mysql-test/t/ndb_index_ordered.test
View file @
62fe3811
...
...
@@ -79,7 +79,7 @@ drop table t1;
CREATE
TABLE
t1
(
a
int
unsigned
NOT
NULL
PRIMARY
KEY
,
b
int
unsigned
not
null
,
c
int
unsigned
not
null
,
c
int
unsigned
not
null
)
engine
=
ndb
;
create
index
a1
on
t1
(
b
,
c
);
...
...
mysql-test/t/ndb_index_unique.test
View file @
62fe3811
...
...
@@ -37,13 +37,13 @@ INSERT INTO t1 VALUES (8,'dummy');
CREATE
TABLE
t2
(
cid
bigint
(
20
)
unsigned
NOT
NULL
auto_increment
,
cap
varchar
(
255
)
NOT
NULL
default
''
,
PRIMARY
KEY
(
cid
)
,
PRIMARY
KEY
(
cid
)
)
engine
=
ndbcluster
;
CREATE
TABLE
t3
(
gid
bigint
(
20
)
unsigned
NOT
NULL
auto_increment
,
gn
varchar
(
255
)
NOT
NULL
default
''
,
must
tinyint
(
4
)
default
NULL
,
PRIMARY
KEY
(
gid
)
,
PRIMARY
KEY
(
gid
)
)
engine
=
ndbcluster
;
INSERT
INTO
t3
VALUES
(
1
,
'V1'
,
NULL
);
CREATE
TABLE
t4
(
...
...
@@ -51,7 +51,7 @@ CREATE TABLE t4 (
gid
bigint
(
20
)
unsigned
NOT
NULL
,
rid
bigint
(
20
)
unsigned
NOT
NULL
default
'-1'
,
cid
bigint
(
20
)
unsigned
NOT
NULL
default
'-1'
,
UNIQUE
KEY
m
(
uid
,
gid
,
rid
,
cid
)
,
UNIQUE
KEY
m
(
uid
,
gid
,
rid
,
cid
)
)
engine
=
ndbcluster
;
INSERT
INTO
t4
VALUES
(
1
,
1
,
2
,
4
);
INSERT
INTO
t4
VALUES
(
1
,
1
,
2
,
3
);
...
...
@@ -60,14 +60,14 @@ INSERT INTO t4 VALUES (1,1,10,8);
CREATE
TABLE
t5
(
rid
bigint
(
20
)
unsigned
NOT
NULL
auto_increment
,
rl
varchar
(
255
)
NOT
NULL
default
''
,
PRIMARY
KEY
(
rid
)
,
PRIMARY
KEY
(
rid
)
)
engine
=
ndbcluster
;
CREATE
TABLE
t6
(
uid
bigint
(
20
)
unsigned
NOT
NULL
auto_increment
,
un
varchar
(
250
)
NOT
NULL
default
''
,
uc
smallint
(
5
)
unsigned
NOT
NULL
default
'0'
,
PRIMARY
KEY
(
uid
),
UNIQUE
KEY
nc
(
un
,
uc
)
,
UNIQUE
KEY
nc
(
un
,
uc
)
)
engine
=
ndbcluster
;
INSERT
INTO
t6
VALUES
(
1
,
'test'
,
8
);
INSERT
INTO
t6
VALUES
(
2
,
'test2'
,
9
);
...
...
@@ -78,7 +78,7 @@ CREATE TABLE t7 (
gid
bigint
(
20
)
unsigned
NOT
NULL
,
rid
bigint
(
20
)
unsigned
NOT
NULL
default
'-1'
,
cid
bigint
(
20
)
unsigned
NOT
NULL
default
'-1'
,
UNIQUE
KEY
m
(
uid
,
gid
,
rid
,
cid
)
,
UNIQUE
KEY
m
(
uid
,
gid
,
rid
,
cid
)
)
engine
=
ndbcluster
;
INSERT
INTO
t7
VALUES
(
1
,
1
,
1
,
1
,
1
);
INSERT
INTO
t7
VALUES
(
2
,
2
,
1
,
1
,
1
);
...
...
mysql-test/t/ndb_minmax.test
0 → 100644
View file @
62fe3811
--
disable_warnings
drop
table
if
exists
t1
,
t2
;
--
enable_warnings
CREATE
TABLE
t1
(
a
int
PRIMARY
KEY
)
engine
=
ndb
;
INSERT
INTO
t1
VALUES
(
1
);
INSERT
INTO
t1
VALUES
(
2
);
INSERT
INTO
t1
VALUES
(
3
);
INSERT
INTO
t1
VALUES
(
4
);
INSERT
INTO
t1
VALUES
(
5
);
INSERT
INTO
t1
VALUES
(
6
);
select
MAX
(
a
)
from
t1
;
select
MAX
(
a
)
from
t1
;
select
MAX
(
a
)
from
t1
;
select
MAX
(
a
)
from
t1
;
select
MIN
(
a
)
from
t1
;
select
MIN
(
a
)
from
t1
;
select
MIN
(
a
)
from
t1
;
select
*
from
t1
order
by
a
;
select
MIN
(
a
)
from
t1
;
select
MAX
(
a
)
from
t1
;
select
MAX
(
a
)
from
t1
;
select
*
from
t1
order
by
a
;
drop
table
t1
;
CREATE
TABLE
t2
(
a
int
PRIMARY
KEY
,
b
int
not
null
,
c
int
not
null
,
KEY
(
b
),
UNIQUE
(
c
)
)
engine
=
ndb
;
INSERT
INTO
t2
VALUES
(
1
,
5
,
1
);
INSERT
INTO
t2
VALUES
(
2
,
2
,
7
);
INSERT
INTO
t2
VALUES
(
3
,
3
,
3
);
INSERT
INTO
t2
VALUES
(
4
,
4
,
4
);
INSERT
INTO
t2
VALUES
(
5
,
5
,
5
);
INSERT
INTO
t2
VALUES
(
6
,
6
,
6
);
INSERT
INTO
t2
VALUES
(
7
,
2
,
10
);
INSERT
INTO
t2
VALUES
(
8
,
10
,
2
);
select
MAX
(
a
)
from
t2
;
select
MAX
(
b
)
from
t2
;
select
MAX
(
c
)
from
t2
;
select
MIN
(
a
)
from
t2
;
select
MIN
(
b
)
from
t2
;
select
MIN
(
c
)
from
t2
;
select
*
from
t2
order
by
a
;
select
MIN
(
b
)
from
t2
;
select
MAX
(
a
)
from
t2
;
select
MAX
(
c
)
from
t2
;
select
*
from
t2
order
by
a
;
drop
table
t2
;
mysql-test/t/ndb_replace.test
0 → 100644
View file @
62fe3811
--
source
include
/
have_ndb
.
inc
#
# Test of REPLACE with NDB
#
--
disable_warnings
drop
table
if
exists
t1
;
--
enable_warnings
CREATE
TABLE
t1
(
gesuchnr
int
(
11
)
DEFAULT
'0'
NOT
NULL
,
benutzer_id
int
(
11
)
DEFAULT
'0'
NOT
NULL
,
PRIMARY
KEY
(
gesuchnr
,
benutzer_id
)
)
engine
=
ndbcluster
;
replace
into
t1
(
gesuchnr
,
benutzer_id
)
values
(
2
,
1
);
replace
into
t1
(
gesuchnr
,
benutzer_id
)
values
(
1
,
1
);
replace
into
t1
(
gesuchnr
,
benutzer_id
)
values
(
1
,
1
);
insert
into
t1
(
gesuchnr
,
benutzer_id
)
value
(
3
,
2
);
replace
into
t1
(
gesuchnr
,
benutzer_id
)
values
(
1
,
1
);
replace
into
t1
(
gesuchnr
,
benutzer_id
)
values
(
1
,
1
);
--
error
1022
insert
into
t1
(
gesuchnr
,
benutzer_id
)
values
(
1
,
1
);
replace
into
t1
(
gesuchnr
,
benutzer_id
)
values
(
1
,
1
);
select
*
from
t1
order
by
gesuchnr
;
drop
table
t1
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment