From 6633c2113a3b18fd4d40eef676de26fe3fa43f32 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Tue, 24 Oct 2000 03:55:04 +0300 Subject: [PATCH] Fix for new berkeley DB interface --- Docs/manual.texi | 2 ++ sql/ha_berkeley.cc | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Docs/manual.texi b/Docs/manual.texi index dbb6923d3ed..510c2b45317 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -38173,6 +38173,8 @@ though, so 3.23 is not released as a stable version yet. Fixed bug where the automatic repair of MyISAM tables failed sometimes when the data file was corrupt. @item +Fixed a bug in @code{SHOW CREATE} when using auto_increment columns. +@item Changed BDB tables to use new compare function in Berkeley DB 3.2.3 @item You can now use Unix sockets with @code{mit-pthreads} diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index bf993c39a20..06d0927854f 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -213,7 +213,7 @@ berkeley_cmp_hidden_key(DB* file, const DBT *new_key, const DBT *saved_key) static int berkeley_cmp_packed_key(DB *file, const DBT *new_key, const DBT *saved_key) { - KEY *key= (KEY*) BT_APP_PRIVATE(file); + KEY *key= (KEY*) (file->app_private); char *new_key_ptr= (char*) new_key->data; char *saved_key_ptr=(char*) saved_key->data; KEY_PART_INFO *key_part= key->key_part, *end=key_part+key->key_parts; @@ -244,7 +244,7 @@ berkeley_cmp_packed_key(DB *file, const DBT *new_key, const DBT *saved_key) static int berkeley_cmp_fix_length_key(DB *file, const DBT *new_key, const DBT *saved_key) { - KEY *key=(KEY*) BT_APP_PRIVATE(file); + KEY *key=(KEY*) (file->app_private); char *new_key_ptr= (char*) new_key->data; char *saved_key_ptr=(char*) saved_key->data; KEY_PART_INFO *key_part= key->key_part, *end=key_part+key->key_parts; @@ -322,7 +322,7 @@ int ha_berkeley::open(const char *name, int mode, uint test_if_locked) (hidden_primary_key ? berkeley_cmp_hidden_key : berkeley_cmp_packed_key)); if (!hidden_primary_key) - file->set_bt_app_private(file,table->key_info+table->primary_key); + file->app_private= (void*) (table->key_info+table->primary_key); if ((error=(file->open(file, fn_format(name_buff,name,"", ha_berkeley_ext, 2 | 4), "main", DB_BTREE, open_mode,0)))) @@ -361,7 +361,7 @@ int ha_berkeley::open(const char *name, int mode, uint test_if_locked) sprintf(part,"key%02d",++used_keys); key_type[i]=table->key_info[i].flags & HA_NOSAME ? DB_NOOVERWRITE : 0; (*ptr)->set_bt_compare(*ptr, berkeley_cmp_packed_key); - (*ptr)->set_bt_app_private(*ptr,table->key_info+i); + (*ptr)->app_private= (void*) (table->key_info+i); if (!(table->key_info[i].flags & HA_NOSAME)) (*ptr)->set_flags(*ptr, DB_DUP); if ((error=((*ptr)->open(*ptr, name_buff, part, DB_BTREE,