~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
/* Copyright (C) 2000-2002 MySQL AB
2
3
   This program is free software; you can redistribute it and/or modify
4
   it under the terms of the GNU General Public License as published by
5
   the Free Software Foundation; version 2 of the License.
6
7
   This program is distributed in the hope that it will be useful,
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
9
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
   GNU General Public License for more details.
11
12
   You should have received a copy of the GNU General Public License
13
   along with this program; if not, write to the Free Software
1802.10.2 by Monty Taylor
Update all of the copyright headers to include the correct address.
14
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
1 by brian
clean slate
15
16
/* close a heap-database */
17
1130.3.28 by Monty Taylor
Moved heapdef.h and myisamdef.h to *_priv.h for easier filtering for include guard check.
18
#include "heap_priv.h"
1241.9.1 by Monty Taylor
Removed global.h. Fixed all the headers.
19
#include <cstdlib>
1 by brian
clean slate
20
916.1.26 by Padraig O'Sullivan
Initial work on removing LIST from the heap storage engine.
21
using namespace std;
22
1 by brian
clean slate
23
	/* Close a database open by hp_open() */
24
	/* Data is normally not deallocated */
25
26
int heap_close(HP_INFO *info)
27
{
28
  int tmp;
1689.3.6 by Brian Aker
Update for HEAP to convert its lock to boost.
29
  THR_LOCK_heap.lock();
1 by brian
clean slate
30
  tmp= hp_close(info);
1689.3.6 by Brian Aker
Update for HEAP to convert its lock to boost.
31
  THR_LOCK_heap.unlock();
32
51.3.1 by Jay Pipes
Removed all DBUG symbols from heap storage engine
33
  return(tmp);
1 by brian
clean slate
34
}
35
36
916.1.27 by Padraig O'Sullivan
Removing the declaration of a variable as register. Is this really needed
37
int hp_close(HP_INFO *info)
1 by brian
clean slate
38
{
39
  int error=0;
1697.2.1 by Brian Aker
Encapsulate the internal share for HEAP.
40
  info->getShare()->changed=0;
916.1.26 by Padraig O'Sullivan
Initial work on removing LIST from the heap storage engine.
41
  heap_open_list.remove(info);
1697.2.1 by Brian Aker
Encapsulate the internal share for HEAP.
42
  if (!--info->getShare()->open_count && info->getShare()->delete_on_close)
43
    hp_free(info->getShare());				/* Table was deleted */
1697.2.2 by Brian Aker
Encapsulate some of heap.
44
  delete info;
51.3.1 by Jay Pipes
Removed all DBUG symbols from heap storage engine
45
  return(error);
1 by brian
clean slate
46
}