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
9f324de9
Commit
9f324de9
authored
Apr 14, 2014
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#212 binlog row replication turns the insert ignore optimization off
parent
e7e91ab6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
storage/tokudb/ha_tokudb.cc
storage/tokudb/ha_tokudb.cc
+11
-7
No files found.
storage/tokudb/ha_tokudb.cc
View file @
9f324de9
...
@@ -391,15 +391,22 @@ static inline bool is_replace_into(THD* thd) {
...
@@ -391,15 +391,22 @@ static inline bool is_replace_into(THD* thd) {
}
}
static
inline
bool
do_ignore_flag_optimization
(
THD
*
thd
,
TABLE
*
table
,
bool
opt_eligible
)
{
static
inline
bool
do_ignore_flag_optimization
(
THD
*
thd
,
TABLE
*
table
,
bool
opt_eligible
)
{
bool
do_opt
=
false
;
if
(
opt_eligible
)
{
if
(
opt_eligible
)
{
if
(
is_replace_into
(
thd
)
||
is_insert_ignore
(
thd
))
{
if
(
is_replace_into
(
thd
)
||
is_insert_ignore
(
thd
))
{
uint
pk_insert_mode
=
get_pk_insert_mode
(
thd
);
uint
pk_insert_mode
=
get_pk_insert_mode
(
thd
);
if
((
!
table
->
triggers
&&
pk_insert_mode
<
2
)
||
pk_insert_mode
==
0
)
{
if
((
!
table
->
triggers
&&
pk_insert_mode
<
2
)
||
pk_insert_mode
==
0
)
{
return
true
;
// if bin log row replication is on then ignore the session variable
if
(
mysql_bin_log
.
is_open
()
&&
(
thd
->
variables
.
binlog_format
!=
BINLOG_FORMAT_STMT
&&
thd
->
variables
.
binlog_format
!=
BINLOG_FORMAT_MIXED
))
{
do_opt
=
false
;
}
else
{
do_opt
=
true
;
}
}
}
}
}
}
return
false
;
}
return
do_opt
;
}
}
static
inline
uint
get_key_parts
(
const
KEY
*
key
)
{
static
inline
uint
get_key_parts
(
const
KEY
*
key
)
{
...
@@ -426,9 +433,7 @@ static inline uint get_ext_key_parts(const KEY *key) {
...
@@ -426,9 +433,7 @@ static inline uint get_ext_key_parts(const KEY *key) {
#endif
#endif
ulonglong
ha_tokudb
::
table_flags
()
const
{
ulonglong
ha_tokudb
::
table_flags
()
const
{
return
(
table
&&
do_ignore_flag_optimization
(
ha_thd
(),
table
,
share
->
replace_into_fast
&&
!
using_ignore_no_key
)
?
return
int_table_flags
|
HA_BINLOG_ROW_CAPABLE
|
HA_BINLOG_STMT_CAPABLE
;
int_table_flags
|
HA_BINLOG_STMT_CAPABLE
:
int_table_flags
|
HA_BINLOG_ROW_CAPABLE
|
HA_BINLOG_STMT_CAPABLE
);
}
}
//
//
...
@@ -3772,8 +3777,7 @@ void ha_tokudb::set_main_dict_put_flags(
...
@@ -3772,8 +3777,7 @@ void ha_tokudb::set_main_dict_put_flags(
uint32_t
old_prelock_flags
=
0
;
uint32_t
old_prelock_flags
=
0
;
uint
curr_num_DBs
=
table
->
s
->
keys
+
tokudb_test
(
hidden_primary_key
);
uint
curr_num_DBs
=
table
->
s
->
keys
+
tokudb_test
(
hidden_primary_key
);
bool
in_hot_index
=
share
->
num_DBs
>
curr_num_DBs
;
bool
in_hot_index
=
share
->
num_DBs
>
curr_num_DBs
;
bool
using_ignore_flag_opt
=
do_ignore_flag_optimization
(
bool
using_ignore_flag_opt
=
do_ignore_flag_optimization
(
thd
,
table
,
share
->
replace_into_fast
&&
!
using_ignore_no_key
);
thd
,
table
,
share
->
replace_into_fast
&&
!
using_ignore_no_key
);
//
//
// optimization for "REPLACE INTO..." (and "INSERT IGNORE") command
// optimization for "REPLACE INTO..." (and "INSERT IGNORE") command
// if the command is "REPLACE INTO" and the only table
// if the command is "REPLACE INTO" and the only 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