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
90a13c1a
Commit
90a13c1a
authored
Sep 27, 2017
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow ADD COLUMN, DROP INDEX
parent
94fb5f41
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
10 deletions
+25
-10
storage/innobase/handler/handler0alter.cc
storage/innobase/handler/handler0alter.cc
+25
-10
No files found.
storage/innobase/handler/handler0alter.cc
View file @
90a13c1a
...
...
@@ -269,7 +269,7 @@ struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx
DBUG_ASSERT
(
num_to_add_index
==
0
);
DBUG_ASSERT
(
new_table
->
n_cols
>
old_table
->
n_cols
);
DBUG_ASSERT
(
UT_LIST_GET_LEN
(
old_table
->
indexes
)
=
=
UT_LIST_GET_LEN
(
new_table
->
indexes
));
>
=
UT_LIST_GET_LEN
(
new_table
->
indexes
));
instant_table
=
new_table
;
instant_table
->
remove_stub_from_cache
();
...
...
@@ -288,11 +288,18 @@ struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx
index
->
prepare_instant_copy
(
*
old_index
,
true
);
while
((
old_index
=
dict_table_get_next_index
(
old_index
)))
{
index
=
dict_table_get_next_index
(
index
);
index
->
prepare_instant_copy
(
*
old_index
);
for
(
index
=
dict_table_get_first_index
(
instant_table
);
(
index
=
dict_table_get_next_index
(
index
))
!=
0
;
)
{
if
(
!
strcmp
(
old_index
->
name
,
index
->
name
))
{
index
->
prepare_instant_copy
(
*
old_index
);
break
;
}
}
DBUG_ASSERT
(
index
||
num_to_drop_index
);
}
DBUG_ASSERT
(
!
dict_table_get_next_index
(
index
));
new_table
=
old_table
;
}
...
...
@@ -387,17 +394,23 @@ struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx
}
dict_index_t
*
index
=
dict_table_get_first_index
(
old_table
);
const
dict_index_t
*
new_inde
x
=
dict_table_get_first_index
(
const
dict_index_t
*
id
x
=
dict_table_get_first_index
(
instant_table
);
index
->
commit_instant_copy
(
*
new_inde
x
);
index
->
commit_instant_copy
(
*
id
x
);
DBUG_ASSERT
(
index
->
is_instant
());
while
((
index
=
dict_table_get_next_index
(
index
)))
{
new_index
=
dict_table_get_next_index
(
new_index
);
index
->
commit_instant_copy
(
*
new_index
);
for
(
idx
=
dict_table_get_first_index
(
instant_table
);
(
idx
=
dict_table_get_next_index
(
idx
))
!=
NULL
;
)
{
if
(
!
strcmp
(
index
->
name
,
idx
->
name
))
{
index
->
commit_instant_copy
(
*
idx
);
break
;
}
}
DBUG_ASSERT
(
idx
||
num_to_drop_index
);
}
DBUG_ASSERT
(
!
dict_table_get_next_index
(
new_index
));
dict_mem_table_free
(
instant_table
);
instant_table
=
NULL
;
DBUG_ASSERT
(
!
is_instant
());
...
...
@@ -5336,7 +5349,9 @@ prepare_inplace_alter_table_dict(
}
#if 0 // FIXME: enable instant ADD COLUMN
/* FIXME: allow ADD INDEX together with instant ADD COLUMN */
/* FIXME: allow ADD INDEX together with instant ADD COLUMN.
Note that the index-name-matching in ctx->prepare_instant()
and ctx->commit_instant() would have to be replaced too! */
DBUG_ASSERT(ha_alter_info->key_count
+ dict_index_is_auto_gen_clust(
dict_table_get_first_index(ctx->new_table))
...
...
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