diff options
author | unknown <brian@avenger.(none)> | 2004-11-05 22:49:15 -0800 |
---|---|---|
committer | unknown <brian@avenger.(none)> | 2004-11-05 22:49:15 -0800 |
commit | 97ab6b91ab6d832ce7fa0077d95e17e13c6913de (patch) | |
tree | 3ae52608c5697ee5fea4e474afecdb2a671b32f5 | |
parent | 2d8bf1959b628de5d91ff69c8247f5796386ef40 (diff) | |
download | mariadb-git-97ab6b91ab6d832ce7fa0077d95e17e13c6913de.tar.gz |
Remove build errors introduced by 5.0 changes.
Removed duplicate code where defaults in handler.h will work just as well.
sql/examples/ha_archive.cc:
Fixed build errors, and removed duplicate code.
sql/examples/ha_archive.h:
Removed duplicate code (we will let the default values in handler.h handle these cases).
-rw-r--r-- | sql/examples/ha_archive.cc | 92 | ||||
-rw-r--r-- | sql/examples/ha_archive.h | 25 |
2 files changed, 5 insertions, 112 deletions
diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc index 6fbfb3f9f9d..ea8b3694109 100644 --- a/sql/examples/ha_archive.cc +++ b/sql/examples/ha_archive.cc @@ -530,7 +530,7 @@ int ha_archive::write_row(byte * buf) z_off_t written; DBUG_ENTER("ha_archive::write_row"); - statistic_increment(ha_write_count,&LOCK_status); + statistic_increment(table->in_use->status_var.ha_write_count, &LOCK_status); if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT) table->timestamp_field->set_time(); pthread_mutex_lock(&share->mutex); @@ -671,7 +671,8 @@ int ha_archive::rnd_next(byte *buf) DBUG_RETURN(HA_ERR_END_OF_FILE); scan_rows--; - statistic_increment(ha_read_rnd_next_count,&LOCK_status); + statistic_increment(table->in_use->status_var.ha_read_rnd_next_count, + &LOCK_status); current_position= gztell(archive); rc= get_row(archive, buf); @@ -707,7 +708,8 @@ void ha_archive::position(const byte *record) int ha_archive::rnd_pos(byte * buf, byte *pos) { DBUG_ENTER("ha_archive::rnd_pos"); - statistic_increment(ha_read_rnd_count,&LOCK_status); + statistic_increment(table->in_use->status_var.ha_read_rnd_next_count, + &LOCK_status); current_position= ha_get_ptr(pos, ref_length); z_off_t seek= gzseek(archive, current_position, SEEK_SET); @@ -870,71 +872,6 @@ THR_LOCK_DATA **ha_archive::store_lock(THD *thd, return to; } - -/****************************************************************************** - - Everything below here is default, please look at ha_example.cc for - descriptions. - - ******************************************************************************/ - -int ha_archive::update_row(const byte * old_data, byte * new_data) -{ - - DBUG_ENTER("ha_archive::update_row"); - DBUG_RETURN(HA_ERR_WRONG_COMMAND); -} - -int ha_archive::delete_row(const byte * buf) -{ - DBUG_ENTER("ha_archive::delete_row"); - DBUG_RETURN(HA_ERR_WRONG_COMMAND); -} - -int ha_archive::index_read(byte * buf, const byte * key, - uint key_len __attribute__((unused)), - enum ha_rkey_function find_flag - __attribute__((unused))) -{ - DBUG_ENTER("ha_archive::index_read"); - DBUG_RETURN(HA_ERR_WRONG_COMMAND); -} - -int ha_archive::index_read_idx(byte * buf, uint index, const byte * key, - uint key_len __attribute__((unused)), - enum ha_rkey_function find_flag - __attribute__((unused))) -{ - DBUG_ENTER("ha_archive::index_read_idx"); - DBUG_RETURN(HA_ERR_WRONG_COMMAND); -} - - -int ha_archive::index_next(byte * buf) -{ - DBUG_ENTER("ha_archive::index_next"); - DBUG_RETURN(HA_ERR_WRONG_COMMAND); -} - -int ha_archive::index_prev(byte * buf) -{ - DBUG_ENTER("ha_archive::index_prev"); - DBUG_RETURN(HA_ERR_WRONG_COMMAND); -} - -int ha_archive::index_first(byte * buf) -{ - DBUG_ENTER("ha_archive::index_first"); - DBUG_RETURN(HA_ERR_WRONG_COMMAND); -} - -int ha_archive::index_last(byte * buf) -{ - DBUG_ENTER("ha_archive::index_last"); - DBUG_RETURN(HA_ERR_WRONG_COMMAND); -} - - void ha_archive::info(uint flag) { DBUG_ENTER("ha_archive::info"); @@ -945,23 +882,4 @@ void ha_archive::info(uint flag) DBUG_VOID_RETURN; } - -int ha_archive::extra(enum ha_extra_function operation) -{ - DBUG_ENTER("ha_archive::extra"); - DBUG_RETURN(0); -} - -int ha_archive::reset(void) -{ - DBUG_ENTER("ha_archive::reset"); - DBUG_RETURN(0); -} - -ha_rows ha_archive::records_in_range(uint inx, key_range *min_key, - key_range *max_key) -{ - DBUG_ENTER("ha_archive::records_in_range "); - DBUG_RETURN(records); // HA_ERR_WRONG_COMMAND -} #endif /* HAVE_ARCHIVE_DB */ diff --git a/sql/examples/ha_archive.h b/sql/examples/ha_archive.h index b619de5f6c1..eb78b28034c 100644 --- a/sql/examples/ha_archive.h +++ b/sql/examples/ha_archive.h @@ -78,31 +78,9 @@ public: { return 0; } - /* - Have to put something here, there is no real limit as far as - archive is concerned. - */ - uint max_supported_record_length() const { return UINT_MAX; } - /* - Called in test_quick_select to determine if indexes should be used. - */ - virtual double scan_time() { return (double) (records) / 20.0+10; } - /* The next method will never be called */ - virtual double read_time(uint index, uint ranges, ha_rows rows) - { return (double) rows / 20.0+1; } int open(const char *name, int mode, uint test_if_locked); int close(void); int write_row(byte * buf); - int update_row(const byte * old_data, byte * new_data); - int delete_row(const byte * buf); - int index_read(byte * buf, const byte * key, - uint key_len, enum ha_rkey_function find_flag); - int index_read_idx(byte * buf, uint idx, const byte * key, - uint key_len, enum ha_rkey_function find_flag); - int index_next(byte * buf); - int index_prev(byte * buf); - int index_first(byte * buf); - int index_last(byte * buf); int rnd_init(bool scan=1); int rnd_next(byte *buf); int rnd_pos(byte * buf, byte *pos); @@ -116,10 +94,7 @@ public: int write_data_header(gzFile file_to_write); void position(const byte *record); void info(uint); - int extra(enum ha_extra_function operation); - int reset(void); int external_lock(THD *thd, int lock_type); - ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key); int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info); int optimize(THD* thd, HA_CHECK_OPT* check_opt); THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, |