public class Derby4923Test 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_SIZE
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Constructor and Description |
---|
Derby4923Test(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) |
private void |
callCompress(java.sql.Connection conn,
java.lang.String schemaName,
java.lang.String tableName,
boolean purgeRows,
boolean defragmentRows,
boolean truncateEnd,
boolean commit_operation)
call SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE() system procedure.
|
static junit.framework.Test |
suite() |
void |
testDERBY_4923()
DERBY-4923 test case
The update error occurs with the following:
o update of a long row which requires an update on it's overflow page
o 4k page
o the long row has 2 pieces, the second is a blob column and is
located on an overflow page.
|
getSpaceInfo
assertCallError, assertCheckTable, assertCommitError, assertCompileError, assertEquals, assertEquals, assertEquals, assertEquivalentDataType, assertErrorCode, assertGetIntError, assertNextError, assertPreparedStatementError, assertResults, assertResults, assertSQLExceptionEquals, assertSQLState, assertSQLState, assertStatementError, assertStatementError, assertStatementError, assertStatementError, assertStatementErrorUnordered, assertTableRowCount, assertUpdateCount, assertUpdateCount, assertWarning, chattyPrepare, chattyPrepareCall, checkAllConsistency, checkEstimatedRowCount, closeStatement, commit, createStatement, createStatement, createStatement, dropTable, dropTable, dropView, dropView, dumpRs, dumpRs, emptyStatementCache, executeQuery, expectCompilationError, expectCompilationError, expectExecutionError, getClientTransactionID, getConnection, getDatabaseProperty, getLastSQLException, goodStatement, goodUpdate, 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, usingEmbedded
alarm, assertDirectoryDeleted, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertLaunchedJUnitTestMethod, assertLaunchedJUnitTestMethod, assertSameNullness, assertSecurityManager, assertThrowableEquals, currentDirectory, execJavaCmd, execJavaCmd, execJavaCmd, fail, getClassVersionMajor, getEmmaJar, getFailureFolder, getFilesWith, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, hasInterruptibleIO, isCVM, isIBMJVM, isJ9Platform, isJava5, isJava7, isPhoneME, isPlatform, isSunJVM, isWindowsPlatform, newAssertionFailedError, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeFiles, removeSystemProperty, runsWithEmma, runsWithJaCoCo, setSystemErr, setSystemOut, setSystemProperty, sleep, sleepAtLeastOneTick, traceit, vmAtLeast
assertEquals, 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, toString
public Derby4923Test(java.lang.String name)
public void testDERBY_4923() throws java.sql.SQLException, java.lang.InterruptedException
The update error occurs with the following: o update of a long row which requires an update on it's overflow page o 4k page o the long row has 2 pieces, the second is a blob column and is located on an overflow page. o the overflow page has no space on the page. o the row id's are large enough such that they require 2 bytes to store (ie. greater than 64) o the piece located on the page already takes up the minimum size allowed for a row piece on an overflow page. In order to get to this one needs multiple rows on the overflow page, so that they can eat up the free space on the page. The original user report gave me multiple occurences of the issue. It always was on a overflow page that was full (sometimes 2 and 3 rows). The reported case was 4k pages and I was not able to reproduce on 32k. The updage of the blob column was greater than 4k. The test does the following: o drop/create table o insert 2000 small rows which will fill up a few pages with rows and make the next record id on those rows bigger than 64. o delete all those rows. o run compress to reclaim the space on all the pages and free up the pages so they can be used for overflow pages. o insert 3 short rows that will all end up on same main page. o expand row 1 so that it takes up most of main page. o update row 2 such that it becomes a long row with just the blob column on an overflow page. And subsequently shrink the overflow portion such that it takes the minimum space allowed on an overflow page. end up on same overflow page. o update row 3 such that it becomes a long row with overflow on same page as row 2 with just the blob column on an overflow page. Use a length so that it uses all free space on the overflow page. o Now update row 2 blob to make it bigger than 4k which causes the bug.
java.sql.SQLException
java.lang.InterruptedException
private void callCompress(java.sql.Connection conn, java.lang.String schemaName, java.lang.String tableName, boolean purgeRows, boolean defragmentRows, boolean truncateEnd, boolean commit_operation) throws java.sql.SQLException
Utility test function to call the system procedure.
java.sql.SQLException
protected static junit.framework.Test baseSuite(java.lang.String name)
public static junit.framework.Test suite()
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.