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
eab01edf
Commit
eab01edf
authored
Jul 29, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added test for fix of bug#3912 Auto increment not correctly initialised when table is altered
parent
785a2eea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
4 deletions
+26
-4
mysql-test/r/ndb_alter_table.result
mysql-test/r/ndb_alter_table.result
+19
-2
mysql-test/t/ndb_alter_table.test
mysql-test/t/ndb_alter_table.test
+7
-2
No files found.
mysql-test/r/ndb_alter_table.result
View file @
eab01edf
...
@@ -16,14 +16,31 @@ col3 varchar (20) not null,
...
@@ -16,14 +16,31 @@ col3 varchar (20) not null,
col4 varchar(4) not null,
col4 varchar(4) not null,
col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null,
col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null,
col6 int not null, to_be_deleted int);
col6 int not null, to_be_deleted int);
insert into t1 values (2,4,3,5,"PENDING",1,7);
insert into t1 values (2,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7), (25, 4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7);
select * from t1 order by col1;
col1 col2 col3 col4 col5 col6 to_be_deleted
2 4 3 5 PENDING 1 7
3 4 3 5 PENDING 1 7
25 4 3 5 PENDING 1 7
26 4 3 5 PENDING 1 7
alter table t1
alter table t1
add column col4_5 varchar(20) not null after col4,
add column col4_5 varchar(20) not null after col4,
add column col7 varchar(30) not null after col5,
add column col7 varchar(30) not null after col5,
add column col8 datetime not null, drop column to_be_deleted,
add column col8 datetime not null, drop column to_be_deleted,
change column col2 fourth varchar(30) not null after col3,
change column col2 fourth varchar(30) not null after col3,
modify column col6 int not null first;
modify column col6 int not null first;
select * from t1;
select * from t1
order by col1
;
col6 col1 col3 fourth col4 col4_5 col5 col7 col8
col6 col1 col3 fourth col4 col4_5 col5 col7 col8
1 2 3 4 5 PENDING 0000-00-00 00:00:00
1 2 3 4 5 PENDING 0000-00-00 00:00:00
1 3 3 4 5 PENDING 0000-00-00 00:00:00
1 25 3 4 5 PENDING 0000-00-00 00:00:00
1 26 3 4 5 PENDING 0000-00-00 00:00:00
insert into t1 values (2, NULL,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00');
select * from t1 order by col1;
col6 col1 col3 fourth col4 col4_5 col5 col7 col8
1 2 3 4 5 PENDING 0000-00-00 00:00:00
1 3 3 4 5 PENDING 0000-00-00 00:00:00
1 25 3 4 5 PENDING 0000-00-00 00:00:00
1 26 3 4 5 PENDING 0000-00-00 00:00:00
2 27 4 3 5 99 PENDING EXTRA 2004-01-01 00:00:00
drop table t1;
drop table t1;
mysql-test/t/ndb_alter_table.test
View file @
eab01edf
...
@@ -30,12 +30,17 @@ col3 varchar (20) not null,
...
@@ -30,12 +30,17 @@ col3 varchar (20) not null,
col4
varchar
(
4
)
not
null
,
col4
varchar
(
4
)
not
null
,
col5
enum
(
'PENDING'
,
'ACTIVE'
,
'DISABLED'
)
not
null
,
col5
enum
(
'PENDING'
,
'ACTIVE'
,
'DISABLED'
)
not
null
,
col6
int
not
null
,
to_be_deleted
int
);
col6
int
not
null
,
to_be_deleted
int
);
insert
into
t1
values
(
2
,
4
,
3
,
5
,
"PENDING"
,
1
,
7
);
insert
into
t1
values
(
2
,
4
,
3
,
5
,
"PENDING"
,
1
,
7
),
(
NULL
,
4
,
3
,
5
,
"PENDING"
,
1
,
7
),
(
25
,
4
,
3
,
5
,
"PENDING"
,
1
,
7
),
(
NULL
,
4
,
3
,
5
,
"PENDING"
,
1
,
7
);
select
*
from
t1
order
by
col1
;
alter
table
t1
alter
table
t1
add
column
col4_5
varchar
(
20
)
not
null
after
col4
,
add
column
col4_5
varchar
(
20
)
not
null
after
col4
,
add
column
col7
varchar
(
30
)
not
null
after
col5
,
add
column
col7
varchar
(
30
)
not
null
after
col5
,
add
column
col8
datetime
not
null
,
drop
column
to_be_deleted
,
add
column
col8
datetime
not
null
,
drop
column
to_be_deleted
,
change
column
col2
fourth
varchar
(
30
)
not
null
after
col3
,
change
column
col2
fourth
varchar
(
30
)
not
null
after
col3
,
modify
column
col6
int
not
null
first
;
modify
column
col6
int
not
null
first
;
select
*
from
t1
;
select
*
from
t1
order
by
col1
;
insert
into
t1
values
(
2
,
NULL
,
4
,
3
,
5
,
99
,
"PENDING"
,
"EXTRA"
,
'2004-01-01 00:00:00'
);
select
*
from
t1
order
by
col1
;
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