~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
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
16
/* close a heap-database */
17
18
#include "heapdef.h"
19
916.1.26 by Padraig O'Sullivan
Initial work on removing LIST from the heap storage engine.
20
using namespace std;
21
1 by brian
clean slate
22
	/* Close a database open by hp_open() */
23
	/* Data is normally not deallocated */
24
25
int heap_close(HP_INFO *info)
26
{
27
  int tmp;
28
  pthread_mutex_lock(&THR_LOCK_heap);
29
  tmp= hp_close(info);
30
  pthread_mutex_unlock(&THR_LOCK_heap);
51.3.1 by Jay Pipes
Removed all DBUG symbols from heap storage engine
31
  return(tmp);
1 by brian
clean slate
32
}
33
34
916.1.27 by Padraig O'Sullivan
Removing the declaration of a variable as register. Is this really needed
35
int hp_close(HP_INFO *info)
1 by brian
clean slate
36
{
37
  int error=0;
38
  info->s->changed=0;
916.1.26 by Padraig O'Sullivan
Initial work on removing LIST from the heap storage engine.
39
  heap_open_list.remove(info);
1 by brian
clean slate
40
  if (!--info->s->open_count && info->s->delete_on_close)
41
    hp_free(info->s);				/* Table was deleted */
481 by Brian Aker
Remove all of uchar.
42
  free((unsigned char*) info);
51.3.1 by Jay Pipes
Removed all DBUG symbols from heap storage engine
43
  return(error);
1 by brian
clean slate
44
}