summaryrefslogtreecommitdiff
path: root/include/heap.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/heap.h')
-rw-r--r--include/heap.h32
1 files changed, 20 insertions, 12 deletions
diff --git a/include/heap.h b/include/heap.h
index 7adaac33096..02cb5400686 100644
--- a/include/heap.h
+++ b/include/heap.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/* This file should be included when using heap_database_functions */
/* Author: Michael Widenius */
@@ -25,10 +27,9 @@ extern "C" {
#ifndef _my_base_h
#include <my_base.h>
#endif
-#ifdef THREAD
+
#include <my_pthread.h>
#include <thr_lock.h>
-#endif
#include "my_compare.h"
#include "my_tree.h"
@@ -148,10 +149,8 @@ typedef struct st_heap_share
uchar *del_link; /* Link to next block with del. rec */
char * name; /* Name of "memory-file" */
time_t create_time;
-#ifdef THREAD
THR_LOCK lock;
- pthread_mutex_t intern_lock; /* Locking for use with _locking */
-#endif
+ mysql_mutex_t intern_lock; /* Locking for use with _locking */
my_bool delete_on_close;
LIST open_list;
uint auto_key;
@@ -177,21 +176,29 @@ typedef struct st_heap_info
TREE_ELEMENT **last_pos;
uint lastkey_len;
my_bool implicit_emptied;
-#ifdef THREAD
THR_LOCK_DATA lock;
-#endif
LIST open_list;
} HP_INFO;
typedef struct st_heap_create_info
{
+ HP_KEYDEF *keydef;
+ ulong max_records;
+ ulong min_records;
uint auto_key; /* keynr [1 - maxkey] for auto key */
uint auto_key_type;
+ uint keys;
+ uint reclength;
ulonglong max_table_size;
ulonglong auto_increment;
my_bool with_auto_increment;
my_bool internal_table;
+ /*
+ TRUE if heap_create should 'pin' the created share by setting
+ open_count to 1. Is only looked at if not internal_table.
+ */
+ my_bool pin_share;
} HP_CREATE_INFO;
/* Prototypes for heap-functions */
@@ -199,6 +206,7 @@ typedef struct st_heap_create_info
extern HP_INFO *heap_open(const char *name, int mode);
extern HP_INFO *heap_open_from_share(HP_SHARE *share, int mode);
extern HP_INFO *heap_open_from_share_and_register(HP_SHARE *share, int mode);
+extern void heap_release_share(HP_SHARE *share, my_bool internal_table);
extern int heap_close(HP_INFO *info);
extern int heap_write(HP_INFO *info,const uchar *buff);
extern int heap_update(HP_INFO *info,const uchar *old,const uchar *newdata);
@@ -207,9 +215,9 @@ extern int heap_scan_init(HP_INFO *info);
extern int heap_scan(register HP_INFO *info, uchar *record);
extern int heap_delete(HP_INFO *info,const uchar *buff);
extern int heap_info(HP_INFO *info,HEAPINFO *x,int flag);
-extern int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
- uint reclength, ulong max_records, ulong min_records,
- HP_CREATE_INFO *create_info, HP_SHARE **share);
+extern int heap_create(const char *name,
+ HP_CREATE_INFO *create_info, HP_SHARE **share,
+ my_bool *created_new_share);
extern int heap_delete_table(const char *name);
extern void heap_drop_table(HP_INFO *info);
extern int heap_extra(HP_INFO *info,enum ha_extra_function function);