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
5fdd4112
Commit
5fdd4112
authored
Apr 25, 2007
by
msvensson@pilot.blaudden
Browse files
Options
Browse Files
Download
Plain Diff
Merge pilot.blaudden:/home/msvensson/mysql/bug25262/my51-bug25262
into pilot.blaudden:/home/msvensson/mysql/mysql-5.1-maint
parents
08ea692a
fb892abd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
0 deletions
+58
-0
mysql-test/r/alter_table.result
mysql-test/r/alter_table.result
+24
-0
mysql-test/t/alter_table.test
mysql-test/t/alter_table.test
+28
-0
sql/sql_table.cc
sql/sql_table.cc
+6
-0
No files found.
mysql-test/r/alter_table.result
View file @
5fdd4112
...
...
@@ -822,6 +822,30 @@ desc t1;
Field Type Null Key Default Extra
mycol int(10) NO 0
drop table t1;
create table t1(id int(8) primary key auto_increment) engine=heap;
insert into t1 values (null);
insert into t1 values (null);
select * from t1;
id
1
2
alter table t1 auto_increment = 50;
alter table t1 engine = myisam;
insert into t1 values (null);
select * from t1;
id
1
2
50
alter table t1 engine = heap;
insert into t1 values (null);
select * from t1;
id
1
2
50
51
drop table t1;
create table t1 (v varchar(32));
insert into t1 values ('def'),('abc'),('hij'),('3r4f');
select * from t1;
...
...
mysql-test/t/alter_table.test
View file @
5fdd4112
...
...
@@ -605,6 +605,34 @@ desc t1;
drop
table
t1
;
#
#
# Bug#25262 Auto Increment lost when changing Engine type
#
create
table
t1
(
id
int
(
8
)
primary
key
auto_increment
)
engine
=
heap
;
insert
into
t1
values
(
null
);
insert
into
t1
values
(
null
);
select
*
from
t1
;
# Set auto increment to 50
alter
table
t1
auto_increment
=
50
;
# Alter to myisam
alter
table
t1
engine
=
myisam
;
# This insert should get id 50
insert
into
t1
values
(
null
);
select
*
from
t1
;
# Alter to heap again
alter
table
t1
engine
=
heap
;
insert
into
t1
values
(
null
);
select
*
from
t1
;
drop
table
t1
;
# Some additional tests for new, faster alter table. Note that most of the
# whole alter table code is being tested all around the test suite already.
#
...
...
sql/sql_table.cc
View file @
5fdd4112
...
...
@@ -5700,6 +5700,12 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
create_info
->
avg_row_length
=
table
->
s
->
avg_row_length
;
if
(
!
(
used_fields
&
HA_CREATE_USED_DEFAULT_CHARSET
))
create_info
->
default_table_charset
=
table
->
s
->
table_charset
;
if
(
!
(
used_fields
&
HA_CREATE_USED_AUTO
)
&&
table
->
found_next_number_field
)
{
/* Table has an autoincrement, copy value to new table */
table
->
file
->
info
(
HA_STATUS_AUTO
);
create_info
->
auto_increment_value
=
table
->
file
->
stats
.
auto_increment_value
;
}
if
(
!
(
used_fields
&
HA_CREATE_USED_KEY_BLOCK_SIZE
))
create_info
->
key_block_size
=
table
->
s
->
key_block_size
;
...
...
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