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
fcb6bb4b
Commit
fcb6bb4b
authored
Dec 10, 2018
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.3 into 10.4
parents
e5144f4b
a7251634
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
17 deletions
+31
-17
mysql-test/suite/rpl/t/rpl_gtid_crash.test
mysql-test/suite/rpl/t/rpl_gtid_crash.test
+1
-0
storage/innobase/fts/fts0fts.cc
storage/innobase/fts/fts0fts.cc
+4
-4
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+10
-5
storage/innobase/handler/handler0alter.cc
storage/innobase/handler/handler0alter.cc
+7
-4
storage/innobase/include/row0mysql.h
storage/innobase/include/row0mysql.h
+3
-1
storage/innobase/row/row0mysql.cc
storage/innobase/row/row0mysql.cc
+6
-3
No files found.
mysql-test/suite/rpl/t/rpl_gtid_crash.test
View file @
fcb6bb4b
...
@@ -162,6 +162,7 @@ EOF
...
@@ -162,6 +162,7 @@ EOF
wait
wait
EOF
EOF
START
SLAVE
;
START
SLAVE
;
--
error
0
,
2006
,
2013
SET
GLOBAL
debug_dbug
=
"+d,crash_commit_before"
;
SET
GLOBAL
debug_dbug
=
"+d,crash_commit_before"
;
--
connection
server_1
--
connection
server_1
...
...
storage/innobase/fts/fts0fts.cc
View file @
fcb6bb4b
...
@@ -1510,8 +1510,8 @@ fts_rename_one_aux_table(
...
@@ -1510,8 +1510,8 @@ fts_rename_one_aux_table(
table_new_name_len
-
new_db_name_len
);
table_new_name_len
-
new_db_name_len
);
fts_table_new_name
[
table_new_name_len
]
=
0
;
fts_table_new_name
[
table_new_name_len
]
=
0
;
return
(
row_rename_table_for_mysql
(
return
row_rename_table_for_mysql
(
fts_table_old_name
,
fts_table_new_name
,
trx
,
false
)
);
fts_table_old_name
,
fts_table_new_name
,
trx
,
false
,
false
);
}
}
/****************************************************************//**
/****************************************************************//**
...
@@ -6193,7 +6193,7 @@ fts_rename_one_aux_table_to_hex_format(
...
@@ -6193,7 +6193,7 @@ fts_rename_one_aux_table_to_hex_format(
}
}
error
=
row_rename_table_for_mysql
(
aux_table
->
name
,
new_name
,
trx
,
error
=
row_rename_table_for_mysql
(
aux_table
->
name
,
new_name
,
trx
,
FALSE
);
false
,
false
);
if
(
error
!=
DB_SUCCESS
)
{
if
(
error
!=
DB_SUCCESS
)
{
ib
::
warn
()
<<
"Failed to rename aux table '"
ib
::
warn
()
<<
"Failed to rename aux table '"
...
@@ -6332,7 +6332,7 @@ fts_rename_aux_tables_to_hex_format_low(
...
@@ -6332,7 +6332,7 @@ fts_rename_aux_tables_to_hex_format_low(
DICT_TF2_FLAG_UNSET
(
table
,
DICT_TF2_FTS_AUX_HEX_NAME
);
DICT_TF2_FLAG_UNSET
(
table
,
DICT_TF2_FTS_AUX_HEX_NAME
);
err
=
row_rename_table_for_mysql
(
table
->
name
.
m_name
,
err
=
row_rename_table_for_mysql
(
table
->
name
.
m_name
,
aux_table
->
name
,
aux_table
->
name
,
trx_bg
,
FALSE
);
trx_bg
,
false
,
false
);
trx_bg
->
dict_operation_lock_mode
=
0
;
trx_bg
->
dict_operation_lock_mode
=
0
;
dict_table_close
(
table
,
TRUE
,
FALSE
);
dict_table_close
(
table
,
TRUE
,
FALSE
);
...
...
storage/innobase/handler/ha_innodb.cc
View file @
fcb6bb4b
...
@@ -13053,6 +13053,7 @@ innobase_drop_database(
...
@@ -13053,6 +13053,7 @@ innobase_drop_database(
@param[in] from old table name
@param[in] from old table name
@param[in] to new table name
@param[in] to new table name
@param[in] commit whether to commit trx
@param[in] commit whether to commit trx
@param[in] use_fk whether to parse and enforce FOREIGN KEY constraints
@return DB_SUCCESS or error code */
@return DB_SUCCESS or error code */
inline
inline
dberr_t
dberr_t
...
@@ -13060,7 +13061,8 @@ innobase_rename_table(
...
@@ -13060,7 +13061,8 @@ innobase_rename_table(
trx_t
*
trx
,
trx_t
*
trx
,
const
char
*
from
,
const
char
*
from
,
const
char
*
to
,
const
char
*
to
,
bool
commit
=
true
)
bool
commit
,
bool
use_fk
)
{
{
dberr_t
error
;
dberr_t
error
;
char
norm_to
[
FN_REFLEN
];
char
norm_to
[
FN_REFLEN
];
...
@@ -13115,7 +13117,8 @@ innobase_rename_table(
...
@@ -13115,7 +13117,8 @@ innobase_rename_table(
goto
func_exit
;
goto
func_exit
;
}
}
error
=
row_rename_table_for_mysql
(
norm_from
,
norm_to
,
trx
,
commit
);
error
=
row_rename_table_for_mysql
(
norm_from
,
norm_to
,
trx
,
commit
,
use_fk
);
if
(
error
!=
DB_SUCCESS
)
{
if
(
error
!=
DB_SUCCESS
)
{
if
(
error
==
DB_TABLE_NOT_FOUND
if
(
error
==
DB_TABLE_NOT_FOUND
...
@@ -13140,7 +13143,8 @@ innobase_rename_table(
...
@@ -13140,7 +13143,8 @@ innobase_rename_table(
#endif
/* _WIN32 */
#endif
/* _WIN32 */
trx_start_if_not_started
(
trx
,
true
);
trx_start_if_not_started
(
trx
,
true
);
error
=
row_rename_table_for_mysql
(
error
=
row_rename_table_for_mysql
(
par_case_name
,
norm_to
,
trx
,
TRUE
);
par_case_name
,
norm_to
,
trx
,
true
,
false
);
}
}
}
}
...
@@ -13221,7 +13225,8 @@ int ha_innobase::truncate()
...
@@ -13221,7 +13225,8 @@ int ha_innobase::truncate()
trx_set_dict_operation
(
trx
,
TRX_DICT_OP_TABLE
);
trx_set_dict_operation
(
trx
,
TRX_DICT_OP_TABLE
);
row_mysql_lock_data_dictionary
(
trx
);
row_mysql_lock_data_dictionary
(
trx
);
int
err
=
convert_error_code_to_mysql
(
int
err
=
convert_error_code_to_mysql
(
innobase_rename_table
(
trx
,
ib_table
->
name
.
m_name
,
temp_name
,
false
),
innobase_rename_table
(
trx
,
ib_table
->
name
.
m_name
,
temp_name
,
false
,
false
),
ib_table
->
flags
,
m_user_thd
);
ib_table
->
flags
,
m_user_thd
);
if
(
err
)
{
if
(
err
)
{
trx_rollback_for_mysql
(
trx
);
trx_rollback_for_mysql
(
trx
);
...
@@ -13274,7 +13279,7 @@ ha_innobase::rename_table(
...
@@ -13274,7 +13279,7 @@ ha_innobase::rename_table(
++
trx
->
will_lock
;
++
trx
->
will_lock
;
trx_set_dict_operation
(
trx
,
TRX_DICT_OP_INDEX
);
trx_set_dict_operation
(
trx
,
TRX_DICT_OP_INDEX
);
dberr_t
error
=
innobase_rename_table
(
trx
,
from
,
to
);
dberr_t
error
=
innobase_rename_table
(
trx
,
from
,
to
,
true
,
true
);
DEBUG_SYNC
(
thd
,
"after_innobase_rename_table"
);
DEBUG_SYNC
(
thd
,
"after_innobase_rename_table"
);
...
...
storage/innobase/handler/handler0alter.cc
View file @
fcb6bb4b
...
@@ -5979,8 +5979,10 @@ prepare_inplace_alter_table_dict(
...
@@ -5979,8 +5979,10 @@ prepare_inplace_alter_table_dict(
user_table
,
ctx
->
trx
);
user_table
,
ctx
->
trx
);
if
(
ctx
->
need_rebuild
())
{
if
(
ctx
->
need_rebuild
())
{
ut_ad
(
!
ctx
->
new_table
->
cached
);
if
(
ctx
->
new_table
)
{
dict_mem_table_free
(
ctx
->
new_table
);
ut_ad
(
!
ctx
->
new_table
->
cached
);
dict_mem_table_free
(
ctx
->
new_table
);
}
ctx
->
new_table
=
ctx
->
old_table
;
ctx
->
new_table
=
ctx
->
old_table
;
}
}
...
@@ -6456,7 +6458,7 @@ prepare_inplace_alter_table_dict(
...
@@ -6456,7 +6458,7 @@ prepare_inplace_alter_table_dict(
break
;
break
;
case
DB_TABLESPACE_EXISTS
:
case
DB_TABLESPACE_EXISTS
:
my_error
(
ER_TABLESPACE_EXISTS
,
MYF
(
0
),
my_error
(
ER_TABLESPACE_EXISTS
,
MYF
(
0
),
ctx
->
new_table
->
name
.
m_name
);
altered_table
->
s
->
table_name
.
str
);
goto
new_table_failed
;
goto
new_table_failed
;
case
DB_DUPLICATE_KEY
:
case
DB_DUPLICATE_KEY
:
my_error
(
HA_ERR_TABLE_EXIST
,
MYF
(
0
),
my_error
(
HA_ERR_TABLE_EXIST
,
MYF
(
0
),
...
@@ -6464,12 +6466,13 @@ prepare_inplace_alter_table_dict(
...
@@ -6464,12 +6466,13 @@ prepare_inplace_alter_table_dict(
goto
new_table_failed
;
goto
new_table_failed
;
case
DB_UNSUPPORTED
:
case
DB_UNSUPPORTED
:
my_error
(
ER_UNSUPPORTED_EXTENSION
,
MYF
(
0
),
my_error
(
ER_UNSUPPORTED_EXTENSION
,
MYF
(
0
),
ctx
->
new_table
->
name
.
m_name
);
altered_table
->
s
->
table_name
.
str
);
goto
new_table_failed
;
goto
new_table_failed
;
default:
default:
my_error_innodb
(
error
,
table_name
,
flags
);
my_error_innodb
(
error
,
table_name
,
flags
);
new_table_failed:
new_table_failed:
DBUG_ASSERT
(
ctx
->
trx
!=
ctx
->
prebuilt
->
trx
);
DBUG_ASSERT
(
ctx
->
trx
!=
ctx
->
prebuilt
->
trx
);
ctx
->
new_table
=
NULL
;
goto
new_clustered_failed
;
goto
new_clustered_failed
;
}
}
...
...
storage/innobase/include/row0mysql.h
View file @
fcb6bb4b
...
@@ -483,7 +483,9 @@ row_rename_table_for_mysql(
...
@@ -483,7 +483,9 @@ row_rename_table_for_mysql(
const
char
*
old_name
,
/*!< in: old table name */
const
char
*
old_name
,
/*!< in: old table name */
const
char
*
new_name
,
/*!< in: new table name */
const
char
*
new_name
,
/*!< in: new table name */
trx_t
*
trx
,
/*!< in/out: transaction */
trx_t
*
trx
,
/*!< in/out: transaction */
bool
commit
)
/*!< in: whether to commit trx */
bool
commit
,
/*!< in: whether to commit trx */
bool
use_fk
)
/*!< in: whether to parse and enforce
FOREIGN KEY constraints */
MY_ATTRIBUTE
((
nonnull
,
warn_unused_result
));
MY_ATTRIBUTE
((
nonnull
,
warn_unused_result
));
/*********************************************************************//**
/*********************************************************************//**
...
...
storage/innobase/row/row0mysql.cc
View file @
fcb6bb4b
...
@@ -3520,7 +3520,8 @@ row_drop_table_for_mysql(
...
@@ -3520,7 +3520,8 @@ row_drop_table_for_mysql(
ib
::
info
()
<<
"Deferring DROP TABLE "
<<
table
->
name
ib
::
info
()
<<
"Deferring DROP TABLE "
<<
table
->
name
<<
"; renaming to "
<<
tmp_name
;
<<
"; renaming to "
<<
tmp_name
;
err
=
row_rename_table_for_mysql
(
err
=
row_rename_table_for_mysql
(
table
->
name
.
m_name
,
tmp_name
,
trx
,
false
);
table
->
name
.
m_name
,
tmp_name
,
trx
,
false
,
false
);
}
else
{
}
else
{
err
=
DB_SUCCESS
;
err
=
DB_SUCCESS
;
}
}
...
@@ -4145,7 +4146,9 @@ row_rename_table_for_mysql(
...
@@ -4145,7 +4146,9 @@ row_rename_table_for_mysql(
const
char
*
old_name
,
/*!< in: old table name */
const
char
*
old_name
,
/*!< in: old table name */
const
char
*
new_name
,
/*!< in: new table name */
const
char
*
new_name
,
/*!< in: new table name */
trx_t
*
trx
,
/*!< in/out: transaction */
trx_t
*
trx
,
/*!< in/out: transaction */
bool
commit
)
/*!< in: whether to commit trx */
bool
commit
,
/*!< in: whether to commit trx */
bool
use_fk
)
/*!< in: whether to parse and enforce
FOREIGN KEY constraints */
{
{
dict_table_t
*
table
=
NULL
;
dict_table_t
*
table
=
NULL
;
ibool
dict_locked
=
FALSE
;
ibool
dict_locked
=
FALSE
;
...
@@ -4249,7 +4252,7 @@ row_rename_table_for_mysql(
...
@@ -4249,7 +4252,7 @@ row_rename_table_for_mysql(
goto
funct_exit
;
goto
funct_exit
;
}
else
if
(
!
old_is_tmp
&&
new_is_tmp
)
{
}
else
if
(
use_fk
&&
!
old_is_tmp
&&
new_is_tmp
)
{
/* MySQL is doing an ALTER TABLE command and it renames the
/* MySQL is doing an ALTER TABLE command and it renames the
original table to a temporary table name. We want to preserve
original table to a temporary table name. We want to preserve
the original foreign key constraint definitions despite the
the original foreign key constraint definitions despite the
...
...
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