diff options
author | Kentoku <kentokushiba@gmail.com> | 2019-11-08 10:27:07 +0900 |
---|---|---|
committer | Kentoku <kentokushiba@gmail.com> | 2019-11-09 05:57:16 +0900 |
commit | 0cf2ebd18acd945b04111133ccbb479cbc81d405 (patch) | |
tree | 769a262ef5322079f594cd6665aede8b065221e4 /sql/sql_update.cc | |
parent | c24ec3cece6d8bf70dac7519b6fd397c464f7a82 (diff) | |
download | mariadb-git-bb-10.4-MDEV-18973.tar.gz |
MDEV-18973 CLIENT_FOUND_ROWS wrong in spiderbb-10.4-MDEV-18973
Get count from last_used_con->info
Contributed by willhan at Tencent Games
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r-- | sql/sql_update.cc | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc index f5bb298fdba..cfe3ce1e4f3 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -718,6 +718,11 @@ int mysql_update(THD *thd, Later we also ensure that we are only using one table (no sub queries) */ + DBUG_PRINT("info", ("HA_CAN_DIRECT_UPDATE_AND_DELETE: %s", (table->file->ha_table_flags() & HA_CAN_DIRECT_UPDATE_AND_DELETE) ? "TRUE" : "FALSE")); + DBUG_PRINT("info", ("using_io_buffer: %s", query_plan.using_io_buffer ? "TRUE" : "FALSE")); + DBUG_PRINT("info", ("ignore: %s", ignore ? "TRUE" : "FALSE")); + DBUG_PRINT("info", ("virtual_columns_marked_for_read: %s", table->check_virtual_columns_marked_for_read() ? "TRUE" : "FALSE")); + DBUG_PRINT("info", ("virtual_columns_marked_for_write: %s", table->check_virtual_columns_marked_for_write() ? "TRUE" : "FALSE")); if ((table->file->ha_table_flags() & HA_CAN_DIRECT_UPDATE_AND_DELETE) && !has_triggers && !binlog_is_row && !query_plan.using_io_buffer && !ignore && @@ -928,11 +933,16 @@ update_begin: if (do_direct_update) { /* Direct updating is supported */ + ha_rows update_rows= 0, found_rows= 0; DBUG_PRINT("info", ("Using direct update")); table->reset_default_fields(); - if (unlikely(!(error= table->file->ha_direct_update_rows(&updated)))) + if (unlikely(!(error= table->file->ha_direct_update_rows(&update_rows, + &found_rows)))) error= -1; - found= updated; + updated= update_rows; + found= found_rows; + if (found < updated) + found= updated; goto update_end; } |