1 /* Copyright (c) 2000, 2001, 2005, 2006 MySQL AB
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.
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.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
18 /* if flag == HA_PANIC_CLOSE then all misam files are closed */
19 /* if flag == HA_PANIC_WRITE then all misam files are unlocked and
20 all changed data in single user misam is written to file */
21 /* if flag == HA_PANIC_READ then all misam files that was locked when
22 mi_panic(HA_PANIC_WRITE) was done is locked. A mi_readinfo() is
23 done for all single user files to get changes in database */
26 int myrg_panic(enum ha_panic_function flag
)
29 LIST
*list_element
,*next_open
;
31 DBUG_ENTER("myrg_panic");
33 for (list_element
=myrg_open_list
; list_element
; list_element
=next_open
)
35 next_open
=list_element
->next
; /* Save if close */
36 info
=(MYRG_INFO
*) list_element
->data
;
37 if (flag
== HA_PANIC_CLOSE
&& myrg_close(info
))
40 if (myrg_open_list
&& flag
!= HA_PANIC_CLOSE
)
41 DBUG_RETURN(mi_panic(flag
));