[Commits] Rev 3338: Fixed a problem for Q18 from DBT3/SF30 with innodb database instance: in file:///home/igor/maria/maria-5.5-mwl248/

Igor Babaev igor at askmonty.org
Thu Apr 19 19:49:53 EEST 2012


At file:///home/igor/maria/maria-5.5-mwl248/

------------------------------------------------------------
revno: 3338
revision-id: igor at askmonty.org-20120419164953-u67t09e1d5h7slk8
parent: igor at askmonty.org-20120412034452-wtch0zecpuv3bovq
committer: Igor Babaev <igor at askmonty.org>
branch nick: maria-5.5-mwl248
timestamp: Thu 2012-04-19 09:49:53 -0700
message:
  Fixed a problem for Q18 from DBT3/SF30 with innodb database instance:
  the server crashed when running the query with persistent statistics
  enabled.
  The field KEY::read_stat.avg_frequency must be initialized to NULL
  for the keys of temporary tables.
   
-------------- next part --------------
=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2012-04-12 03:44:52 +0000
+++ b/sql/sql_select.cc	2012-04-19 16:49:53 +0000
@@ -14657,6 +14657,7 @@
     keyinfo->algorithm= HA_KEY_ALG_UNDEF;
     keyinfo->is_statistics_from_stat_tables= FALSE;
     keyinfo->rec_per_key=0;
+    keyinfo->read_stat.avg_frequency= NULL;
 
     /*
       Create an extra field to hold NULL bits so that unique indexes on

=== modified file 'sql/sql_statistics.cc'
--- a/sql/sql_statistics.cc	2012-04-12 00:14:06 +0000
+++ b/sql/sql_statistics.cc	2012-04-19 16:49:53 +0000
@@ -1636,6 +1636,7 @@
        key_info < key_info_end; key_info++)
   {
     key_info->is_statistics_from_stat_tables=
-      (use_stat_table_mode > 1 && key_info->read_stat.avg_frequency[0] > 0.5);
+      (use_stat_table_mode > 1 &&  key_info->read_stat.avg_frequency &&
+       key_info->read_stat.avg_frequency[0] > 0.5);
   }
 }

=== modified file 'sql/table.cc'
--- a/sql/table.cc	2012-04-12 03:44:52 +0000
+++ b/sql/table.cc	2012-04-19 16:49:53 +0000
@@ -5957,6 +5957,7 @@
   if (!keyinfo->rec_per_key)
     return TRUE;
   bzero(keyinfo->rec_per_key, sizeof(ulong)*key_parts);
+  keyinfo->read_stat.avg_frequency= NULL;
 
   for (i= 0; i < key_parts; i++)
   {



More information about the commits mailing list