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
5703883b
Commit
5703883b
authored
Dec 20, 2013
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a session variable that controls whether or not alter table errors are printed to stderr
parent
c7adb49b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
storage/tokudb/ha_tokudb_alter_56.cc
storage/tokudb/ha_tokudb_alter_56.cc
+6
-6
storage/tokudb/hatoku_hton.h
storage/tokudb/hatoku_hton.h
+8
-0
No files found.
storage/tokudb/ha_tokudb_alter_56.cc
View file @
5703883b
...
...
@@ -216,7 +216,7 @@ static bool change_length_is_supported(TABLE *table, TABLE *altered_table, Alter
static
bool
change_type_is_supported
(
TABLE
*
table
,
TABLE
*
altered_table
,
Alter_inplace_info
*
ha_alter_info
,
tokudb_alter_ctx
*
ctx
);
// The ha_alter_info->handler_flags can not be trusted. This function maps the bogus handler flags to something we like.
static
ulong
fix_handler_flags
(
TABLE
*
table
,
TABLE
*
altered_table
,
Alter_inplace_info
*
ha_alter_info
)
{
static
ulong
fix_handler_flags
(
T
HD
*
thd
,
T
ABLE
*
table
,
TABLE
*
altered_table
,
Alter_inplace_info
*
ha_alter_info
)
{
ulong
handler_flags
=
ha_alter_info
->
handler_flags
;
// workaround for fill_alter_inplace_info bug (#5193)
...
...
@@ -225,7 +225,7 @@ static ulong fix_handler_flags(TABLE *table, TABLE *altered_table, Alter_inplace
// column addition later.
if
(
handler_flags
&
(
Alter_inplace_info
::
ADD_COLUMN
+
Alter_inplace_info
::
DROP_COLUMN
))
{
if
(
handler_flags
&
(
Alter_inplace_info
::
ADD_INDEX
+
Alter_inplace_info
::
DROP_INDEX
))
{
if
(
tables_have_same_keys
(
table
,
altered_table
,
false
,
false
))
{
if
(
tables_have_same_keys
(
table
,
altered_table
,
THDVAR
(
thd
,
alter_print_error
)
!=
0
,
false
))
{
handler_flags
&=
~
(
Alter_inplace_info
::
ADD_INDEX
+
Alter_inplace_info
::
DROP_INDEX
);
}
}
...
...
@@ -294,7 +294,7 @@ enum_alter_inplace_result ha_tokudb::check_if_supported_inplace_alter(TABLE *alt
// setup context
tokudb_alter_ctx
*
ctx
=
new
tokudb_alter_ctx
;
ha_alter_info
->
handler_ctx
=
ctx
;
ctx
->
handler_flags
=
fix_handler_flags
(
table
,
altered_table
,
ha_alter_info
);
ctx
->
handler_flags
=
fix_handler_flags
(
t
hd
,
t
able
,
altered_table
,
ha_alter_info
);
ctx
->
table_kc_info
=
&
share
->
kc_info
;
ctx
->
altered_table_kc_info
=
&
ctx
->
altered_table_kc_info_base
;
memset
(
ctx
->
altered_table_kc_info
,
0
,
sizeof
(
KEY_AND_COL_INFO
));
...
...
@@ -306,7 +306,7 @@ enum_alter_inplace_result ha_tokudb::check_if_supported_inplace_alter(TABLE *alt
if
(
only_flags
(
ctx
->
handler_flags
,
Alter_inplace_info
::
DROP_INDEX
+
Alter_inplace_info
::
DROP_UNIQUE_INDEX
+
Alter_inplace_info
::
ADD_INDEX
+
Alter_inplace_info
::
ADD_UNIQUE_INDEX
))
{
if
((
ha_alter_info
->
index_add_count
>
0
||
ha_alter_info
->
index_drop_count
>
0
)
&&
!
tables_have_same_keys
(
table
,
altered_table
,
false
,
false
)
&&
!
tables_have_same_keys
(
table
,
altered_table
,
THDVAR
(
thd
,
alter_print_error
)
!=
0
,
false
)
&&
is_disjoint_add_drop
(
ha_alter_info
))
{
if
(
ctx
->
handler_flags
&
(
Alter_inplace_info
::
DROP_INDEX
+
Alter_inplace_info
::
DROP_UNIQUE_INDEX
))
{
...
...
@@ -413,14 +413,14 @@ enum_alter_inplace_result ha_tokudb::check_if_supported_inplace_alter(TABLE *alt
// alter auto_increment
if
(
only_flags
(
create_info
->
used_fields
,
HA_CREATE_USED_AUTO
))
{
// do a sanity check that the table is what we think it is
if
(
tables_have_same_keys_and_columns
(
table
,
altered_table
,
true
))
{
if
(
tables_have_same_keys_and_columns
(
table
,
altered_table
,
THDVAR
(
thd
,
alter_print_error
)
!=
0
))
{
result
=
HA_ALTER_INPLACE_EXCLUSIVE_LOCK
;
}
}
// alter row_format
else
if
(
only_flags
(
create_info
->
used_fields
,
HA_CREATE_USED_ROW_FORMAT
))
{
// do a sanity check that the table is what we think it is
if
(
tables_have_same_keys_and_columns
(
table
,
altered_table
,
true
))
{
if
(
tables_have_same_keys_and_columns
(
table
,
altered_table
,
THDVAR
(
thd
,
alter_print_error
)
!=
0
))
{
result
=
HA_ALTER_INPLACE_EXCLUSIVE_LOCK
;
}
}
...
...
storage/tokudb/hatoku_hton.h
View file @
5703883b
...
...
@@ -181,6 +181,14 @@ static bool get_create_index_online(THD* thd) {
return
(
THDVAR
(
thd
,
create_index_online
)
!=
0
);
}
static
MYSQL_THDVAR_BOOL
(
alter_print_error
,
0
,
"Print errors for alter table operations"
,
NULL
,
NULL
,
false
);
static
MYSQL_THDVAR_BOOL
(
disable_prefetching
,
0
,
"if on, prefetching disabled"
,
...
...
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