mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 19:11:46 +01:00
[t:2615], get replace into optimization working with load data infile replace
git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@20398 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
96e3935d30
commit
cbba637333
1 changed files with 3 additions and 4 deletions
|
@ -273,16 +273,15 @@ static inline bool is_insert_ignore (THD* thd) {
|
|||
}
|
||||
|
||||
static inline bool is_replace_into(THD* thd) {
|
||||
return (thd_sql_command(thd) == SQLCOM_REPLACE) ||
|
||||
(thd_sql_command(thd) == SQLCOM_REPLACE_SELECT);
|
||||
|
||||
return thd->lex->duplicates == DUP_REPLACE;
|
||||
}
|
||||
|
||||
static inline bool do_ignore_flag_optimization(THD* thd, TABLE* table, bool opt_eligible) {
|
||||
uint pk_insert_mode = get_pk_insert_mode(thd);
|
||||
printf("is replace into %d, insert ignore %d \n", is_replace_into(thd), is_insert_ignore(thd));
|
||||
return (
|
||||
(is_replace_into(thd) || is_insert_ignore(thd)) &&
|
||||
opt_eligible &&
|
||||
(is_replace_into(thd) || is_insert_ignore(thd)) &&
|
||||
((!table->triggers && pk_insert_mode < 2) || pk_insert_mode == 0)
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue