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
8250cec9
Commit
8250cec9
authored
Oct 05, 2018
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ha_innobase_inplace_ctx::prepare_instant(): Swap with the correct column
parent
cf703bc5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
12 deletions
+30
-12
storage/innobase/handler/handler0alter.cc
storage/innobase/handler/handler0alter.cc
+30
-12
No files found.
storage/innobase/handler/handler0alter.cc
View file @
8250cec9
...
@@ -365,15 +365,20 @@ struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx
...
@@ -365,15 +365,20 @@ struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx
sizeof
(
dict_instant_t
)))
sizeof
(
dict_instant_t
)))
dict_instant_t
();
dict_instant_t
();
instant_table
->
instant
->
n_dropped
=
n_drop
;
instant_table
->
instant
->
n_dropped
=
n_drop
;
instant_table
->
instant
->
dropped
if
(
n_drop
)
{
=
static_cast
<
dict_col_t
*>
(
instant_table
->
instant
->
dropped
mem_heap_alloc
(
instant_table
->
heap
,
=
static_cast
<
dict_col_t
*>
(
n_drop
mem_heap_alloc
(
*
sizeof
(
dict_col_t
)));
instant_table
->
heap
,
if
(
n_old_drop
)
{
n_drop
memcpy
(
instant_table
->
instant
->
dropped
,
*
sizeof
(
dict_col_t
)));
old_table
->
instant
->
dropped
,
if
(
n_old_drop
)
{
n_old_drop
*
sizeof
(
dict_col_t
));
memcpy
(
instant_table
->
instant
->
dropped
,
old_table
->
instant
->
dropped
,
n_old_drop
*
sizeof
(
dict_col_t
));
}
}
else
{
instant_table
->
instant
->
dropped
=
NULL
;
}
}
unsigned
d
=
n_old_drop
;
unsigned
d
=
n_old_drop
;
...
@@ -446,10 +451,23 @@ struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx
...
@@ -446,10 +451,23 @@ struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx
!=
col_ind
)
{
!=
col_ind
)
{
/* The fields for instantly
/* The fields for instantly
added columns must be placed
added columns must be placed
last in the clustered index. */
last in the clustered index.
Keep pre-existing fields in
the same position. */
uint
k
;
for
(
k
=
j
+
1
;
k
<
instant
->
n_fields
;
k
++
)
{
if
(
instant
->
fields
[
k
]
.
col
->
ind
==
col_ind
)
{
goto
found_j
;
}
}
DBUG_ASSERT
(
!
"no such col"
);
found_j:
std
::
swap
(
instant
->
fields
[
j
],
std
::
swap
(
instant
->
fields
[
j
],
instant
->
fields
[
instant
->
fields
[
k
]);
j
+
1
]);
}
}
DBUG_ASSERT
(
instant
->
fields
[
j
].
col
->
ind
DBUG_ASSERT
(
instant
->
fields
[
j
].
col
->
ind
==
col_ind
);
==
col_ind
);
...
...
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