From 4cb1a4fe7d4183dfd617bea04a94f20971c3e932 Mon Sep 17 00:00:00 2001 From: Monty Date: Tue, 5 Sep 2017 16:27:51 +0300 Subject: [PATCH] Give asserts if update_stats() fails. This is done to help find where the error is if stat_tables_par.test fails --- sql/sql_statistics.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index 73cabf663db..3e023767807 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -666,16 +666,22 @@ public: { if (find_stat()) { + bool res; store_record_for_update(); store_stat_fields(); - return update_record(); + res= update_record(); + DBUG_ASSERT(res == 0); + return res; } else { int err; store_stat_fields(); if ((err= stat_file->ha_write_row(record[0]))) + { + DBUG_ASSERT(0); return TRUE; + } /* Make change permanent and avoid 'table is marked as crashed' errors */ stat_file->extra(HA_EXTRA_FLUSH); }