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 |
/*
|
|
17 |
Rename a table
|
|
18 |
*/
|
|
19 |
||
1130.3.28
by Monty Taylor
Moved heapdef.h and myisamdef.h to *_priv.h for easier filtering for include guard check. |
20 |
#include "heap_priv.h" |
656.1.25
by Monty Taylor
Removed my_malloc stuff from storage/ |
21 |
#include <string.h> |
1241.9.1
by Monty Taylor
Removed global.h. Fixed all the headers. |
22 |
#include <cstdlib> |
1
by brian
clean slate |
23 |
|
24 |
int heap_rename(const char *old_name, const char *new_name) |
|
25 |
{
|
|
1707.1.2
by Brian Aker
std::string usage for name, remove strdup. |
26 |
HP_SHARE *info; |
1
by brian
clean slate |
27 |
|
1689.3.6
by Brian Aker
Update for HEAP to convert its lock to boost. |
28 |
THR_LOCK_heap.lock(); |
1
by brian
clean slate |
29 |
if ((info = hp_find_named_heap(old_name))) |
30 |
{
|
|
1707.1.2
by Brian Aker
std::string usage for name, remove strdup. |
31 |
info->name.clear(); |
32 |
info->name.append(new_name); |
|
1
by brian
clean slate |
33 |
}
|
1689.3.6
by Brian Aker
Update for HEAP to convert its lock to boost. |
34 |
THR_LOCK_heap.unlock(); |
51.3.1
by Jay Pipes
Removed all DBUG symbols from heap storage engine |
35 |
return(0); |
1
by brian
clean slate |
36 |
}
|