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/handler.h | |
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/handler.h')
-rw-r--r-- | sql/handler.h | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/sql/handler.h b/sql/handler.h index 2d25568488b..bbceb58cb0c 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -927,6 +927,16 @@ enum tablespace_access_mode TS_NOT_ACCESSIBLE = 2 }; +/* Statistics about batch operations like bulk_insert */ +struct ha_copy_info +{ + ha_rows records; /* Used to check if rest of variables can be used */ + ha_rows touched; + ha_rows copied; + ha_rows deleted; + ha_rows updated; +}; + struct handlerton; class st_alter_tablespace : public Sql_alloc { @@ -3061,6 +3071,7 @@ public: ulonglong rows_changed; /* One bigger than needed to avoid to test if key == MAX_KEY */ ulonglong index_rows_read[MAX_KEY+1]; + ha_copy_info copy_info; private: /* ANALYZE time tracker, if present */ @@ -3276,6 +3287,7 @@ public: { DBUG_ENTER("handler::ha_start_bulk_insert"); estimation_rows_to_insert= rows; + bzero(©_info,sizeof(copy_info)); start_bulk_insert(rows, flags); DBUG_VOID_RETURN; } @@ -3347,6 +3359,13 @@ public: { rows_read= rows_changed= rows_tmp_read= 0; bzero(index_rows_read, sizeof(index_rows_read)); + bzero(©_info, sizeof(copy_info)); + } + virtual void reset_copy_info() {} + void ha_reset_copy_info() + { + bzero(©_info, sizeof(copy_info)); + reset_copy_info(); } virtual void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share) { @@ -4599,7 +4618,7 @@ private: /* Perform initialization for a direct update request */ public: - int ha_direct_update_rows(ha_rows *update_rows); + int ha_direct_update_rows(ha_rows *update_rows, ha_rows *found_rows); virtual int direct_update_rows_init(List<Item> *update_fields) { return HA_ERR_WRONG_COMMAND; @@ -4609,7 +4628,8 @@ private: { return HA_ERR_WRONG_COMMAND; } - virtual int direct_update_rows(ha_rows *update_rows __attribute__((unused))) + virtual int direct_update_rows(ha_rows *update_rows __attribute__((unused)), + ha_rows *found_rows __attribute__((unused))) { return HA_ERR_WRONG_COMMAND; } |