diff options
author | unknown <gkodinov/kgeorge@magare.gmz> | 2007-07-18 15:56:29 +0300 |
---|---|---|
committer | unknown <gkodinov/kgeorge@magare.gmz> | 2007-07-18 15:56:29 +0300 |
commit | 4a07ed48ddb8a7fd8d6a1c786d67377289b8263b (patch) | |
tree | 41c1dde4a4218d15c8b9a50136bece1db3b96eaa /storage/heap | |
parent | 1d0749b858b2450e44f182dcf58dd50b44a938cf (diff) | |
parent | 06b446dae4a55b48108bb85bd3ca3f70924b9b8d (diff) | |
download | mariadb-git-4a07ed48ddb8a7fd8d6a1c786d67377289b8263b.tar.gz |
Merge magare.gmz:/home/kgeorge/mysql/work/mysql-5.0-opt
into magare.gmz:/home/kgeorge/mysql/work/merge-5.0-5.1-opt
mysql-test/r/type_time.result:
Auto merged
sql/field.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
BitKeeper/deleted/.del-index_merge.result:
Auto merged
mysql-test/include/index_merge1.inc:
Auto merged
sql/item_cmpfunc.h:
Auto merged
sql/opt_range.cc:
Auto merged
storage/heap/ha_heap.cc:
Auto merged
storage/heap/ha_heap.h:
Auto merged
Diffstat (limited to 'storage/heap')
-rw-r--r-- | storage/heap/ha_heap.cc | 20 | ||||
-rw-r--r-- | storage/heap/ha_heap.h | 9 |
2 files changed, 24 insertions, 5 deletions
diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc index 86bc2cc516e..5d34395fa5a 100644 --- a/storage/heap/ha_heap.cc +++ b/storage/heap/ha_heap.cc @@ -125,6 +125,26 @@ int ha_heap::close(void) /* + Create a copy of this table + + DESCRIPTION + Do same as default implementation but use file->s->name instead of + table->s->path. This is needed by Windows where the clone() call sees + '/'-delimited path in table->s->path, while ha_peap::open() was called + with '\'-delimited path. +*/ + +handler *ha_heap::clone(MEM_ROOT *mem_root) +{ + handler *new_handler= get_new_handler(table, mem_root, table->s->db_type); + if (new_handler && !new_handler->ha_open(file->s->name, table->db_stat, + HA_OPEN_IGNORE_IF_LOCKED)) + return new_handler; + return NULL; /* purecov: inspected */ +} + + +/* Compute which keys to use for scanning SYNOPSIS diff --git a/storage/heap/ha_heap.h b/storage/heap/ha_heap.h index f41c710716d..c414383a4aa 100644 --- a/storage/heap/ha_heap.h +++ b/storage/heap/ha_heap.h @@ -32,6 +32,7 @@ class ha_heap: public handler public: ha_heap(handlerton *hton, TABLE_SHARE *table); ~ha_heap() {} + handler *clone(MEM_ROOT *mem_root); const char *table_type() const { return (table->in_use->variables.sql_mode & MODE_MYSQL323) ? @@ -55,8 +56,8 @@ public: ulong index_flags(uint inx, uint part, bool all_parts) const { return ((table_share->key_info[inx].algorithm == HA_KEY_ALG_BTREE) ? - HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER | HA_READ_RANGE : - HA_ONLY_WHOLE_INDEX); + HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER | HA_READ_RANGE : + HA_ONLY_WHOLE_INDEX | HA_KEY_SCAN_NOT_ROR); } const key_map *keys_to_use_for_scanning() { return &btree_keys; } uint max_supported_keys() const { return MAX_KEY; } @@ -108,9 +109,7 @@ public: enum thr_lock_type lock_type); int cmp_ref(const uchar *ref1, const uchar *ref2) { - HEAP_PTR ptr1=*(HEAP_PTR*)ref1; - HEAP_PTR ptr2=*(HEAP_PTR*)ref2; - return ptr1 < ptr2? -1 : (ptr1 > ptr2? 1 : 0); + return memcmp(ref1, ref2, sizeof(HEAP_PTR)); } bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes); private: |