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
4c21c367
Commit
4c21c367
authored
Jul 30, 2018
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge InnoDB MySQL 5.6.41 to 10.0
parents
91181b22
29ddc6e9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
117 additions
and
73 deletions
+117
-73
storage/innobase/fts/fts0fts.cc
storage/innobase/fts/fts0fts.cc
+22
-35
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+36
-1
storage/innobase/include/univ.i
storage/innobase/include/univ.i
+1
-1
storage/xtradb/fts/fts0fts.cc
storage/xtradb/fts/fts0fts.cc
+22
-35
storage/xtradb/handler/ha_innodb.cc
storage/xtradb/handler/ha_innodb.cc
+36
-1
No files found.
storage/innobase/fts/fts0fts.cc
View file @
4c21c367
/*****************************************************************************
Copyright (c) 2011, 201
7
, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2011, 201
8
, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2016, 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
...
...
@@ -869,37 +869,28 @@ fts_drop_index(
err
=
fts_drop_index_tables
(
trx
,
index
);
for
(;;)
{
bool
retry
=
false
;
if
(
index
->
index_fts_syncing
)
{
retry
=
true
;
}
if
(
!
retry
){
fts_free
(
table
);
break
;
}
while
(
index
->
index_fts_syncing
&&
!
trx_is_interrupted
(
trx
))
{
DICT_BG_YIELD
(
trx
);
}
fts_free
(
table
);
return
(
err
);
}
for
(;;)
{
bool
retry
=
false
;
if
(
index
->
index_fts_syncing
)
{
retry
=
true
;
}
if
(
!
retry
){
current_doc_id
=
table
->
fts
->
cache
->
next_doc_id
;
first_doc_id
=
table
->
fts
->
cache
->
first_doc_id
;
fts_cache_clear
(
table
->
fts
->
cache
);
fts_cache_destroy
(
table
->
fts
->
cache
);
table
->
fts
->
cache
=
fts_cache_create
(
table
);
table
->
fts
->
cache
->
next_doc_id
=
current_doc_id
;
table
->
fts
->
cache
->
first_doc_id
=
first_doc_id
;
break
;
}
while
(
index
->
index_fts_syncing
&&
!
trx_is_interrupted
(
trx
))
{
DICT_BG_YIELD
(
trx
);
}
current_doc_id
=
table
->
fts
->
cache
->
next_doc_id
;
first_doc_id
=
table
->
fts
->
cache
->
first_doc_id
;
fts_cache_clear
(
table
->
fts
->
cache
);
fts_cache_destroy
(
table
->
fts
->
cache
);
table
->
fts
->
cache
=
fts_cache_create
(
table
);
table
->
fts
->
cache
->
next_doc_id
=
current_doc_id
;
table
->
fts
->
cache
->
first_doc_id
=
first_doc_id
;
}
else
{
fts_cache_t
*
cache
=
table
->
fts
->
cache
;
fts_index_cache_t
*
index_cache
;
...
...
@@ -909,18 +900,14 @@ fts_drop_index(
index_cache
=
fts_find_index_cache
(
cache
,
index
);
if
(
index_cache
!=
NULL
)
{
for
(;;)
{
bool
retry
=
false
;
if
(
index
->
index_fts_syncing
)
{
retry
=
true
;
}
if
(
!
retry
&&
index_cache
->
words
)
{
fts_words_free
(
index_cache
->
words
);
rbt_free
(
index_cache
->
words
);
break
;
}
while
(
index
->
index_fts_syncing
&&
!
trx_is_interrupted
(
trx
))
{
DICT_BG_YIELD
(
trx
);
}
if
(
index_cache
->
words
)
{
fts_words_free
(
index_cache
->
words
);
rbt_free
(
index_cache
->
words
);
}
ib_vector_remove
(
cache
->
indexes
,
*
(
void
**
)
index_cache
);
}
...
...
storage/innobase/handler/ha_innodb.cc
View file @
4c21c367
...
...
@@ -10877,6 +10877,7 @@ static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
innobase_rename_table
(
/*==================*/
THD
*
thd
,
/*!< Connection thread handle */
trx_t
*
trx
,
/*!< in: transaction */
const
char
*
from
,
/*!< in: old name of the table */
const
char
*
to
)
/*!< in: new name of the table */
...
...
@@ -10902,6 +10903,36 @@ innobase_rename_table(
row_mysql_lock_data_dictionary
(
trx
);
dict_table_t
*
table
=
dict_table_open_on_name
(
norm_from
,
TRUE
,
FALSE
,
DICT_ERR_IGNORE_NONE
);
/* Since DICT_BG_YIELD has sleep for 250 milliseconds,
Convert lock_wait_timeout unit from second to 250 milliseconds */
long
int
lock_wait_timeout
=
thd_lock_wait_timeout
(
thd
)
*
4
;
if
(
table
!=
NULL
)
{
for
(
dict_index_t
*
index
=
dict_table_get_first_index
(
table
);
index
!=
NULL
;
index
=
dict_table_get_next_index
(
index
))
{
if
(
index
->
type
&
DICT_FTS
)
{
/* Found */
while
(
index
->
index_fts_syncing
&&
!
trx_is_interrupted
(
trx
)
&&
(
lock_wait_timeout
--
)
>
0
)
{
DICT_BG_YIELD
(
trx
);
}
}
}
dict_table_close
(
table
,
TRUE
,
FALSE
);
}
/* FTS sync is in progress. We shall timeout this operation */
if
(
lock_wait_timeout
<
0
)
{
error
=
DB_LOCK_WAIT_TIMEOUT
;
row_mysql_unlock_data_dictionary
(
trx
);
DBUG_RETURN
(
error
);
}
/* Transaction must be flagged as a locking transaction or it hasn't
been started yet. */
...
...
@@ -11011,7 +11042,7 @@ ha_innobase::rename_table(
++
trx
->
will_lock
;
trx_set_dict_operation
(
trx
,
TRX_DICT_OP_INDEX
);
error
=
innobase_rename_table
(
trx
,
from
,
to
);
error
=
innobase_rename_table
(
t
hd
,
t
rx
,
from
,
to
);
DEBUG_SYNC
(
thd
,
"after_innobase_rename_table"
);
...
...
@@ -11055,6 +11086,10 @@ ha_innobase::rename_table(
my_error
(
ER_TABLE_EXISTS_ERROR
,
MYF
(
0
),
to
);
error
=
DB_ERROR
;
}
else
if
(
error
==
DB_LOCK_WAIT_TIMEOUT
)
{
my_error
(
ER_LOCK_WAIT_TIMEOUT
,
MYF
(
0
),
to
);
error
=
DB_LOCK_WAIT
;
}
DBUG_RETURN
(
convert_error_code_to_mysql
(
error
,
0
,
NULL
));
...
...
storage/innobase/include/univ.i
View file @
4c21c367
...
...
@@ -45,7 +45,7 @@ Created 1/20/1994 Heikki Tuuri
#
define
INNODB_VERSION_MAJOR
5
#
define
INNODB_VERSION_MINOR
6
#
define
INNODB_VERSION_BUGFIX
4
0
#
define
INNODB_VERSION_BUGFIX
4
1
/* The following is the InnoDB version as shown in
SELECT plugin_version FROM information_schema.plugins;
...
...
storage/xtradb/fts/fts0fts.cc
View file @
4c21c367
/*****************************************************************************
Copyright (c) 2011, 201
7
, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2011, 201
8
, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2016, 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
...
...
@@ -869,37 +869,28 @@ fts_drop_index(
err
=
fts_drop_index_tables
(
trx
,
index
);
for
(;;)
{
bool
retry
=
false
;
if
(
index
->
index_fts_syncing
)
{
retry
=
true
;
}
if
(
!
retry
){
fts_free
(
table
);
break
;
}
while
(
index
->
index_fts_syncing
&&
!
trx_is_interrupted
(
trx
))
{
DICT_BG_YIELD
(
trx
);
}
fts_free
(
table
);
return
(
err
);
}
for
(;;)
{
bool
retry
=
false
;
if
(
index
->
index_fts_syncing
)
{
retry
=
true
;
}
if
(
!
retry
){
current_doc_id
=
table
->
fts
->
cache
->
next_doc_id
;
first_doc_id
=
table
->
fts
->
cache
->
first_doc_id
;
fts_cache_clear
(
table
->
fts
->
cache
);
fts_cache_destroy
(
table
->
fts
->
cache
);
table
->
fts
->
cache
=
fts_cache_create
(
table
);
table
->
fts
->
cache
->
next_doc_id
=
current_doc_id
;
table
->
fts
->
cache
->
first_doc_id
=
first_doc_id
;
break
;
}
while
(
index
->
index_fts_syncing
&&
!
trx_is_interrupted
(
trx
))
{
DICT_BG_YIELD
(
trx
);
}
current_doc_id
=
table
->
fts
->
cache
->
next_doc_id
;
first_doc_id
=
table
->
fts
->
cache
->
first_doc_id
;
fts_cache_clear
(
table
->
fts
->
cache
);
fts_cache_destroy
(
table
->
fts
->
cache
);
table
->
fts
->
cache
=
fts_cache_create
(
table
);
table
->
fts
->
cache
->
next_doc_id
=
current_doc_id
;
table
->
fts
->
cache
->
first_doc_id
=
first_doc_id
;
}
else
{
fts_cache_t
*
cache
=
table
->
fts
->
cache
;
fts_index_cache_t
*
index_cache
;
...
...
@@ -909,18 +900,14 @@ fts_drop_index(
index_cache
=
fts_find_index_cache
(
cache
,
index
);
if
(
index_cache
!=
NULL
)
{
for
(;;)
{
bool
retry
=
false
;
if
(
index
->
index_fts_syncing
)
{
retry
=
true
;
}
if
(
!
retry
&&
index_cache
->
words
)
{
fts_words_free
(
index_cache
->
words
);
rbt_free
(
index_cache
->
words
);
break
;
}
while
(
index
->
index_fts_syncing
&&
!
trx_is_interrupted
(
trx
))
{
DICT_BG_YIELD
(
trx
);
}
if
(
index_cache
->
words
)
{
fts_words_free
(
index_cache
->
words
);
rbt_free
(
index_cache
->
words
);
}
ib_vector_remove
(
cache
->
indexes
,
*
(
void
**
)
index_cache
);
}
...
...
storage/xtradb/handler/ha_innodb.cc
View file @
4c21c367
...
...
@@ -11695,6 +11695,7 @@ static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
innobase_rename_table
(
/*==================*/
THD
*
thd
,
/*!< Connection thread handle */
trx_t
*
trx
,
/*!< in: transaction */
const
char
*
from
,
/*!< in: old name of the table */
const
char
*
to
)
/*!< in: new name of the table */
...
...
@@ -11720,6 +11721,36 @@ innobase_rename_table(
row_mysql_lock_data_dictionary
(
trx
);
dict_table_t
*
table
=
dict_table_open_on_name
(
norm_from
,
TRUE
,
FALSE
,
DICT_ERR_IGNORE_NONE
);
/* Since DICT_BG_YIELD has sleep for 250 milliseconds,
Convert lock_wait_timeout unit from second to 250 milliseconds */
long
int
lock_wait_timeout
=
thd_lock_wait_timeout
(
thd
)
*
4
;
if
(
table
!=
NULL
)
{
for
(
dict_index_t
*
index
=
dict_table_get_first_index
(
table
);
index
!=
NULL
;
index
=
dict_table_get_next_index
(
index
))
{
if
(
index
->
type
&
DICT_FTS
)
{
/* Found */
while
(
index
->
index_fts_syncing
&&
!
trx_is_interrupted
(
trx
)
&&
(
lock_wait_timeout
--
)
>
0
)
{
DICT_BG_YIELD
(
trx
);
}
}
}
dict_table_close
(
table
,
TRUE
,
FALSE
);
}
/* FTS sync is in progress. We shall timeout this operation */
if
(
lock_wait_timeout
<
0
)
{
error
=
DB_LOCK_WAIT_TIMEOUT
;
row_mysql_unlock_data_dictionary
(
trx
);
DBUG_RETURN
(
error
);
}
/* Transaction must be flagged as a locking transaction or it hasn't
been started yet. */
...
...
@@ -11834,7 +11865,7 @@ ha_innobase::rename_table(
++
trx
->
will_lock
;
trx_set_dict_operation
(
trx
,
TRX_DICT_OP_INDEX
);
error
=
innobase_rename_table
(
trx
,
from
,
to
);
error
=
innobase_rename_table
(
t
hd
,
t
rx
,
from
,
to
);
DEBUG_SYNC
(
thd
,
"after_innobase_rename_table"
);
...
...
@@ -11878,6 +11909,10 @@ ha_innobase::rename_table(
my_error
(
ER_TABLE_EXISTS_ERROR
,
MYF
(
0
),
to
);
error
=
DB_ERROR
;
}
else
if
(
error
==
DB_LOCK_WAIT_TIMEOUT
)
{
my_error
(
ER_LOCK_WAIT_TIMEOUT
,
MYF
(
0
),
to
);
error
=
DB_LOCK_WAIT
;
}
DBUG_RETURN
(
convert_error_code_to_mysql
(
error
,
0
,
NULL
));
...
...
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