public class SubqueryFlatteningTest extends BaseJDBCTestCase
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Constructor and Description |
---|
SubqueryFlatteningTest(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
private void |
checkExistsJoin(java.sql.Statement s,
java.lang.String sql,
java.lang.String[][] rows,
boolean flattenable)
Check that a query returns the expected rows and whether or not it was
flattened to an exists join (or not exists join).
|
private void |
enableRuntimeStatistics(java.sql.Statement s)
Enable collection of runtime statistics in the current connection.
|
protected void |
setUp()
Set up the test environment.
|
static junit.framework.Test |
suite() |
void |
testAllNotFlattenableToNotExists()
DERBY-4001: Test that some ALL subqueries that used to be flattened to
a not exists join and return incorrect results, are not flattened.
|
void |
testNotExistsFlattenablePredicatesNotPulled()
DERBY-4001: Test that certain NOT EXISTS/NOT IN/ALL subqueries are
flattened, and that their predicates are not pulled out.
|
void |
testNotInNotFlattenableToNotExists()
DERBY-4001: Test that some NOT IN subqueries that used to be flattened
to a not exists join and return incorrect results, are not flattened.
|
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, toString
public static junit.framework.Test suite()
protected void setUp() throws java.sql.SQLException
BaseJDBCTestCase.tearDown()
.setUp
in class junit.framework.TestCase
java.sql.SQLException
private void enableRuntimeStatistics(java.sql.Statement s) throws java.sql.SQLException
s
- the statement to use for enabling runtime statisticsjava.sql.SQLException
private void checkExistsJoin(java.sql.Statement s, java.lang.String sql, java.lang.String[][] rows, boolean flattenable) throws java.sql.SQLException
s
- the statement on which the query is executedsql
- the query textrows
- the expected resultflattenable
- whether or not we expect the query to be flattened
to a (not) exists joinjava.sql.SQLException
- if a database error occursjunit.framework.AssertionFailedError
- if the wrong results are
returned from the query, or if the query plan is not as expectedpublic void testNotExistsFlattenablePredicatesNotPulled() throws java.sql.SQLException
java.sql.SQLException
public void testAllNotFlattenableToNotExists() throws java.sql.SQLException
java.sql.SQLException
public void testNotInNotFlattenableToNotExists() throws java.sql.SQLException
java.sql.SQLException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.