public class OrderByAndSortAvoidance extends BaseJDBCTestCase
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Constructor and Description |
---|
OrderByAndSortAvoidance(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
private void |
createIndexesForDerby6148(java.sql.Statement s) |
private void |
createTablesForDerby6148(java.sql.Statement s) |
private java.lang.String[][] |
getExpectedRowsDerby6148() |
private void |
insertDataForDerby6148() |
private static void |
insertTable1(java.sql.PreparedStatement ps,
long id)
Helper method that inserts a row into table1.
|
private static void |
insertTable2(java.sql.PreparedStatement ps,
long id,
java.lang.String name,
java.lang.String value)
Helper method that inserts a row into table2.
|
private static junit.framework.Test |
makeSuite()
Construct suite of tests
|
private static void |
populateTestTables(java.sql.Connection conn)
Populate table1 and table2 with the rows needed for reproducing
DERBY-3926.
|
static junit.framework.Test |
suite()
Construct top level suite in this JUnit test
|
void |
testAdditionalOrderByCases()
Some more tests for order by and sort avoidance logic
|
void |
testDerby4240OrderByCase()
Add a test case for DERBY-4240 where the rows were not ordered despite
an order by clause.
|
void |
testDerby4331()
Add a test case for DERBY-4331 where the rows were not ordered correctly
for both ascending and descending order by clause.
|
void |
testDerby6148() |
void |
testForcedIndexUseForWrongOrder()
Test for forcing the index use using optimizer override.
|
void |
testForceSortWithOptimizerOverrides()
Test for forcing a order of tables in the FROM list user optimizer
overrides.
|
void |
testWithNoOptimizerOverrides()
Following sql with no overrides also demonstrates the bug where we are
returning the results in wrong order
|
private static void |
updateTable2(java.sql.PreparedStatement ps,
long id)
Helper method that updates a row in table2
|
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 static junit.framework.Test suite()
private static junit.framework.Test makeSuite()
private static void insertTable1(java.sql.PreparedStatement ps, long id) throws java.sql.SQLException
ps
- parameterized statement that inserts a row into table1id
- the value of the id columnjava.sql.SQLException
private static void insertTable2(java.sql.PreparedStatement ps, long id, java.lang.String name, java.lang.String value) throws java.sql.SQLException
ps
- parameterized statement that inserts a row into table2id
- the value of the id columnname
- the value of the name columnvalue
- the value of the value columnjava.sql.SQLException
private static void updateTable2(java.sql.PreparedStatement ps, long id) throws java.sql.SQLException
ps
- parameterized statement that updates a row in table2id
- the id of the row to updatejava.sql.SQLException
private static void populateTestTables(java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
public void testDerby4331() throws java.sql.SQLException
java.sql.SQLException
public void testDerby4240OrderByCase() throws java.sql.SQLException
java.sql.SQLException
public void testAdditionalOrderByCases() throws java.sql.SQLException
java.sql.SQLException
public void testForceSortWithOptimizerOverrides() throws java.sql.SQLException
java.sql.SQLException
public void testWithNoOptimizerOverrides() throws java.sql.SQLException
java.sql.SQLException
public void testForcedIndexUseForWrongOrder() throws java.sql.SQLException
java.sql.SQLException
public void testDerby6148() throws java.sql.SQLException
java.sql.SQLException
private java.lang.String[][] getExpectedRowsDerby6148()
private void createTablesForDerby6148(java.sql.Statement s) throws java.sql.SQLException
java.sql.SQLException
private void createIndexesForDerby6148(java.sql.Statement s) throws java.sql.SQLException
java.sql.SQLException
private void insertDataForDerby6148() throws java.sql.SQLException
java.sql.SQLException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.