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
30c965f8
Commit
30c965f8
authored
Jul 28, 2023
by
Nikita Malyavin
Committed by
Sergei Golubchik
Aug 15, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-31777 ER_GET_ERRNO upon online alter on CONNECT table
Forbid Online for CONNECT.
parent
44ca37ef
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
17 deletions
+42
-17
sql/handler.h
sql/handler.h
+4
-1
sql/sql_table.cc
sql/sql_table.cc
+21
-15
storage/connect/ha_connect.cc
storage/connect/ha_connect.cc
+1
-1
storage/connect/mysql-test/connect/r/alter.result
storage/connect/mysql-test/connect/r/alter.result
+8
-0
storage/connect/mysql-test/connect/t/alter.test
storage/connect/mysql-test/connect/t/alter.test
+8
-0
No files found.
sql/handler.h
View file @
30c965f8
...
...
@@ -371,7 +371,10 @@ enum chf_create_flags {
/* Implements SELECT ... FOR UPDATE SKIP LOCKED */
#define HA_CAN_SKIP_LOCKED (1ULL << 61)
#define HA_LAST_TABLE_FLAG HA_CAN_SKIP_LOCKED
/* This engine is not compatible with Online ALTER TABLE */
#define HA_NO_ONLINE_ALTER (1ULL << 62)
#define HA_LAST_TABLE_FLAG HA_NO_ONLINE_ALTER
/* bits in index_flags(index_number) for what you can do with index */
...
...
sql/sql_table.cc
View file @
30c965f8
...
...
@@ -9908,7 +9908,8 @@ bool online_alter_check_autoinc(const THD *thd, const Alter_info *alter_info,
static
const
char
*
online_alter_check_supported
(
const
THD
*
thd
,
const
Alter_info
*
alter_info
,
const
TABLE
*
table
,
bool
*
online
)
const
TABLE
*
table
,
const
TABLE
*
new_table
,
bool
*
online
)
{
DBUG_ASSERT
(
*
online
);
...
...
@@ -9916,6 +9917,10 @@ const char *online_alter_check_supported(const THD *thd,
if
(
!*
online
)
return
NULL
;
*
online
=
(
new_table
->
file
->
ha_table_flags
()
&
HA_NO_ONLINE_ALTER
)
==
0
;
if
(
!*
online
)
return
new_table
->
file
->
engine_name
()
->
str
;
*
online
=
table
->
s
->
sequence
==
NULL
;
if
(
!*
online
)
return
"SEQUENCE"
;
...
...
@@ -11023,20 +11028,6 @@ do_continue:;
if
(
fk_prepare_copy_alter_table
(
thd
,
table
,
alter_info
,
&
alter_ctx
))
goto
err_new_table_cleanup
;
if
(
online
)
{
const
char
*
reason
=
online_alter_check_supported
(
thd
,
alter_info
,
table
,
&
online
);
if
(
reason
&&
alter_info
->
requested_lock
==
Alter_info
::
ALTER_TABLE_LOCK_NONE
)
{
DBUG_ASSERT
(
!
online
);
my_error
(
ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
,
MYF
(
0
),
"LOCK=NONE"
,
reason
,
"LOCK=SHARED"
);
goto
err_new_table_cleanup
;
}
}
if
(
!
table
->
s
->
tmp_table
)
{
// If EXCLUSIVE lock is requested, upgrade already.
...
...
@@ -11108,6 +11099,21 @@ do_continue:;
thd
->
session_tracker
.
state_change
.
mark_as_changed
(
thd
);
}
if
(
online
)
{
const
char
*
reason
=
online_alter_check_supported
(
thd
,
alter_info
,
table
,
new_table
,
&
online
);
if
(
reason
&&
alter_info
->
requested_lock
==
Alter_info
::
ALTER_TABLE_LOCK_NONE
)
{
DBUG_ASSERT
(
!
online
);
my_error
(
ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
,
MYF
(
0
),
"LOCK=NONE"
,
reason
,
"LOCK=SHARED"
);
goto
err_new_table_cleanup
;
}
}
/*
Note: In case of MERGE table, we do not attach children. We do not
copy data for MERGE tables. Only the children have data.
...
...
storage/connect/ha_connect.cc
View file @
30c965f8
...
...
@@ -1174,7 +1174,7 @@ ulonglong ha_connect::table_flags() const
// HA_FAST_KEY_READ | causes error when sorting (???)
HA_NO_TRANSACTIONS
|
HA_DUPLICATE_KEY_NOT_IN_ORDER
|
HA_NO_BLOBS
|
HA_MUST_USE_TABLE_CONDITION_PUSHDOWN
|
HA_REUSES_FILE_NAMES
;
HA_REUSES_FILE_NAMES
|
HA_NO_ONLINE_ALTER
;
ha_connect
*
hp
=
(
ha_connect
*
)
this
;
PTOS
pos
=
hp
->
GetTableOptionStruct
();
...
...
storage/connect/mysql-test/connect/r/alter.result
View file @
30c965f8
...
...
@@ -272,3 +272,11 @@ line
2Two
3Three
DROP TABLE t1, t2;
# MDEV-31777 ER_GET_ERRNO upon online alter with concurrent DML on
# CONNECT table
CREATE TABLE t (a INT) ENGINE=CONNECT TABLE_TYPE=DOS;
Warnings:
Warning 1105 No file name. Table will use t.dos
ALTER TABLE t FORCE, ALGORITHM=COPY, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: CONNECT. Try LOCK=SHARED
DROP TABLE t;
storage/connect/mysql-test/connect/t/alter.test
View file @
30c965f8
...
...
@@ -133,6 +133,14 @@ SELECT * from t2;
DROP
TABLE
t1
,
t2
;
--
echo
# MDEV-31777 ER_GET_ERRNO upon online alter with concurrent DML on
--
echo
# CONNECT table
CREATE
TABLE
t
(
a
INT
)
ENGINE
=
CONNECT
TABLE_TYPE
=
DOS
;
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
ALTER
TABLE
t
FORCE
,
ALGORITHM
=
COPY
,
LOCK
=
NONE
;
DROP
TABLE
t
;
#
# Clean up
#
...
...
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