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
b13f1cc5
Commit
b13f1cc5
authored
Dec 20, 2017
by
Eugene Kosov
Committed by
GitHub
Dec 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-14681 Bogus ER_UNSUPPORTED_EXTENSION
parent
7eff2080
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
2 deletions
+31
-2
mysql-test/suite/versioning/r/alter.result
mysql-test/suite/versioning/r/alter.result
+5
-0
mysql-test/suite/versioning/t/alter.test
mysql-test/suite/versioning/t/alter.test
+6
-0
sql/handler.cc
sql/handler.cc
+20
-2
No files found.
mysql-test/suite/versioning/r/alter.result
View file @
b13f1cc5
...
...
@@ -422,5 +422,10 @@ create or replace table t(x int, y int) with system versioning engine=innodb;
alter table t modify y int without system versioning;
insert into t values(1, 1);
update t set y=2;
# MDEV-14681 Bogus ER_UNSUPPORTED_EXTENSION
create or replace table t1 (pk int auto_increment unique) with system versioning;
insert into t1 values (1);
delete from t1;
alter table t1 engine=myisam;
drop database test;
create database test;
mysql-test/suite/versioning/t/alter.test
View file @
b13f1cc5
...
...
@@ -365,5 +365,11 @@ alter table t modify y int without system versioning;
insert
into
t
values
(
1
,
1
);
update
t
set
y
=
2
;
--
echo
# MDEV-14681 Bogus ER_UNSUPPORTED_EXTENSION
create
or
replace
table
t1
(
pk
int
auto_increment
unique
)
with
system
versioning
;
insert
into
t1
values
(
1
);
delete
from
t1
;
alter
table
t1
engine
=
myisam
;
drop
database
test
;
create
database
test
;
sql/handler.cc
View file @
b13f1cc5
...
...
@@ -3046,6 +3046,25 @@ prev_insert_id(ulonglong nr, struct system_variables *variables)
#define AUTO_INC_DEFAULT_NB_MAX_BITS 16
#define AUTO_INC_DEFAULT_NB_MAX ((1 << AUTO_INC_DEFAULT_NB_MAX_BITS) - 1)
// check for ADD COLUMN ... AUTO_INCREMENT query
static
bool
is_add_auto_increment
(
THD
*
thd
)
{
DBUG_ASSERT
(
thd
->
lex
->
sql_command
==
SQLCOM_ALTER_TABLE
);
bool
add_auto_inc
=
false
;
List_iterator_fast
<
Create_field
>
it
(
thd
->
lex
->
alter_info
.
create_list
);
while
(
Create_field
*
f
=
it
++
)
{
if
(
f
->
flags
&
AUTO_INCREMENT_FLAG
)
{
add_auto_inc
=
true
;
break
;
}
}
return
add_auto_inc
;
}
int
handler
::
update_auto_increment
()
{
ulonglong
nr
,
nb_reserved_values
;
...
...
@@ -3056,8 +3075,7 @@ int handler::update_auto_increment()
enum
enum_check_fields
save_count_cuted_fields
;
DBUG_ENTER
(
"handler::update_auto_increment"
);
// ALTER TABLE ... ADD COLUMN ... AUTO_INCREMENT
if
(
thd
->
lex
->
sql_command
==
SQLCOM_ALTER_TABLE
)
if
(
thd
->
lex
->
sql_command
==
SQLCOM_ALTER_TABLE
&&
is_add_auto_increment
(
thd
))
{
if
(
table
->
versioned
())
{
...
...
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