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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
19ef95be
Commit
19ef95be
authored
Apr 03, 2003
by
Sinisa@sinisa.nasamreza.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test case for displaying and correct functioning of ALTER TABLE
ENABLE / DISABLE KEYS
parent
10957fb0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
mysql-test/r/alter_table.result
mysql-test/r/alter_table.result
+38
-0
mysql-test/t/alter_table.test
mysql-test/t/alter_table.test
+2
-0
No files found.
mysql-test/r/alter_table.result
View file @
19ef95be
...
@@ -92,6 +92,25 @@ key (n2, n3, n4, n1),
...
@@ -92,6 +92,25 @@ key (n2, n3, n4, n1),
key (n3, n4, n1, n2),
key (n3, n4, n1, n2),
key (n4, n1, n2, n3) );
key (n4, n1, n2, n3) );
alter table t1 disable keys;
alter table t1 disable keys;
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 0 n1 1 n1 A 0 NULL NULL BTREE
t1 1 n1_2 1 n1 A NULL NULL NULL BTREE disabled
t1 1 n1_2 2 n2 A NULL NULL NULL YES BTREE disabled
t1 1 n1_2 3 n3 A NULL NULL NULL YES BTREE disabled
t1 1 n1_2 4 n4 A NULL NULL NULL YES BTREE disabled
t1 1 n2 1 n2 A NULL NULL NULL YES BTREE disabled
t1 1 n2 2 n3 A NULL NULL NULL YES BTREE disabled
t1 1 n2 3 n4 A NULL NULL NULL YES BTREE disabled
t1 1 n2 4 n1 A NULL NULL NULL BTREE disabled
t1 1 n3 1 n3 A NULL NULL NULL YES BTREE disabled
t1 1 n3 2 n4 A NULL NULL NULL YES BTREE disabled
t1 1 n3 3 n1 A NULL NULL NULL BTREE disabled
t1 1 n3 4 n2 A NULL NULL NULL YES BTREE disabled
t1 1 n4 1 n4 A NULL NULL NULL YES BTREE disabled
t1 1 n4 2 n1 A NULL NULL NULL BTREE disabled
t1 1 n4 3 n2 A NULL NULL NULL YES BTREE disabled
t1 1 n4 4 n3 A NULL NULL NULL YES BTREE disabled
insert into t1 values(10,RAND()*1000,RAND()*1000,RAND());
insert into t1 values(10,RAND()*1000,RAND()*1000,RAND());
insert into t1 values(9,RAND()*1000,RAND()*1000,RAND());
insert into t1 values(9,RAND()*1000,RAND()*1000,RAND());
insert into t1 values(8,RAND()*1000,RAND()*1000,RAND());
insert into t1 values(8,RAND()*1000,RAND()*1000,RAND());
...
@@ -103,6 +122,25 @@ insert into t1 values(3,RAND()*1000,RAND()*1000,RAND());
...
@@ -103,6 +122,25 @@ insert into t1 values(3,RAND()*1000,RAND()*1000,RAND());
insert into t1 values(2,RAND()*1000,RAND()*1000,RAND());
insert into t1 values(2,RAND()*1000,RAND()*1000,RAND());
insert into t1 values(1,RAND()*1000,RAND()*1000,RAND());
insert into t1 values(1,RAND()*1000,RAND()*1000,RAND());
alter table t1 enable keys;
alter table t1 enable keys;
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 0 n1 1 n1 A 10 NULL NULL BTREE
t1 1 n1_2 1 n1 A 10 NULL NULL BTREE
t1 1 n1_2 2 n2 A 10 NULL NULL YES BTREE
t1 1 n1_2 3 n3 A 10 NULL NULL YES BTREE
t1 1 n1_2 4 n4 A 10 NULL NULL YES BTREE
t1 1 n2 1 n2 A 10 NULL NULL YES BTREE
t1 1 n2 2 n3 A 10 NULL NULL YES BTREE
t1 1 n2 3 n4 A 10 NULL NULL YES BTREE
t1 1 n2 4 n1 A 10 NULL NULL BTREE
t1 1 n3 1 n3 A 10 NULL NULL YES BTREE
t1 1 n3 2 n4 A 10 NULL NULL YES BTREE
t1 1 n3 3 n1 A 10 NULL NULL BTREE
t1 1 n3 4 n2 A 10 NULL NULL YES BTREE
t1 1 n4 1 n4 A 10 NULL NULL YES BTREE
t1 1 n4 2 n1 A 10 NULL NULL BTREE
t1 1 n4 3 n2 A 10 NULL NULL YES BTREE
t1 1 n4 4 n3 A 10 NULL NULL YES BTREE
drop table t1;
drop table t1;
create table t1 (i int unsigned not null auto_increment primary key);
create table t1 (i int unsigned not null auto_increment primary key);
insert into t1 values (null),(null),(null),(null);
insert into t1 values (null),(null),(null),(null);
...
...
mysql-test/t/alter_table.test
View file @
19ef95be
...
@@ -86,6 +86,7 @@ create table t1 (n1 int not null, n2 int, n3 int, n4 float,
...
@@ -86,6 +86,7 @@ create table t1 (n1 int not null, n2 int, n3 int, n4 float,
key
(
n3
,
n4
,
n1
,
n2
),
key
(
n3
,
n4
,
n1
,
n2
),
key
(
n4
,
n1
,
n2
,
n3
)
);
key
(
n4
,
n1
,
n2
,
n3
)
);
alter
table
t1
disable
keys
;
alter
table
t1
disable
keys
;
show
keys
from
t1
;
#let $1=10000;
#let $1=10000;
let
$
1
=
10
;
let
$
1
=
10
;
while
(
$
1
)
while
(
$
1
)
...
@@ -94,6 +95,7 @@ while ($1)
...
@@ -94,6 +95,7 @@ while ($1)
dec
$
1
;
dec
$
1
;
}
}
alter
table
t1
enable
keys
;
alter
table
t1
enable
keys
;
show
keys
from
t1
;
drop
table
t1
;
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