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
5482fa25
Commit
5482fa25
authored
Oct 14, 2018
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit_cache_rebuild(): Finish instant DROP COLUMN
parent
59b90720
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
24 deletions
+31
-24
storage/innobase/dict/dict0mem.cc
storage/innobase/dict/dict0mem.cc
+0
-23
storage/innobase/handler/handler0alter.cc
storage/innobase/handler/handler0alter.cc
+13
-0
storage/innobase/include/dict0mem.h
storage/innobase/include/dict0mem.h
+18
-1
No files found.
storage/innobase/dict/dict0mem.cc
View file @
5482fa25
...
...
@@ -1540,29 +1540,6 @@ void dict_table_t::serialise_columns(mem_heap_t* heap, dfield_t* field) const
}
}
/** Flag the column instantly dropped.
@param[in] not_null whether the column was NOT NULL
@param[in] len2 whether the length exceeds 255 bytes
@param[in] fixed the fixed length in bytes, or 0 */
inline
void
dict_col_t
::
set_dropped
(
bool
not_null
,
bool
len2
,
unsigned
fixed
)
{
DBUG_ASSERT
(
!
len2
||
!
fixed
);
prtype
=
not_null
?
DATA_NOT_NULL
|
DATA_BINARY_TYPE
:
DATA_BINARY_TYPE
;
if
(
fixed
)
{
mtype
=
DATA_FIXBINARY
;
len
=
fixed
;
}
else
{
mtype
=
DATA_BINARY
;
len
=
len2
?
65535
:
255
;
}
mbminlen
=
mbmaxlen
=
0
;
ind
=
DROPPED
;
ord_part
=
0
;
max_prefix
=
0
;
}
/** Reconstruct dropped or reordered columns.
@param[in] metadata data from serialise_columns()
@param[in] len length of the metadata, in bytes
...
...
storage/innobase/handler/handler0alter.cc
View file @
5482fa25
...
...
@@ -9606,6 +9606,19 @@ commit_cache_norebuild(
if
(
!
ctx
->
is_instant
())
{
innobase_rename_or_enlarge_columns_cache
(
ha_alter_info
,
table
,
ctx
->
new_table
);
}
else
if
(
ha_alter_info
->
handler_flags
&
ALTER_DROP_STORED_COLUMN
)
{
dict_index_t
*
index
=
dict_table_get_first_index
(
ctx
->
new_table
);
for
(
const
dict_field_t
*
f
=
index
->
fields
,
*
const
end
=
f
+
index
->
n_fields
;
f
!=
end
;
f
++
)
{
dict_col_t
&
c
=
*
f
->
col
;
if
(
c
.
is_dropped
())
{
c
.
set_dropped
(
!
c
.
is_nullable
(),
!
f
->
fixed_len
&&
c
.
len
>
255
,
f
->
fixed_len
);
}
}
}
if
(
ha_alter_info
->
handler_flags
&
ALTER_COLUMN_UNVERSIONED
)
{
...
...
storage/innobase/include/dict0mem.h
View file @
5482fa25
...
...
@@ -645,7 +645,24 @@ struct dict_col_t{
@param[in] not_null whether the column was NOT NULL
@param[in] len2 whether the length exceeds 255 bytes
@param[in] fixed_len the fixed length in bytes, or 0 */
inline
void
set_dropped
(
bool
not_null
,
bool
len2
,
unsigned
fixed
);
void
set_dropped
(
bool
not_null
,
bool
len2
,
unsigned
fixed
)
{
DBUG_ASSERT
(
!
len2
||
!
fixed
);
prtype
=
not_null
?
DATA_NOT_NULL
|
DATA_BINARY_TYPE
:
DATA_BINARY_TYPE
;
if
(
fixed
)
{
mtype
=
DATA_FIXBINARY
;
len
=
fixed
;
}
else
{
mtype
=
DATA_BINARY
;
len
=
len2
?
65535
:
255
;
}
mbminlen
=
mbmaxlen
=
0
;
ind
=
DROPPED
;
ord_part
=
0
;
max_prefix
=
0
;
}
/** @return whether the column was instantly dropped */
bool
is_dropped
()
const
{
return
ind
==
DROPPED
;
}
/** @return whether the column was instantly dropped
...
...
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