Commit ed35cecd authored by unknown's avatar unknown
Browse files

Final patch for 5.0 for simplifying storage engine code. We now have just one...

Final patch for 5.0 for simplifying storage engine code. We now have just one set of ifdefs. I may also remove the code for creating new handlers.
May changes were to simplify storage engine setup and support for legacy call to show storage engines.


mysql-test/r/ps_1general.result:
  Fixed test results for new listing order
sql/examples/ha_tina.cc:
  Removed dead code
sql/examples/ha_tina.h:
  Removed dead code
sql/ha_archive.cc:
  Capitalized sotrage engine name and moved disabled code.
sql/ha_berkeley.cc:
  Moved deisabled code
sql/ha_federated.cc:
  Removed disabled code
sql/ha_innodb.cc:
  Removed disabled message
sql/ha_ndbcluster.cc:
  Removed disabled message
sql/handler.cc:
  Added in legacy support for sotrage engine listing (ala Serg's request). Removed handlertons variables and we now have simplified ha_init code.
sql/handler.h:
  No longer need handlertons array.
parent cdb57192
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -323,17 +323,17 @@ execute stmt4;
Engine	Support	Comment
MyISAM	YES/NO	Default engine as of MySQL 3.23 with great performance
MEMORY	YES/NO	Hash based, stored in memory, useful for temporary tables
MRG_MYISAM	YES/NO	Collection of identical MyISAM tables
ISAM	YES/NO	Obsolete storage engine, now replaced by MyISAM
MRG_ISAM	YES/NO	Obsolete storage engine, now replaced by MERGE
InnoDB	YES/NO	Supports transactions, row-level locking, and foreign keys
BERKELEYDB	YES/NO	Supports transactions and page-level locking
NDBCLUSTER	YES/NO	Clustered, fault-tolerant, memory-based tables
BerkeleyDB	YES/NO	Supports transactions and page-level locking
BLACKHOLE	YES/NO	/dev/null storage engine (anything you write to it disappears)
EXAMPLE	YES/NO	Example storage engine
ARCHIVE	YES/NO	Archive storage engine
CSV	YES/NO	CSV storage engine
ndbcluster	YES/NO	Clustered, fault-tolerant, memory-based tables
FEDERATED	YES/NO	Federated MySQL storage engine
BLACKHOLE	YES/NO	/dev/null storage engine (anything you write to it disappears)
MRG_MYISAM	YES/NO	Collection of identical MyISAM tables
binlog	YES/NO	This is a meta storage engine to represent the binlog in a transaction
ISAM	YES/NO	Obsolete storage engine
drop table if exists t5;
prepare stmt1 from ' drop table if exists t5 ' ;
execute stmt1 ;
+0 −15
Original line number Diff line number Diff line
@@ -861,21 +861,6 @@ THR_LOCK_DATA **ha_tina::store_lock(THD *thd,
  return to;
}

/* 
  Range optimizer calls this.
  I need to update the information on this.
*/
ha_rows ha_tina::records_in_range(int inx,
                                  const byte *start_key,uint start_key_len,
                                  enum ha_rkey_function start_search_flag,
                                  const byte *end_key,uint end_key_len,
                                  enum ha_rkey_function end_search_flag)
{
  DBUG_ENTER("ha_tina::records_in_range ");
  DBUG_RETURN(records); // Good guess
}


/* 
  Create a table. You do not want to leave the table open after a call to
  this (the database will call ::open() if it needs to).
+0 −7
Original line number Diff line number Diff line
@@ -78,7 +78,6 @@ class ha_tina: public handler
   */
  virtual double scan_time() { return (double) (records+deleted) / 20.0+10; }
  /* The next method will never be called */
  virtual double read_time(ha_rows rows) { DBUG_ASSERT(0); return((double) rows /  20.0+1); }
  virtual bool fast_key_read() { return 1;}
  /* 
    TODO: return actual upper bound of number of records in the table.
@@ -110,12 +109,6 @@ class ha_tina: public handler
  int reset(void);
  int external_lock(THD *thd, int lock_type);
  int delete_all_rows(void);
  ha_rows records_in_range(int inx, const byte *start_key,uint start_key_len,
      enum ha_rkey_function start_search_flag,
      const byte *end_key,uint end_key_len,
      enum ha_rkey_function end_search_flag);
//  int delete_table(const char *from);
//  int rename_table(const char * from, const char * to);
  int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info);

  THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
+1 −2
Original line number Diff line number Diff line
@@ -137,7 +137,7 @@ static HASH archive_open_tables;

/* dummy handlerton - only to have something to return from archive_db_init */
handlerton archive_hton = {
  "archive",
  "ARCHIVE",
  SHOW_OPTION_YES,
  "Archive storage engine", 
  DB_TYPE_ARCHIVE_DB,
@@ -201,7 +201,6 @@ bool archive_db_init()
  }
error:
  have_archive_db= SHOW_OPTION_DISABLED;	// If we couldn't use handler
  archive_hton.state= SHOW_OPTION_DISABLED;
  DBUG_RETURN(TRUE);
}

+0 −1
Original line number Diff line number Diff line
@@ -210,7 +210,6 @@ bool berkeley_init(void)
  DBUG_RETURN(FALSE);
error:
  have_berkeley_db= SHOW_OPTION_DISABLED;	// If we couldn't use handler
  berkeley_hton.state= SHOW_OPTION_DISABLED;
  DBUG_RETURN(TRUE);
}

Loading