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
18370ce3
Commit
18370ce3
authored
Apr 03, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test case for displaying and correct functioning of ALTER TABLE
ENABLE / DISABLE KEYS
parent
8baad6f3
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 @
18370ce3
...
...
@@ -92,6 +92,25 @@ key (n2, n3, n4, n1),
key (n3, n4, n1, n2),
key (n4, n1, n2, n3) );
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(9,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());
insert into t1 values(2,RAND()*1000,RAND()*1000,RAND());
insert into t1 values(1,RAND()*1000,RAND()*1000,RAND());
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;
create table t1 (i int unsigned not null auto_increment primary key);
insert into t1 values (null),(null),(null),(null);
...
...
mysql-test/t/alter_table.test
View file @
18370ce3
...
...
@@ -86,6 +86,7 @@ create table t1 (n1 int not null, n2 int, n3 int, n4 float,
key
(
n3
,
n4
,
n1
,
n2
),
key
(
n4
,
n1
,
n2
,
n3
)
);
alter
table
t1
disable
keys
;
show
keys
from
t1
;
#let $1=10000;
let
$
1
=
10
;
while
(
$
1
)
...
...
@@ -94,6 +95,7 @@ while ($1)
dec
$
1
;
}
alter
table
t1
enable
keys
;
show
keys
from
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