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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
847e14f3
Commit
847e14f3
authored
Apr 25, 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
4fbec79e
Changes
1
Hide 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 @
847e14f3
...
@@ -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