From 88a3b3bca81656e94ea5eca77172045d551f1411 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 24 May 2004 12:35:39 +0200 Subject: Fixed prototype of get_error_message to use String to return error message WL#1747 and #1746 allow user to decide if ordered index should be created or not BitKeeper/deleted/.del-AttrType.hpp~a9b2d6efcf660378: Delete: ndb/include/ndbapi/AttrType.hpp sql/ha_ndbcluster.cc: Removed the NDB_ERR_CODE_OFFSET, ndb and handler error codes should not clash Encapsulated functionality to cache information about known indexes into buil_index_list Added detection of algorithm from key_info in function get_index_type_from_table Updated read_range_first and records_in_range to work wih new prototype. sql/ha_ndbcluster.h: WL#1746 and WL#1747 Added ability to skip creating an ordered index in addition to the hash index if the user so wishes. Modified get_error_message to return error messaga in a String datatype, in that way the String class will take care of wheter the "data" has to be freed or not. sql/handler.cc: Use String datatype as ouput parameter of get_error_message. sql/handler.h: Changed the function prototype for getting error messages from handler to use String datataype --- sql/ha_ndbcluster.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'sql/ha_ndbcluster.h') diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index 7b182d81ff5..df296648272 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -37,8 +37,10 @@ class NdbResultSet; // Forward declaration typedef enum ndb_index_type { UNDEFINED_INDEX = 0, PRIMARY_KEY_INDEX = 1, - UNIQUE_INDEX = 2, - ORDERED_INDEX = 3 + PRIMARY_KEY_ORDERED_INDEX = 2, + UNIQUE_INDEX = 3, + UNIQUE_ORDERED_INDEX = 4, + ORDERED_INDEX = 5 } NDB_INDEX_TYPE; @@ -78,10 +80,10 @@ class ha_ndbcluster: public handler void position(const byte *record); int read_range_first(const key_range *start_key, const key_range *end_key, - bool sorted); - int read_range_next(bool eq_range); + bool eq_range, bool sorted); + int read_range_next(); - const char* get_error_message(int *error, bool *temporary); + bool get_error_message(int error, String *buf); void info(uint); int extra(enum ha_extra_function operation); int extra_opt(enum ha_extra_function operation, ulong cache_size); @@ -117,6 +119,8 @@ class ha_ndbcluster: public handler const char* index_type(uint key_number) { switch (get_index_type(key_number)) { case ORDERED_INDEX: + case UNIQUE_ORDERED_INDEX: + case PRIMARY_KEY_ORDERED_INDEX: return "BTREE"; case UNIQUE_INDEX: case PRIMARY_KEY_INDEX: @@ -141,6 +145,7 @@ class ha_ndbcluster: public handler int create_ordered_index(const char *name, KEY *key_info); int create_unique_index(const char *name, KEY *key_info); int initialize_autoincrement(const void* table); + int build_index_list(); int get_metadata(const char* path); void release_metadata(); const char* get_index_name(uint idx_no) const; -- cgit v1.2.1