public class dropcrash extends BaseTest
This test reproduces the problem by doing the following: 1) create 500 tables, need enough tables to insure that conglomerate number 2080 (c820.dat) and 8320 (c2080.dat) exist. 2) checkpoint the database so that create does not happen during REDO 3) drop table with conglomerate number 2080, mapping to c820.dat. It looks it up in the catalog in case conglomerate number assignment changes for some reason. 4) exit the database without a clean shudown, this is the default for test suites which run multiple tests in a single db - no clean shutdown is done. Since we only do a single drop since the last checkpoint, test will cause the drop during the subsequent REDO. 5) run next test program dropcrash2, which will cause redo of the drop. At this point the bug will cause file c2080.dat to be incorrectly deleted and thus accesses to conglomerate 8320 will throw container does not exist errors. 6) check the consistency of the database which will find the container does not exist error.
Modifier and Type | Field and Description |
---|---|
(package private) boolean |
verbose |
SPACE_INFO_ESTIMSPACESAVING, SPACE_INFO_IS_INDEX, SPACE_INFO_NUM_ALLOC, SPACE_INFO_NUM_FREE, SPACE_INFO_NUM_UNFILLED, SPACE_INFO_NUMCOLS, SPACE_INFO_PAGE_SIZE
Constructor and Description |
---|
dropcrash() |
Modifier and Type | Method and Description |
---|---|
void |
drop_crash_drop_table(java.sql.Connection conn)
Reproduce JIRA DERBY-662
Find the conglomerate with number 2080, and drop it.
|
void |
drop_crash_setup(java.sql.Connection conn,
int num_create)
create tables, commit, and cause checkpoint of db.
|
static void |
main(java.lang.String[] argv) |
void |
testList(java.sql.Connection conn) |
beginTest, checkAllConsistency, checkConsistency, createDebugSystemProcedures, createTable, dump_table, endTest, executeQuery, get_lock_info, getSpaceInfo, log, logError, runTests, testProgress, total_pages
public void drop_crash_setup(java.sql.Connection conn, int num_create) throws java.sql.SQLException
java.sql.SQLException
public void drop_crash_drop_table(java.sql.Connection conn) throws java.sql.SQLException
Find the conglomerate with number 2080, and drop it. The bug is that during redo the system, on windows, will incorrectly delete C2080.dat because it did not do the hex conversion on the conglomerate number. This will result in conglomerate 8320 not having it's associate data file c2080.dat.
StandardException
- Standard exception policy.java.sql.SQLException
public void testList(java.sql.Connection conn) throws java.sql.SQLException
public static void main(java.lang.String[] argv) throws java.lang.Throwable
java.lang.Throwable
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.