1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-18973 CLIENT_FOUND_ROWS wrong in spider

Get count from last_used_con->info
Contributed by willhan at Tencent Games
This commit is contained in:
Kentoku
2019-11-29 08:22:13 +09:00
parent 3826178da8
commit e066723a41
27 changed files with 846 additions and 43 deletions

View File

@ -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;
}