diff options
author | unknown <serg@serg.mylan> | 2004-06-23 12:36:07 +0200 |
---|---|---|
committer | unknown <serg@serg.mylan> | 2004-06-23 12:36:07 +0200 |
commit | eb70dc5593e987ac2745224ce0ac37f5def22c48 (patch) | |
tree | f131301a9d0f77a68268ec331013df866919066f /sql/handler.cc | |
parent | 540121e1f9f16e32f80dce3a536c6b6d67486681 (diff) | |
parent | 9a554b4751237bc96f9ad6eae2df8b310567479d (diff) | |
download | mariadb-git-eb70dc5593e987ac2745224ce0ac37f5def22c48.tar.gz |
merged
configure.in:
Auto merged
mysql-test/Makefile.am:
Auto merged
mysql-test/r/fulltext.result:
Auto merged
sql/field.cc:
Auto merged
sql/ha_berkeley.cc:
Auto merged
sql/ha_innodb.cc:
Auto merged
sql/ha_innodb.h:
Auto merged
sql/handler.cc:
Auto merged
sql/handler.h:
Auto merged
sql/item_subselect.cc:
Auto merged
sql/lex.h:
Auto merged
sql/opt_range.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_cache.cc:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_help.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/table.cc:
Auto merged
sql/unireg.cc:
Auto merged
Diffstat (limited to 'sql/handler.cc')
-rw-r--r-- | sql/handler.cc | 114 |
1 files changed, 30 insertions, 84 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index 717b2ee0ce8..2b3c91c9a93 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -40,8 +40,6 @@ #endif #ifdef HAVE_INNOBASE_DB #include "ha_innodb.h" -#else -#define innobase_query_caching_of_table_permitted(X,Y,Z) 1 #endif #ifdef HAVE_NDBCLUSTER_DB #include "ha_ndbcluster.h" @@ -219,6 +217,18 @@ handler *get_new_handler(TABLE *table, enum db_type db_type) } } +bool ha_caching_allowed(THD* thd, char* table_key, + uint key_length, uint8 cache_type) +{ +#ifdef HAVE_INNOBASE_DB + if (cache_type == HA_CACHE_TBL_ASKTRANSACT) + return innobase_query_caching_of_table_permitted(thd, table_key, + key_length); + else +#endif + return 1; +} + int ha_init() { int error= 0; @@ -865,46 +875,6 @@ int handler::ha_open(const char *name, int mode, int test_if_locked) DBUG_RETURN(error); } -int handler::check(THD* thd, HA_CHECK_OPT* check_opt) -{ - return HA_ADMIN_NOT_IMPLEMENTED; -} - -int handler::backup(THD* thd, HA_CHECK_OPT* check_opt) -{ - return HA_ADMIN_NOT_IMPLEMENTED; -} - -int handler::restore(THD* thd, HA_CHECK_OPT* check_opt) -{ - return HA_ADMIN_NOT_IMPLEMENTED; -} - -int handler::repair(THD* thd, HA_CHECK_OPT* check_opt) -{ - return HA_ADMIN_NOT_IMPLEMENTED; -} - -int handler::optimize(THD* thd, HA_CHECK_OPT* check_opt) -{ - return HA_ADMIN_NOT_IMPLEMENTED; -} - -int handler::analyze(THD* thd, HA_CHECK_OPT* check_opt) -{ - return HA_ADMIN_NOT_IMPLEMENTED; -} - -int handler::assign_to_keycache(THD* thd, HA_CHECK_OPT* check_opt) -{ - return HA_ADMIN_NOT_IMPLEMENTED; -} - -int handler::preload_keys(THD* thd, HA_CHECK_OPT* check_opt) -{ - return HA_ADMIN_NOT_IMPLEMENTED; -} - /* Read first row (only) from a table This is never called for InnoDB or BDB tables, as these table types @@ -922,35 +892,23 @@ int handler::read_first_row(byte * buf, uint primary_key) If there is very few deleted rows in the table, find the first row by scanning the table. */ - if (deleted < 10 || primary_key >= MAX_KEY || - !(index_flags(primary_key) & HA_READ_ORDER)) + if (deleted < 10 || primary_key >= MAX_KEY) { - (void) rnd_init(); + (void) ha_rnd_init(1); while ((error= rnd_next(buf)) == HA_ERR_RECORD_DELETED) ; - (void) rnd_end(); + (void) ha_rnd_end(); } else { /* Find the first row through the primary key */ - (void) index_init(primary_key); + (void) ha_index_init(primary_key); error=index_first(buf); - (void) index_end(); + (void) ha_index_end(); } DBUG_RETURN(error); } -/* - The following function is only needed for tables that may be temporary tables - during joins -*/ - -int handler::restart_rnd_next(byte *buf, byte *pos) -{ - return HA_ERR_WRONG_COMMAND; -} - - /* Set a timestamp in record */ void handler::update_timestamp(byte *record) @@ -1165,7 +1123,7 @@ void handler::print_error(int error, myf errflag) bool handler::get_error_message(int error, String* buf) { - return false; + return FALSE; } @@ -1234,28 +1192,6 @@ int handler::index_next_same(byte *buf, const byte *key, uint keylen) } -/* - This is called to delete all rows in a table - If the handler don't support this, then this function will - return HA_ERR_WRONG_COMMAND and MySQL will delete the rows one - by one. -*/ - -int handler::delete_all_rows() -{ - return (my_errno=HA_ERR_WRONG_COMMAND); -} - -bool handler::caching_allowed(THD* thd, char* table_key, - uint key_length, uint8 cache_type) -{ - if (cache_type == HA_CACHE_TBL_ASKTRANSACT) - return innobase_query_caching_of_table_permitted(thd, table_key, - key_length); - else - return 1; -} - /**************************************************************************** ** Some general functions that isn't in the handler class ****************************************************************************/ @@ -1278,8 +1214,6 @@ int ha_create_table(const char *name, HA_CREATE_INFO *create_info, if (update_create_info) { update_create_info_from_table(create_info, &table); - if (table.file->table_flags() & HA_DROP_BEFORE_CREATE) - table.file->delete_table(name); } if (lower_case_table_names == 2 && !(table.file->table_flags() & HA_FILE_BASED)) @@ -1536,3 +1470,15 @@ int handler::compare_key(key_range *range) cmp= key_compare_result_on_equal; return cmp; } + +int handler::index_read_idx(byte * buf, uint index, const byte * key, + uint key_len, enum ha_rkey_function find_flag) +{ + int error= ha_index_init(index); + if (!error) + error= index_read(buf, key, key_len, find_flag); + if (!error) + error= ha_index_end(); + return error; +} + |