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
d46b3c99
Commit
d46b3c99
authored
Dec 03, 2018
by
Aleksey Midenkov
Committed by
Marko Mäkelä
Dec 28, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-17697 Broken versioning info after instant drop column
Closes #986
parent
cb2f36d3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
2 deletions
+63
-2
mysql-test/suite/versioning/r/online.result
mysql-test/suite/versioning/r/online.result
+11
-0
mysql-test/suite/versioning/t/online.test
mysql-test/suite/versioning/t/online.test
+24
-0
storage/innobase/handler/handler0alter.cc
storage/innobase/handler/handler0alter.cc
+26
-1
storage/innobase/include/dict0mem.h
storage/innobase/include/dict0mem.h
+2
-1
No files found.
mysql-test/suite/versioning/r/online.result
View file @
d46b3c99
...
@@ -124,5 +124,16 @@ alter table t add index idx(a), lock=none;
...
@@ -124,5 +124,16 @@ alter table t add index idx(a), lock=none;
alter table t drop column s, drop column e;
alter table t drop column s, drop column e;
alter table t drop system versioning, lock=none;
alter table t drop system versioning, lock=none;
ERROR 0A000: LOCK=NONE is not supported. Reason: Not implemented for system-versioned operations. Try LOCK=SHARED
ERROR 0A000: LOCK=NONE is not supported. Reason: Not implemented for system-versioned operations. Try LOCK=SHARED
#
# MDEV-17697 Broken versioning info after instant drop column
#
set @@system_versioning_alter_history= keep;
create or replace table t1 (a int, b int) with system versioning;
insert into t1 values (1, 1);
alter table t1 drop column b, algorithm=instant;
alter table t1 drop system versioning;
create or replace table t1 (a int, b int) with system versioning;
insert into t1 values (1, 1);
alter table t1 drop system versioning;
drop database test;
drop database test;
create database test;
create database test;
mysql-test/suite/versioning/t/online.test
View file @
d46b3c99
...
@@ -148,5 +148,29 @@ alter table t drop column s, drop column e;
...
@@ -148,5 +148,29 @@ alter table t drop column s, drop column e;
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter
table
t
drop
system
versioning
,
lock
=
none
;
alter
table
t
drop
system
versioning
,
lock
=
none
;
--
echo
#
--
echo
# MDEV-17697 Broken versioning info after instant drop column
--
echo
#
set
@@
system_versioning_alter_history
=
keep
;
create
or
replace
table
t1
(
a
int
,
b
int
)
with
system
versioning
;
insert
into
t1
values
(
1
,
1
);
alter
table
t1
drop
column
b
,
algorithm
=
instant
;
alter
table
t1
drop
system
versioning
;
create
or
replace
table
t1
(
a
int
,
b
int
)
with
system
versioning
;
insert
into
t1
values
(
1
,
1
);
if
(
$have_debug
)
{
--
disable_query_log
--
disable_result_log
set
debug_dbug
=
'+d,ib_commit_inplace_fail_1'
;
--
error
ER_INTERNAL_ERROR
alter
table
t1
drop
column
b
,
algorithm
=
instant
;
set
debug_dbug
=
default
;
--
enable_query_log
--
enable_result_log
}
alter
table
t1
drop
system
versioning
;
drop
database
test
;
drop
database
test
;
create
database
test
;
create
database
test
;
storage/innobase/handler/handler0alter.cc
View file @
d46b3c99
...
@@ -538,6 +538,14 @@ inline bool dict_table_t::instant_column(const dict_table_t& table,
...
@@ -538,6 +538,14 @@ inline bool dict_table_t::instant_column(const dict_table_t& table,
&
~
(
DATA_NOT_NULL
|
DATA_VERSIONED
)));
&
~
(
DATA_NOT_NULL
|
DATA_VERSIONED
)));
DBUG_ASSERT
(
c
.
mtype
==
o
->
mtype
);
DBUG_ASSERT
(
c
.
mtype
==
o
->
mtype
);
DBUG_ASSERT
(
c
.
len
>=
o
->
len
);
DBUG_ASSERT
(
c
.
len
>=
o
->
len
);
if
(
o
->
vers_sys_start
())
{
ut_ad
(
o
->
ind
==
vers_start
);
vers_start
=
i
;
}
else
if
(
o
->
vers_sys_end
())
{
ut_ad
(
o
->
ind
==
vers_end
);
vers_end
=
i
;
}
continue
;
continue
;
}
}
...
@@ -786,6 +794,16 @@ inline void dict_table_t::rollback_instant(
...
@@ -786,6 +794,16 @@ inline void dict_table_t::rollback_instant(
n_v_def
=
n_v_cols
=
old_n_v_cols
;
n_v_def
=
n_v_cols
=
old_n_v_cols
;
n_t_def
=
n_t_cols
=
n_cols
+
n_v_cols
;
n_t_def
=
n_t_cols
=
n_cols
+
n_v_cols
;
if
(
versioned
())
{
for
(
unsigned
i
=
0
;
i
<
n_cols
;
++
i
)
{
if
(
cols
[
i
].
vers_sys_start
())
{
vers_start
=
i
;
}
else
if
(
cols
[
i
].
vers_sys_end
())
{
vers_end
=
i
;
}
}
}
index
->
fields
=
old_fields
;
index
->
fields
=
old_fields
;
mtr
.
commit
();
mtr
.
commit
();
...
@@ -4116,7 +4134,7 @@ innobase_build_col_map(
...
@@ -4116,7 +4134,7 @@ innobase_build_col_map(
Alter_inplace_info
*
ha_alter_info
,
Alter_inplace_info
*
ha_alter_info
,
const
TABLE
*
altered_table
,
const
TABLE
*
altered_table
,
const
TABLE
*
table
,
const
TABLE
*
table
,
const
dict_table_t
*
new_table
,
dict_table_t
*
new_table
,
const
dict_table_t
*
old_table
,
const
dict_table_t
*
old_table
,
dtuple_t
*
defaults
,
dtuple_t
*
defaults
,
mem_heap_t
*
heap
)
mem_heap_t
*
heap
)
...
@@ -4190,6 +4208,13 @@ innobase_build_col_map(
...
@@ -4190,6 +4208,13 @@ innobase_build_col_map(
}
}
col_map
[
old_i
-
num_old_v
]
=
i
;
col_map
[
old_i
-
num_old_v
]
=
i
;
if
(
old_table
->
versioned
())
{
if
(
old_i
==
old_table
->
vers_start
)
{
new_table
->
vers_start
=
i
;
}
else
if
(
old_i
==
old_table
->
vers_end
)
{
new_table
->
vers_end
=
i
;
}
}
goto
found_col
;
goto
found_col
;
}
}
}
}
...
...
storage/innobase/include/dict0mem.h
View file @
d46b3c99
...
@@ -618,7 +618,8 @@ struct dict_col_t{
...
@@ -618,7 +618,8 @@ struct dict_col_t{
ut_ad
(
mtype
==
DATA_INT
||
mtype
==
DATA_FIXBINARY
);
ut_ad
(
mtype
==
DATA_INT
||
mtype
==
DATA_FIXBINARY
);
return
mtype
==
DATA_INT
;
return
mtype
==
DATA_INT
;
}
}
/** @return whether this is system versioned */
/** @return whether this user column (not row_start, row_end)
has System Versioning property */
bool
is_versioned
()
const
{
return
!
(
~
prtype
&
DATA_VERSIONED
);
}
bool
is_versioned
()
const
{
return
!
(
~
prtype
&
DATA_VERSIONED
);
}
/** @return whether this is the system version start */
/** @return whether this is the system version start */
bool
vers_sys_start
()
const
bool
vers_sys_start
()
const
...
...
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