Commit 5c58738a authored by unknown's avatar unknown
Browse files

Remove dead code: flush_version was never increased in the server,

therefore the logic associated with it never worked.


sql/ha_partition.cc:
  Remove dead code. Update comments.
sql/mysql_priv.h:
  Remove dead code (flush_version).
sql/mysqld.cc:
  Remove dead code (flush_version).
sql/sql_base.cc:
  Remove dead code.
sql/table.cc:
  Remove dead code.
sql/table.h:
  Remove dead code.
parent 46928246
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -4466,7 +4466,7 @@ void ha_partition::get_dynamic_partition_info(PARTITION_INFO *stat_info,
    2) It is called from close_thread_table which in turn is called from
       close_thread_tables except in the case where the tables are locked
       in which case ha_commit_stmt is called instead.
       It is only called from here if flush_version hasn't changed and the
       It is only called from here if refresh_version hasn't changed and the
       table is not an old table when calling close_thread_table.
       close_thread_tables is called from many places as a general clean up
       function after completing a query.
@@ -4487,8 +4487,9 @@ void ha_partition::get_dynamic_partition_info(PARTITION_INFO *stat_info,
    The handler will set HA_KEYREAD_ONLY in its table flags to indicate this
    feature is supported.
  HA_EXTRA_FLUSH:
    Indication to flush tables to disk, called at close_thread_table to
    Indication to flush tables to disk, is supposed to be used to
    ensure disk based tables are flushed at end of query execution.
    Currently is never used.

  2) Parameters used by some non-MyISAM handlers
  ----------------------------------------------
+1 −1
Original line number Diff line number Diff line
@@ -1558,7 +1558,7 @@ extern double log_01[32];
extern ulonglong log_10_int[20];
extern ulonglong keybuff_size;
extern ulonglong thd_startup_options;
extern ulong refresh_version,flush_version, thread_id;
extern ulong refresh_version, thread_id;
extern ulong binlog_cache_use, binlog_cache_disk_use;
extern ulong aborted_threads,aborted_connects;
extern ulong delayed_insert_timeout;
+2 −2
Original line number Diff line number Diff line
@@ -469,7 +469,7 @@ ulong open_files_limit, max_binlog_size, max_relay_log_size;
ulong slave_net_timeout, slave_trans_retries;
ulong thread_cache_size=0, binlog_cache_size=0, max_binlog_cache_size=0;
ulong query_cache_size=0;
ulong refresh_version, flush_version;	/* Increments on each reload */
ulong refresh_version;  /* Increments on each reload */
query_id_t global_query_id;
ulong aborted_threads, aborted_connects;
ulong delayed_insert_timeout, delayed_insert_limit, delayed_queue_size;
@@ -7015,7 +7015,7 @@ static void mysql_init_variables(void)
                        OPTION_QUOTE_SHOW_CREATE | OPTION_SQL_NOTES);
  protocol_version= PROTOCOL_VERSION;
  what_to_log= ~ (1L << (uint) COM_TIME);
  refresh_version= flush_version= 1L;	/* Increments on each reload */
  refresh_version= 1L;	/* Increments on each reload */
  global_query_id= thread_id= 1L;
  strmov(server_version, MYSQL_SERVER_VERSION);
  myisam_recover_options_str= sql_mode_str= "OFF";
+1 −7
Original line number Diff line number Diff line
@@ -1142,12 +1142,7 @@ bool close_thread_table(THD *thd, TABLE **table_ptr)
  }
  else
  {
    if (table->s->flush_version != flush_version)
    {
      table->s->flush_version= flush_version;
      table->file->extra(HA_EXTRA_FLUSH);
    }
    // Free memory and reset for next loop
    /* Free memory and reset for next loop */
    table->file->ha_reset();
    table->in_use=0;
    if (unused_tables)
@@ -1777,7 +1772,6 @@ bool reopen_name_locked_table(THD* thd, TABLE_LIST* table_list)

  share= table->s;
  share->version=0;
  share->flush_version=0;
  table->in_use = thd;
  check_unused();
  table->next = thd->open_tables;
+0 −1
Original line number Diff line number Diff line
@@ -120,7 +120,6 @@ TABLE_SHARE *alloc_table_share(TABLE_LIST *table_list, char *key,
    share->normalized_path.length= path_length;

    share->version=       refresh_version;
    share->flush_version= flush_version;

    /*
      This constant is used to mark that no table map version has been
Loading