public class Derby3625Test extends StoreBaseTest
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_SIZEDEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE| Constructor and Description |
|---|
Derby3625Test(java.lang.String name)
Public Methods of XXXX class:
|
| Modifier and Type | Method and Description |
|---|---|
protected static junit.framework.Test |
baseSuite(java.lang.String name) |
static junit.framework.Test |
suite() |
void |
testTwoToOneByteCase()
DERBY-3625 test case
Derby 3625 is caused by a bug where compress calculates the space
needed to fit a moved row from page A to B, and assumes that the space
required on page B is the same on page A.
|
getSpaceInfoassertCallError, assertCheckTable, assertCompileError, assertEquals, assertEquals, assertEquals, assertEquivalentDataType, assertErrorCode, assertGetIntError, assertNextError, assertPreparedStatementError, assertSQLExceptionEquals, assertSQLState, assertSQLState, assertStatementError, assertStatementError, assertStatementError, assertStatementError, assertStatementErrorUnordered, assertTableRowCount, assertUpdateCount, assertUpdateCount, assertWarning, checkAllConsistency, checkEstimatedRowCount, closeStatement, commit, createStatement, createStatement, createStatement, dropTable, dropTable, dropView, dropView, emptyStatementCache, getClientTransactionID, getConnection, getDatabaseProperty, getLastSQLException, initializeConnection, openConnection, openDefaultConnection, openDefaultConnection, openDefaultConnection, openUserConnection, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, rollback, runBare, runBareOverridable, runScript, runScript, runSQLCommands, setAutoCommit, tearDown, usingDB2Client, usingDerbyNetClient, usingEmbeddedalarm, assertDirectoryDeleted, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertLaunchedJUnitTestMethod, assertLaunchedJUnitTestMethod, assertSecurityManager, assertThrowableEquals, currentDirectory, execJavaCmd, execJavaCmd, fail, getClassVersionMajor, getEmmaJar, getFailureFolder, getFilesWith, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, hasInterruptibleIO, isCVM, isIBMJVM, isJ9Platform, isJava5, isJava7, isJava8, isPhoneME, isPlatform, isSunJVM, isWindowsPlatform, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeFiles, removeSystemProperty, runsWithEmma, runsWithJaCoCo, setSystemProperty, sleep, sleepAtLeastOneTick, traceitassertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runTest, setName, setUp, toStringpublic Derby3625Test(java.lang.String name)
public void testTwoToOneByteCase()
throws java.sql.SQLException
Derby 3625 is caused by a bug where compress calculates the space needed to fit a moved row from page A to B, and assumes that the space required on page B is the same on page A. The problem is that in some cases due to the stored format of the changing record id the space required on B may be more than A. In the case where there is exactly enough space by the initial calculation the move fails because one or 3 more bytes may be necessary to make the move and the compress fails.
To test: fill page 1 with dummy rows, page 1 has a special control row on it so it can't ever be empty so use page 2 instead. fill page 2 with dummy rows such and empty it such that the next row id on it is greater that 64 which takes 2 bytes to store vs. 1 for rowid's less * that 64. fill page 3 and 4 with some dummy rows which will be deleted to give compress table room to work during defragment. fill page 4 with 2 rows which fit on page 2 with 1 byte stored record id's but will not fit with 2 byte stored record id's. These will not be deleted and the bug is exercised as defragment tries to move these rows to page 2 after it has been reclaimed as a free page.
java.sql.SQLExceptionprotected static junit.framework.Test baseSuite(java.lang.String name)
public static junit.framework.Test suite()
Apache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.