Commit cbba6373 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[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
parent 96e3935d
...@@ -273,16 +273,15 @@ static inline bool is_insert_ignore (THD* thd) { ...@@ -273,16 +273,15 @@ static inline bool is_insert_ignore (THD* thd) {
} }
static inline bool is_replace_into(THD* thd) { static inline bool is_replace_into(THD* thd) {
return (thd_sql_command(thd) == SQLCOM_REPLACE) || return thd->lex->duplicates == DUP_REPLACE;
(thd_sql_command(thd) == SQLCOM_REPLACE_SELECT);
} }
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) {
uint pk_insert_mode = get_pk_insert_mode(thd); 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 ( return (
(is_replace_into(thd) || is_insert_ignore(thd)) &&
opt_eligible && opt_eligible &&
(is_replace_into(thd) || is_insert_ignore(thd)) &&
((!table->triggers && pk_insert_mode < 2) || pk_insert_mode == 0) ((!table->triggers && pk_insert_mode < 2) || pk_insert_mode == 0)
); );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment