[Commits] bzr commit into Mariadb 5.2, with Maria 2.0:maria/5.2 branch (monty:2859)

Michael Widenius michael.widenius at gmail.com
Tue Nov 30 01:27:17 EET 2010


#At lp:maria/5.2 based on revid:hakan at askmonty.org-20101129225818-b2ioq46xs0o6swyv

 2859 Michael Widenius	2010-11-30
      Fixed some compiler warnings found when compiling for windows.
      Changed rows_read and rows_sent status variables to be longlong (to avoid compiler warnings)
      modified:
        sql/item_func.cc
        sql/item_subselect.cc
        sql/item_subselect.h
        sql/multi_range_read.cc
        sql/mysqld.cc
        sql/opt_subselect.h
        sql/sql_class.cc
        sql/sql_class.h
        sql/sql_select.cc
        storage/heap/ha_heap.cc
        storage/oqgraph/ha_oqgraph.cc

per-file messages:
  sql/item_func.cc
    Fixed wrong usage of alias
  sql/item_subselect.cc
    Changed buffer size to ulonglong to be able detect buffers bigger than size_t
  sql/item_subselect.h
    Changed buffer size to ulonglong to be able detect buffers bigger than size_t
  sql/multi_range_read.cc
    Fixed compiler warning by using correct type for function argument
  sql/mysqld.cc
    Changed rows_read and rows_sent status variables to be longlong
  sql/opt_subselect.h
    Fixed compiler warning by using correct type for function argument
  sql/sql_class.cc
    Changed rows_read and rows_sent status variables to be longlong
  sql/sql_class.h
    Changed rows_read and rows_sent status variables to be longlong
    Changed max_nulls_in_row to uint as this is number of columns in row.
    This fixed some compiler warnings.
  sql/sql_select.cc
    Added casts to avoid compiler warnings
  storage/heap/ha_heap.cc
    Initilize different types separate
  storage/oqgraph/ha_oqgraph.cc
    Fixed argument to store(longlong) to avoid compiler warnings
=== modified file 'sql/item_func.cc'
--- a/sql/item_func.cc	2010-11-27 15:29:52 +0000
+++ b/sql/item_func.cc	2010-11-29 23:27:14 +0000
@@ -5786,7 +5786,7 @@ Item_func_sp::cleanup()
     sp_result_field= NULL;
   }
   m_sp= NULL;
-  dummy_table->alias= NULL;
+  dummy_table->alias.free();
   Item_func::cleanup();
 }
 

=== modified file 'sql/item_subselect.cc'
--- a/sql/item_subselect.cc	2010-11-02 09:03:33 +0000
+++ b/sql/item_subselect.cc	2010-11-29 23:27:14 +0000
@@ -3651,7 +3651,7 @@ subselect_hash_sj_engine::choose_partial
   bool has_non_null_key, bool has_covering_null_row,
   MY_BITMAP *partial_match_key_parts)
 {
-  size_t pm_buff_size;
+  ulonglong pm_buff_size;
 
   DBUG_ASSERT(strategy == PARTIAL_MATCH);
   /*
@@ -3716,11 +3716,12 @@ subselect_hash_sj_engine::choose_partial
   matching via merging is not applicable.
 */
 
-size_t subselect_hash_sj_engine::rowid_merge_buff_size(
+ulonglong subselect_hash_sj_engine::rowid_merge_buff_size(
   bool has_non_null_key, bool has_covering_null_row,
   MY_BITMAP *partial_match_key_parts)
 {
-  size_t buff_size; /* Total size of all buffers used by partial matching. */
+  /* Total size of all buffers used by partial matching. */
+  ulonglong buff_size;
   ha_rows row_count= tmp_table->file->stats.records;
   uint rowid_length= tmp_table->file->ref_length;
   select_materialize_with_stats *result_sink=

=== modified file 'sql/item_subselect.h'
--- a/sql/item_subselect.h	2010-10-10 14:18:11 +0000
+++ b/sql/item_subselect.h	2010-11-29 23:27:14 +0000
@@ -800,9 +800,9 @@ protected:
 protected:
   exec_strategy get_strategy_using_schema();
   exec_strategy get_strategy_using_data();
-  size_t rowid_merge_buff_size(bool has_non_null_key,
-                               bool has_covering_null_row,
-                               MY_BITMAP *partial_match_key_parts);
+  ulonglong rowid_merge_buff_size(bool has_non_null_key,
+                                  bool has_covering_null_row,
+                                  MY_BITMAP *partial_match_key_parts);
   void choose_partial_match_strategy(bool has_non_null_key,
                                      bool has_covering_null_row,
                                      MY_BITMAP *partial_match_key_parts);

=== modified file 'sql/multi_range_read.cc'
--- a/sql/multi_range_read.cc	2010-10-28 17:04:23 +0000
+++ b/sql/multi_range_read.cc	2010-11-29 23:27:14 +0000
@@ -820,7 +820,7 @@ bool DsMrr_impl::get_disk_sweep_mrr_cost
     cost->mem_cost= (double)rows_in_last_step * elem_size;
   
   /* Total cost of all index accesses */
-  index_read_cost= h->keyread_time(keynr, 1, (double)rows);
+  index_read_cost= h->keyread_time(keynr, 1, rows);
   cost->add_io(index_read_cost, 1 /* Random seeks */);
   return FALSE;
 }

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2010-11-05 10:37:51 +0000
+++ b/sql/mysqld.cc	2010-11-29 23:27:14 +0000
@@ -8086,8 +8086,8 @@ SHOW_VAR status_vars[]= {
   {"Opened_tables",            (char*) offsetof(STATUS_VAR, opened_tables), SHOW_LONG_STATUS},
   {"Opened_table_definitions", (char*) offsetof(STATUS_VAR, opened_shares), SHOW_LONG_STATUS},
   {"Prepared_stmt_count",      (char*) &show_prepared_stmt_count, SHOW_FUNC},
-  {"Rows_sent",                (char*) offsetof(STATUS_VAR, rows_sent), SHOW_LONG_STATUS},
-  {"Rows_read",                (char*) offsetof(STATUS_VAR, rows_read), SHOW_LONG_STATUS},
+  {"Rows_sent",                (char*) offsetof(STATUS_VAR, rows_sent), SHOW_LONGLONG_STATUS},
+  {"Rows_read",                (char*) offsetof(STATUS_VAR, rows_read), SHOW_LONGLONG_STATUS},
 #ifdef HAVE_QUERY_CACHE
   {"Qcache_free_blocks",       (char*) &query_cache.free_memory_blocks, SHOW_LONG_NOFLUSH},
   {"Qcache_free_memory",       (char*) &query_cache.free_memory, SHOW_LONG_NOFLUSH},

=== modified file 'sql/opt_subselect.h'
--- a/sql/opt_subselect.h	2010-10-28 17:04:23 +0000
+++ b/sql/opt_subselect.h	2010-11-29 23:27:14 +0000
@@ -199,7 +199,8 @@ public:
         double records= rows2double(s->table->file->stats.records);
 
         /* The cost is entire index scan cost (divided by 2) */
-        double read_time= s->table->file->keyread_time(key, 1, records);
+        double read_time= s->table->file->keyread_time(key, 1,
+                                                       (ha_rows) records);
 
         /*
           Now find out how many different keys we will get (for now we

=== modified file 'sql/sql_class.cc'
--- a/sql/sql_class.cc	2010-11-28 12:38:59 +0000
+++ b/sql/sql_class.cc	2010-11-29 23:27:14 +0000
@@ -1189,6 +1189,8 @@ void add_to_status(STATUS_VAR *to_var, S
   /* Handle the not ulong variables. See end of system_status_var */
   to_var->bytes_received=       from_var->bytes_received;
   to_var->bytes_sent+=          from_var->bytes_sent;
+  to_var->rows_read+=           from_var->rows_read;
+  to_var->rows_sent+=           from_var->rows_sent;
   to_var->binlog_bytes_written= from_var->binlog_bytes_written;
   to_var->cpu_time+=            from_var->cpu_time;
   to_var->busy_time+=           from_var->busy_time;

=== modified file 'sql/sql_class.h'
--- a/sql/sql_class.h	2010-11-24 22:34:50 +0000
+++ b/sql/sql_class.h	2010-11-29 23:27:14 +0000
@@ -557,8 +557,6 @@ typedef struct system_status_var
   ulong select_range_count;
   ulong select_range_check_count;
   ulong select_scan_count;
-  ulong rows_read;
-  ulong rows_sent;
   ulong long_query_count;
   ulong filesort_merge_passes;
   ulong filesort_range_count;
@@ -588,6 +586,8 @@ typedef struct system_status_var
   ulonglong bytes_received;
   ulonglong bytes_sent;
   ulonglong binlog_bytes_written;
+  ulonglong rows_read;
+  ulonglong rows_sent;
   double last_query_cost;
   double cpu_time, busy_time;
 } STATUS_VAR;
@@ -3042,7 +3042,7 @@ protected:
     The number of columns in the biggest sub-row that consists of only
     NULL values.
   */
-  ha_rows max_nulls_in_row;
+  uint max_nulls_in_row;
   /*
     Count of rows writtent to the temp table. This is redundant as it is
     already stored in handler::stats.records, however that one is relatively
@@ -3076,7 +3076,7 @@ public:
     DBUG_ASSERT(idx < table->s->fields);
     return col_stat[idx].min_null_row;
   }
-  ha_rows get_max_nulls_in_row() { return max_nulls_in_row; }
+  uint get_max_nulls_in_row() { return max_nulls_in_row; }
 };
 
 

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2010-11-29 20:02:33 +0000
+++ b/sql/sql_select.cc	2010-11-29 23:27:14 +0000
@@ -4616,9 +4616,10 @@ best_access_path(JOIN      *join,
             tmp= records;
             set_if_smaller(tmp, (double) thd->variables.max_seeks_for_key);
             if (table->covering_keys.is_set(key))
-              tmp= table->file->keyread_time(key, 1, tmp);
+              tmp= table->file->keyread_time(key, 1, (ha_rows) tmp);
             else
-              tmp= table->file->read_time(key, 1, min(tmp,s->worst_seeks)-1);
+              tmp= table->file->read_time(key, 1,
+                                          (ha_rows) min(tmp,s->worst_seeks)-1);
             tmp*= record_count;
           }
         }
@@ -4779,9 +4780,10 @@ best_access_path(JOIN      *join,
             /* Limit the number of matched rows */
             set_if_smaller(tmp, (double) thd->variables.max_seeks_for_key);
             if (table->covering_keys.is_set(key))
-              tmp= table->file->keyread_time(key, 1, tmp);
+              tmp= table->file->keyread_time(key, 1, (ha_rows) tmp);
             else
-              tmp= table->file->read_time(key, 1, min(tmp,s->worst_seeks)-1);
+              tmp= table->file->read_time(key, 1,
+                                          (ha_rows) min(tmp,s->worst_seeks)-1);
             tmp*= record_count;
           }
           else
@@ -18426,8 +18428,8 @@ static void select_describe(JOIN *join,
           item_list.push_back(new Item_string("func", strlen("func"), cs));
         }
         /* rows */
-        ha_rows rows= (sj_strategy == SJ_OPT_MATERIALIZE_SCAN)?
-                       tab->emb_sj_nest->sj_mat_info->rows : 1;
+        ha_rows rows= (ha_rows) ((sj_strategy == SJ_OPT_MATERIALIZE_SCAN)?
+                                 tab->emb_sj_nest->sj_mat_info->rows : 1.0);
         item_list.push_back(new Item_int((longlong)rows, 
                                          MY_INT64_NUM_DECIMAL_DIGITS));
         /* filtered */

=== modified file 'storage/heap/ha_heap.cc'
--- a/storage/heap/ha_heap.cc	2010-11-23 10:35:37 +0000
+++ b/storage/heap/ha_heap.cc	2010-11-29 23:27:14 +0000
@@ -695,7 +695,10 @@ int ha_heap::create(const char *name, TA
                                           (uchar*) table_arg->record[0]);
       }
       else
-        seg->bit_length= seg->bit_start= seg->bit_pos= 0;
+      {
+        seg->bit_length= seg->bit_start= 0;
+        seg->bit_pos= 0;
+      }
     }
   }
   mem_per_row+= MY_ALIGN(share->reclength + 1, sizeof(char*));

=== modified file 'storage/oqgraph/ha_oqgraph.cc'
--- a/storage/oqgraph/ha_oqgraph.cc	2010-04-12 23:23:51 +0000
+++ b/storage/oqgraph/ha_oqgraph.cc	2010-11-29 23:27:14 +0000
@@ -754,19 +754,19 @@ int ha_oqgraph::fill_record(byte *record
   if (row.orig_indicator)
   {
     field[1]->set_notnull();
-    field[1]->store((longlong) row.orig);
+    field[1]->store((longlong) row.orig, 0);
   }
 
   if (row.dest_indicator)
   {
     field[2]->set_notnull();
-    field[2]->store((longlong) row.dest);
+    field[2]->store((longlong) row.dest, 0);
   }
 
   if (row.weight_indicator)
   {
     field[3]->set_notnull();
-    field[3]->store((double) row.weight);
+    field[3]->store((double) row.weight, 0);
   }
 
   if (row.seq_indicator)
@@ -778,7 +778,7 @@ int ha_oqgraph::fill_record(byte *record
   if (row.link_indicator)
   {
     field[5]->set_notnull();
-    field[5]->store((longlong) row.link);
+    field[5]->store((longlong) row.link, 0);
   }
 
   if (ptrdiff)



More information about the commits mailing list