1 /***************************************************************************
2 * Copyright (C) 2007 by Prabakaran Thirumalai *
3 * praba_tuty@yahoo.com *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
22 #include <AbsSqlStatement.h>
23 #include <SqlConnection.h>
24 #include <SqlStatement.h>
26 class DllExport Recovery
30 //contains pointer to start address of the mapped redo log file
31 //used to traverse till the end of the mapping during redo log processing
38 void setStmtBucket(void *ptr
) { stmtBuckets
= ptr
; }
40 //do not free stmtBuckets
43 void addToHashTable(int stmtID
, AbsSqlStatement
* sHdl
, char *stmtstr
);
44 void removeFromHashTable(int stmtID
);
45 AbsSqlStatement
*getStmtFromHashTable(int stmtId
);
46 bool isStmtInHashTable(int stmtID
);
47 void freeAllStmtHandles();
48 DbRetVal
filterAndWriteStmtLogs();
49 DbRetVal
readAndPopulateStmts(AbsSqlConnection
*conn
, bool list
= false, bool interactive
= false);
50 DbRetVal
iterateStmtLogs(AbsSqlConnection
*conn
, void *startAddr
, int size
, bool list
=false, bool interactive
= false);
52 int applyRedoLogs(char *redoFile
, AbsSqlConnection
*conn
, bool list
= false, bool interactive
= false);
54 #if (defined MMDB && defined EMBED)
55 DbRetVal
recoverCsqlDB(SqlConnection
*conn
);
56 DbRetVal
recoverSystemAndUserDB(SqlConnection
*conn
);
57 DbRetVal
applySchemaFile(FILE *fp
, SqlConnection
*conn
);
58 char getQueryFromSchemaFile(FILE *fp
, char *buf
);
62 //before calling below 4 handleXXX methods, iter should be set
63 DbRetVal
handlePrepare( AbsSqlConnection
*conn
, bool list
=false, bool interactive
= false);
64 DbRetVal
handleCommit(AbsSqlConnection
*conn
, void *startAddr
, long size
, bool list
=false, bool interactive
= false);
65 DbRetVal
handleFree(bool list
=false, bool interactive
= false);
66 DbRetVal
handlePrepareAndExecute(AbsSqlConnection
*conn
, bool list
=false, bool interactive
= false);