List:Commits« Previous MessageNext Message »
From:Guilhem Bichot Date:November 4 2010 5:08pm
Subject:bzr commit into mysql-next-mr-bugfixing branch (guilhem:3331) Bug#57928
View as plain text  
#At file:///home/mysql_src/bzrrepos_new/mysql-next-mr-bugfixing2/ based on revid:guilhem@stripped

 3331 Guilhem Bichot	2010-11-04
      Fix for BUG#57928 "More Valgrind warnings in print_keyuse() with --debug":
      for a fulltext index, the KEYUSE object had some uninitialized members.
     @ sql/sql_select.cc
        use constructor which sets all members. The second change is the bugfix: we forgot
        to set ref_table_rows, null_rejecting and cond_guard. Now there is the question
        of: what value to pick for them, for a fulltext index?
        * ref_table_rows: we now set it to ~(ha_rows)0 which seems to be a default
        value (see optimize_keyuse() and add_key_part()).
        * null_rejecting: it's not used for a fulltext index, and it serves
        only for the so-called early-NULL-filtering optimization, so we play
        safe and set it to "false"; setting it to "true" would require
        intelligent code determining when the optimization is allowed.
        * cond_guard: it's not used for a fulltext index (see create_ref_for_key()),
        so we set it to NULL.
     @ sql/sql_select.h
        constructor, comments. With that,
        "KEYUSE keyuse;" will not compile anymore.
        KEYUSE is now a class so renamed to Key_use to follow our convention
        for naming classes. As some lines are changed as a consequence,
        we fix them to match the coding style (spacing etc).

    modified:
      sql/sql_select.cc
      sql/sql_select.h
      sql/sql_test.cc
=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2010-11-04 16:08:12 +0000
+++ b/sql/sql_select.cc	2010-11-04 17:08:52 +0000
@@ -72,9 +72,10 @@ static bool update_ref_and_keys(THD *thd
                                 COND_EQUAL *cond_equal,
                                 table_map table_map, SELECT_LEX *select_lex,
                                 st_sargable_param **sargables);
-static int sort_keyuse(KEYUSE *a,KEYUSE *b);
-static void set_position(JOIN *join,uint index,JOIN_TAB *table,KEYUSE *key);
-static bool create_ref_for_key(JOIN *join, JOIN_TAB *j, KEYUSE *org_keyuse,
+static int sort_keyuse(Key_use *a, Key_use *b);
+static void set_position(JOIN *join, uint index, JOIN_TAB *table,
+                         Key_use *key);
+static bool create_ref_for_key(JOIN *join, JOIN_TAB *j, Key_use *org_keyuse,
 			       table_map used_tables);
 static bool choose_plan(JOIN *join, table_map join_tables);
 static void best_access_path(JOIN  *join, JOIN_TAB *s, 
@@ -99,7 +100,7 @@ static uint cache_record_length(JOIN *jo
 static double prev_record_reads(JOIN *join, uint idx, table_map found_ref);
 static bool get_best_combination(JOIN *join);
 static store_key *get_store_key(THD *thd,
-				KEYUSE *keyuse, table_map used_tables,
+				Key_use *keyuse, table_map used_tables,
 				KEY_PART_INFO *key_part, uchar *key_buff,
 				uint maybe_null);
 static void make_outerjoin_info(JOIN *join);
@@ -4143,7 +4144,7 @@ bool JOIN::setup_subquery_materializatio
 
 
 /*
-  Check if table's KEYUSE elements have an eq_ref(outer_tables) candidate
+  Check if table's Key_use elements have an eq_ref(outer_tables) candidate
 
   SYNOPSIS
     find_eq_ref_candidate()
@@ -4152,7 +4153,7 @@ bool JOIN::setup_subquery_materializatio
                         count.
 
   DESCRIPTION
-    Check if table's KEYUSE elements have an eq_ref(outer_tables) candidate
+    Check if table's Key_use elements have an eq_ref(outer_tables) candidate
 
   TODO
     Check again if it is feasible to factor common parts with constant table
@@ -4165,7 +4166,7 @@ bool JOIN::setup_subquery_materializatio
 
 bool find_eq_ref_candidate(TABLE *table, table_map sj_inner_tables)
 {
-  KEYUSE *keyuse= table->reginfo.join_tab->keyuse;
+  Key_use *keyuse= table->reginfo.join_tab->keyuse;
   uint key;
 
   if (keyuse)
@@ -4487,7 +4488,7 @@ make_join_statistics(JOIN *join, TABLE_L
   table_map found_const_table_map, all_table_map, found_ref, refs;
   TABLE **table_vector;
   JOIN_TAB *stat,*stat_end,*s,**stat_ref;
-  KEYUSE *keyuse,*start_keyuse;
+  Key_use *keyuse, *start_keyuse;
   table_map outer_join=0;
   SARGABLE_PARAM *sargables= 0;
   JOIN_TAB *stat_vector[MAX_TABLES+1];
@@ -4551,7 +4552,7 @@ make_join_statistics(JOIN *join, TABLE_L
 #endif
       {						// Empty table
         s->dependent= 0;                        // Ignore LEFT JOIN depend.
-	set_position(join,const_count++,s,(KEYUSE*) 0);
+	set_position(join, const_count++, s, NULL);
 	continue;
       }
       outer_join|= table->map;
@@ -4588,7 +4589,7 @@ make_join_statistics(JOIN *join, TABLE_L
 	(table->file->ha_table_flags() & HA_STATS_RECORDS_IS_EXACT) &&
         !table->fulltext_searched && !join->no_const_tables)
     {
-      set_position(join,const_count++,s,(KEYUSE*) 0);
+      set_position(join, const_count++, s, NULL);
     }
   }
   stat_vector[i]=0;
@@ -4722,7 +4723,7 @@ make_join_statistics(JOIN *join, TABLE_L
             mark_as_null_row(table);
             found_const_table_map|= table->map;
 	    join->const_table_map|= table->map;
-	    set_position(join,const_count++,s,(KEYUSE*) 0);
+	    set_position(join, const_count++, s, NULL);
             goto more_const_tables_found;
            }
 	  keyuse++;
@@ -4741,7 +4742,7 @@ make_join_statistics(JOIN *join, TABLE_L
 	  int tmp= 0;
 	  s->type=JT_SYSTEM;
 	  join->const_table_map|=table->map;
-	  set_position(join,const_count++,s,(KEYUSE*) 0);
+	  set_position(join, const_count++, s, NULL);
 	  if ((tmp= join_read_const_table(s, join->positions+const_count-1)))
 	  {
 	    if (tmp > 0)
@@ -4902,7 +4903,7 @@ make_join_statistics(JOIN *join, TABLE_L
 	  caller to abort with a zero row result.
 	*/
 	join->const_table_map|= s->table->map;
-	set_position(join,const_count++,s,(KEYUSE*) 0);
+	set_position(join, const_count++, s, NULL);
 	s->type= JT_CONST;
 	if (*s->on_expr_ref)
 	{
@@ -5156,10 +5157,11 @@ typedef struct key_field_t {
   /**
     If true, the condition this struct represents will not be satisfied
     when val IS NULL.
+    @sa Key_use::null_rejecting .
   */
-  bool          null_rejecting; 
-  bool          *cond_guard; /* See KEYUSE::cond_guard */
-  uint          sj_pred_no; /* See KEYUSE::sj_pred_no */
+  bool          null_rejecting;
+  bool          *cond_guard; ///< @sa Key_use::cond_guard
+  uint          sj_pred_no;  ///< @sa Key_use::sj_pred_no
 } KEY_FIELD;
 
 /* Values in optimize */
@@ -5673,7 +5675,7 @@ add_key_fields(JOIN *join, KEY_FIELD **k
   /* 
     Subquery optimization: Conditions that are pushed down into subqueries
     are wrapped into Item_func_trig_cond. We process the wrapped condition
-    but need to set cond_guard for KEYUSE elements generated from it.
+    but need to set cond_guard for Key_use elements generated from it.
   */
   {
     if (cond->type() == Item::FUNC_ITEM &&
@@ -5861,19 +5863,17 @@ add_key_part(DYNAMIC_ARRAY *keyuse_array
       {
 	if (field->eq(form->key_info[key].key_part[part].field))
 	{
-          KEYUSE keyuse;
-          keyuse.table=          field->table;
-          keyuse.val=            key_field->val;
-          keyuse.used_tables=    key_field->val->used_tables();
-          keyuse.key=            key;
-          keyuse.keypart=        part;
-          keyuse.optimize=       key_field->optimize & KEY_OPTIMIZE_REF_OR_NULL;
-          keyuse.keypart_map=    (key_part_map) 1 << part;
-          /* This will be set accordingly in optimize_keyuse */
-          keyuse.ref_table_rows= ~(ha_rows) 0;
-          keyuse.null_rejecting= key_field->null_rejecting;
-          keyuse.cond_guard=     key_field->cond_guard;
-          keyuse.sj_pred_no=     key_field->sj_pred_no;
+          const Key_use keyuse(field->table,
+                               key_field->val,
+                               key_field->val->used_tables(),
+                               key,
+                               part,
+                               key_field->optimize & KEY_OPTIMIZE_REF_OR_NULL,
+                               (key_part_map) 1 << part,
+                               ~(ha_rows) 0, // will be set in optimize_keyuse
+                               key_field->null_rejecting,
+                               key_field->cond_guard,
+                               key_field->sj_pred_no);
           if (insert_dynamic(keyuse_array, &keyuse))
             return TRUE;
 	}
@@ -5938,21 +5938,22 @@ add_ft_keys(DYNAMIC_ARRAY *keyuse_array,
       !(usable_tables & cond_func->table->map))
     return FALSE;
 
-  KEYUSE keyuse;
-  keyuse.table= cond_func->table;
-  keyuse.val =  cond_func;
-  keyuse.key =  cond_func->key;
-  keyuse.keypart= FT_KEYPART;
-  keyuse.used_tables=cond_func->key_item()->used_tables();
-  keyuse.optimize= 0;
-  keyuse.keypart_map= 0;
-  keyuse.sj_pred_no= UINT_MAX;
+  const Key_use keyuse(cond_func->table,
+                       cond_func,
+                       cond_func->key_item()->used_tables(),
+                       cond_func->key,
+                       FT_KEYPART,
+                       0,             // optimize
+                       0,             // keypart_map
+                       ~(ha_rows)0,   // ref_table_rows
+                       false,         // null_rejecting
+                       NULL,          // cond_guard
+                       UINT_MAX);     // sj_pred_no
   return insert_dynamic(keyuse_array, &keyuse);
 }
 
 
-static int
-sort_keyuse(KEYUSE *a,KEYUSE *b)
+static int sort_keyuse(Key_use *a, Key_use *b)
 {
   int res;
   if (a->table->tablenr != b->table->tablenr)
@@ -6046,7 +6047,7 @@ static void add_key_fields_for_nj(JOIN *
   Update keyuse array with all possible keys we can use to fetch rows.
   
   @param       thd 
-  @param[out]  keyuse         Put here ordered array of KEYUSE structures
+  @param[out]  keyuse         Put here ordered array of Key_use structures
   @param       join_tab       Array in tablenr_order
   @param       tables         Number of tables in join
   @param       cond           WHERE condition (note that the function analyzes
@@ -6107,7 +6108,7 @@ update_ref_and_keys(THD *thd, DYNAMIC_AR
   /* set a barrier for the array of SARGABLE_PARAM */
   (*sargables)[0].field= 0; 
 
-  if (my_init_dynamic_array(keyuse,sizeof(KEYUSE),20,64))
+  if (my_init_dynamic_array(keyuse, sizeof(Key_use), 20, 64))
     return TRUE;
   if (cond)
   {
@@ -6184,17 +6185,17 @@ update_ref_and_keys(THD *thd, DYNAMIC_AR
   */
   if (keyuse->elements)
   {
-    KEYUSE key_end,*prev,*save_pos,*use;
+    Key_use *save_pos, *use;
 
-    my_qsort(keyuse->buffer,keyuse->elements,sizeof(KEYUSE),
-	  (qsort_cmp) sort_keyuse);
+    my_qsort(keyuse->buffer, keyuse->elements, sizeof(Key_use),
+             reinterpret_cast<qsort_cmp>(sort_keyuse));
 
-    bzero((char*) &key_end,sizeof(key_end));    /* Add for easy testing */
-    if (insert_dynamic(keyuse, &key_end))
+    const Key_use key_end(NULL, NULL, 0, 0, 0, 0, 0, 0, false, NULL, 0);
+    if (insert_dynamic(keyuse, &key_end)) // added for easy testing
       return TRUE;
 
-    use=save_pos=dynamic_element(keyuse,0,KEYUSE*);
-    prev= &key_end;
+    use= save_pos= dynamic_element(keyuse, 0, Key_use *);
+    const Key_use *prev= &key_end;
     found_eq_constant=0;
     for (i=0 ; i < keyuse->elements-1 ; i++,use++)
     {
@@ -6225,7 +6226,7 @@ update_ref_and_keys(THD *thd, DYNAMIC_AR
       use->table->reginfo.join_tab->checked_keys.set_bit(use->key);
       save_pos++;
     }
-    i=(uint) (save_pos-(KEYUSE*) keyuse->buffer);
+    i= (uint) (save_pos - (Key_use *)keyuse->buffer);
     (void) set_dynamic(keyuse, &key_end, i);
     keyuse->elements=i;
   }
@@ -6239,7 +6240,7 @@ update_ref_and_keys(THD *thd, DYNAMIC_AR
 
 static void optimize_keyuse(JOIN *join, DYNAMIC_ARRAY *keyuse_array)
 {
-  KEYUSE *end,*keyuse= dynamic_element(keyuse_array, 0, KEYUSE*);
+  Key_use *end, *keyuse= dynamic_element(keyuse_array, 0, Key_use *);
 
   for (end= keyuse+ keyuse_array->elements ; keyuse < end ; keyuse++)
   {
@@ -6424,7 +6425,7 @@ add_group_and_distinct_keys(JOIN *join, 
 /** Save const tables first as used tables. */
 
 static void
-set_position(JOIN *join,uint idx,JOIN_TAB *table,KEYUSE *key)
+set_position(JOIN *join, uint idx, JOIN_TAB *table, Key_use *key)
 {
   join->positions[idx].table= table;
   join->positions[idx].key=key;
@@ -6541,7 +6542,7 @@ private:
   uint   best_loose_scan_key;
   double best_loose_scan_cost;
   double best_loose_scan_records;
-  KEYUSE *best_loose_scan_start_key;
+  Key_use *best_loose_scan_start_key;
 
   uint best_max_loose_keypart;
 
@@ -6607,7 +6608,7 @@ public:
     part1_conds_met= FALSE;
   }
   
-  void add_keyuse(table_map remaining_tables, KEYUSE *keyuse)
+  void add_keyuse(table_map remaining_tables, Key_use *keyuse)
   {
     if (try_loosescan && keyuse->sj_pred_no != UINT_MAX)
     {
@@ -6630,7 +6631,7 @@ public:
 
   bool have_a_case() { return test(handled_sj_equalities); }
 
-  void check_ref_access_part1(JOIN_TAB *s, uint key, KEYUSE *start_key, 
+  void check_ref_access_part1(JOIN_TAB *s, uint key, Key_use *start_key,
                               table_map found_part)
   {
     /*
@@ -6708,7 +6709,7 @@ public:
     }
   }
   
-  void check_ref_access_part2(uint key, KEYUSE *start_key, double records, 
+  void check_ref_access_part2(uint key, Key_use *start_key, double records,
                               double read_time)
   {
     if (part1_conds_met && read_time < best_loose_scan_cost)
@@ -6797,7 +6798,7 @@ best_access_path(JOIN      *join,
                  POSITION *loose_scan_pos)
 {
   THD *thd= join->thd;
-  KEYUSE *best_key=         0;
+  Key_use *best_key=        NULL;
   uint best_max_key_part=   0;
   my_bool found_constraint= 0;
   double best=              DBL_MAX;
@@ -6826,7 +6827,7 @@ best_access_path(JOIN      *join,
   if (unlikely(s->keyuse != NULL))
   {                                            /* Use key if possible */
     TABLE *table= s->table;
-    KEYUSE *keyuse;
+    Key_use *keyuse;
     double best_records= DBL_MAX;
     uint max_key_part=0;
 
@@ -6846,7 +6847,7 @@ best_access_path(JOIN      *join,
       key_part_map ref_or_null_part= 0;
 
       /* Calculate how many key segments of the current key we can use */
-      KEYUSE *start_key= keyuse;
+      Key_use *start_key= keyuse;
 
       loose_scan_opt.next_ref_key();
       DBUG_PRINT("info", ("Considering ref access on key %s",
@@ -8648,7 +8649,7 @@ static bool get_best_combination(JOIN *j
   uint i,tablenr;
   table_map used_tables;
   JOIN_TAB *join_tab,*j;
-  KEYUSE *keyuse;
+  Key_use *keyuse;
   uint table_count;
   THD *thd=join->thd;
   DBUG_ENTER("get_best_combination");
@@ -8706,10 +8707,10 @@ static bool get_best_combination(JOIN *j
 }
 
 
-static bool create_ref_for_key(JOIN *join, JOIN_TAB *j, KEYUSE *org_keyuse,
+static bool create_ref_for_key(JOIN *join, JOIN_TAB *j, Key_use *org_keyuse,
 			       table_map used_tables)
 {
-  KEYUSE *keyuse=org_keyuse;
+  Key_use *keyuse= org_keyuse;
   bool ftkey=(keyuse->keypart == FT_KEYPART);
   THD  *thd= join->thd;
   uint keyparts,length,key;
@@ -8870,7 +8871,7 @@ static bool create_ref_for_key(JOIN *joi
 
 
 static store_key *
-get_store_key(THD *thd, KEYUSE *keyuse, table_map used_tables,
+get_store_key(THD *thd, Key_use *keyuse, table_map used_tables,
 	      KEY_PART_INFO *key_part, uchar *key_buff, uint maybe_null)
 {
   if (!((~used_tables) & keyuse->used_tables))		// if const item
@@ -9055,7 +9056,7 @@ inline void add_cond_and_fix(Item **e1, 
     Implementation overview
       1. update_ref_and_keys() accumulates info about null-rejecting
          predicates in in KEY_FIELD::null_rejecting
-      1.1 add_key_part saves these to KEYUSE.
+      1.1 add_key_part saves these to Key_use.
       2. create_ref_for_key copies them to TABLE_REF.
       3. add_not_null_conds adds "x IS NOT NULL" to join_tab->select_cond of
          appropiate JOIN_TAB members.
@@ -12792,7 +12793,7 @@ static void update_const_equal_items(Ite
         if (!possible_keys.is_clear_all())
         {
           TABLE *tab= field->table;
-          KEYUSE *use;
+          Key_use *use;
           for (use= stat->keyuse; use && use->table == tab; use++)
             if (possible_keys.is_set(use->key) && 
                 tab->key_info[use->key].key_part[use->keypart].field ==
@@ -19673,7 +19674,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,OR
             "part1 = const1 AND part2=const2". 
             So we build tab->ref from scratch here.
           */
-          KEYUSE *keyuse= tab->keyuse;
+          Key_use *keyuse= tab->keyuse;
           while (keyuse->key != new_ref_key && keyuse->table == tab->table)
             keyuse++;
 

=== modified file 'sql/sql_select.h'
--- a/sql/sql_select.h	2010-09-23 12:16:36 +0000
+++ b/sql/sql_select.h	2010-11-04 17:08:52 +0000
@@ -39,36 +39,63 @@
 #define KEY_OPTIMIZE_EXISTS		1
 #define KEY_OPTIMIZE_REF_OR_NULL	2
 
-typedef struct keyuse_t {
-  TABLE *table;
-  Item	*val;				/**< or value if no field */
-  table_map used_tables;
-  uint	key, keypart;
-  uint optimize; // 0, or KEY_OPTIMIZE_*
-  key_part_map keypart_map;
-  ha_rows      ref_table_rows;
+/**
+  Information about usage of an index to satisfy an equality condition.
+
+  @note such objects are stored in DYNAMIC_ARRAY which uses sizeof(), so keep
+  this class as POD as possible.
+*/
+class Key_use {
+public:
+  Key_use(TABLE *table_arg, Item *val_arg, table_map used_tables_arg,
+          uint key_arg, uint keypart_arg, uint optimize_arg,
+          key_part_map keypart_map_arg, ha_rows ref_table_rows_arg,
+          bool null_rejecting_arg, bool *cond_guard_arg,
+          uint sj_pred_no_arg) :
+  table(table_arg), val(val_arg), used_tables(used_tables_arg),
+  key(key_arg), keypart(keypart_arg), optimize(optimize_arg),
+  keypart_map(keypart_map_arg), ref_table_rows(ref_table_rows_arg),
+  null_rejecting(null_rejecting_arg), cond_guard(cond_guard_arg),
+  sj_pred_no(sj_pred_no_arg)
+  {}
+  TABLE *table;  ///< table owning the index
+  Item	*val;    ///< other side of the equality, or value if no field
+  table_map used_tables; ///< tables used on other side of equality
+  uint key;      ///< number of index
+  uint keypart;  ///< used part of the index
+  uint optimize; ///< 0, or KEY_OPTIMIZE_*
+  key_part_map keypart_map; ///< like keypart, but as a bitmap
+  ha_rows      ref_table_rows; ///< Estimate of how many rows for a key value
   /**
     If true, the comparison this value was created from will not be
     satisfied if val has NULL 'value'.
+    Not used if the index is fulltext (such index cannot be used for
+    equalities).
   */
   bool null_rejecting;
-  /*
-    !NULL - This KEYUSE was created from an equality that was wrapped into
-            an Item_func_trig_cond. This means the equality (and validity of 
-            this KEYUSE element) can be turned on and off. The on/off state 
+  /**
+    !NULL - This Key_use was created from an equality that was wrapped into
+            an Item_func_trig_cond. This means the equality (and validity of
+            this Key_use element) can be turned on and off. The on/off state
             is indicted by the pointed value:
               *cond_guard == TRUE <=> equality condition is on
               *cond_guard == FALSE <=> equality condition is off
 
     NULL  - Otherwise (the source equality can't be turned off)
+
+    Not used if the index is fulltext (such index cannot be used for
+    equalities).
   */
   bool *cond_guard;
-  /*
+  /**
      0..64    <=> This was created from semi-join IN-equality # sj_pred_no.
      MAX_UINT  Otherwise
+
+     Not used if the index is fulltext (such index cannot be used for
+     semijoin).
   */
   uint         sj_pred_no;
-} KEYUSE;
+};
 
 class store_key;
 
@@ -208,7 +235,7 @@ typedef struct st_join_table : public Sq
   st_join_table();
 
   TABLE		*table;
-  KEYUSE	*keyuse;			/**< pointer to first used key */
+  Key_use	*keyuse;			/**< pointer to first used key */
   SQL_SELECT	*select;
   Item		*select_cond;
   QUICK_SELECT_I *quick;
@@ -1409,7 +1436,7 @@ typedef struct st_position : public Sql_
     NULL  -  'index' or 'range' or 'index_merge' or 'ALL' access is used.
     Other - [eq_]ref[_or_null] access is used. Pointer to {t.keypart1 = expr}
   */
-  KEYUSE *key;
+  Key_use *key;
 
   /* If ref-based access is used: bitmap of tables this table depends on  */
   table_map ref_depend_map;

=== modified file 'sql/sql_test.cc'
--- a/sql/sql_test.cc	2010-09-02 07:34:10 +0000
+++ b/sql/sql_test.cc	2010-11-04 17:08:52 +0000
@@ -239,7 +239,7 @@ TEST_join(JOIN *join)
 
 #define FT_KEYPART   (MAX_REF_PARTS+10)
 
-void print_keyuse(KEYUSE *keyuse)
+void print_keyuse(Key_use *keyuse)
 {
   char buff[256];
   char buf2[64]; 
@@ -255,7 +255,7 @@ void print_keyuse(KEYUSE *keyuse)
     fieldname= keyuse->table->key_info[keyuse->key].key_part[keyuse->keypart].field->field_name;
   longlong2str(keyuse->used_tables, buf2, 16); 
   DBUG_LOCK_FILE;
-  fprintf(DBUG_FILE, "KEYUSE: %s.%s=%s  optimize= %d used_tables=%s "
+  fprintf(DBUG_FILE, "Key_use: %s.%s=%s  optimize= %d used_tables=%s "
           "ref_table_rows= %lu keypart_map= %0lx\n",
           keyuse->table->alias, fieldname, str.ptr(),
           keyuse->optimize, buf2, (ulong)keyuse->ref_table_rows, 
@@ -269,10 +269,11 @@ void print_keyuse(KEYUSE *keyuse)
 void print_keyuse_array(DYNAMIC_ARRAY *keyuse_array)
 {
   DBUG_LOCK_FILE;
-  fprintf(DBUG_FILE, "KEYUSE array (%d elements)\n", keyuse_array->elements);
+  fprintf(DBUG_FILE, "Key_use array (%d elements)\n", keyuse_array->elements);
   DBUG_UNLOCK_FILE;
   for(uint i=0; i < keyuse_array->elements; i++)
-    print_keyuse((KEYUSE*)dynamic_array_ptr(keyuse_array, i));
+    print_keyuse(reinterpret_cast<Key_use *>
+                 (dynamic_array_ptr(keyuse_array, i)));
 }
 
 


Attachment: [text/bzr-bundle] bzr/guilhem@mysql.com-20101104170852-ib2ni1zesgyefua2.bundle
Thread
bzr commit into mysql-next-mr-bugfixing branch (guilhem:3331) Bug#57928Guilhem Bichot4 Nov