diff options
author | Kentoku <kentokushiba@gmail.com> | 2019-11-29 08:22:13 +0900 |
---|---|---|
committer | Kentoku <kentokushiba@gmail.com> | 2019-11-29 23:23:57 +0900 |
commit | e066723a4149b05f212850dcf8ecf55b3ce2524d (patch) | |
tree | f790ac3d0bff3938429eefb8c20900e310fcec40 /sql/sql_update.cc | |
parent | 3826178da89f987ebf641bcd92d4a714d51b3ecb (diff) | |
download | mariadb-git-e066723a4149b05f212850dcf8ecf55b3ce2524d.tar.gz |
MDEV-18973 CLIENT_FOUND_ROWS wrong in spiderbb-10.4-MDEV-18973_2
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 590a4f8bae1..68b402dc925 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; } |