diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2017-04-07 15:38:01 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2017-06-14 12:02:54 +0200 |
commit | 91ae1258ee29405c0e7c6c196aef2e870c11ec01 (patch) | |
tree | e179fd618362f45b98a084cb3a5e8076f8f703c3 /sql/sql_insert.cc | |
parent | e813fe862226554cfe31754b3dfeafbb2b9a7159 (diff) | |
download | mariadb-git-91ae1258ee29405c0e7c6c196aef2e870c11ec01.tar.gz |
MDEV-12471: BULK Command
BULK execution moved to a new command.
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r-- | sql/sql_insert.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 8e5dfb4f69c..24e4c07fdb9 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -697,9 +697,9 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, bool using_bulk_insert= 0; uint value_count; ulong counter = 1; - ulong iteration= 0; + /* counter of iteration in bulk PS operation*/ + ulonglong iteration= 0; ulonglong id; - ulong bulk_iterations= bulk_parameters_iterations(thd); COPY_INFO info; TABLE *table= 0; List_iterator_fast<List_item> its(values_list); @@ -767,7 +767,6 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, DBUG_RETURN(TRUE); value_count= values->elements; - DBUG_ASSERT(bulk_iterations > 0); if (mysql_prepare_insert(thd, table_list, table, fields, values, update_fields, update_values, duplic, &unused_conds, FALSE)) @@ -939,6 +938,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, } do { + DBUG_PRINT("info", ("iteration %llu", iteration)); if (iteration && bulk_parameters_set(thd)) goto abort; @@ -1059,7 +1059,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, } its.rewind(); iteration++; - } while (iteration < bulk_iterations); + } while (bulk_parameters_iterations(thd)); values_loop_end: free_underlaid_joins(thd, &thd->lex->select_lex); @@ -1206,7 +1206,7 @@ values_loop_end: retval= thd->lex->explain->send_explain(thd); goto abort; } - if ((bulk_iterations * values_list.elements) == 1 && (!(thd->variables.option_bits & OPTION_WARNINGS) || + if ((iteration * values_list.elements) == 1 && (!(thd->variables.option_bits & OPTION_WARNINGS) || !thd->cuted_fields)) { my_ok(thd, info.copied + info.deleted + |