public class JoinTest extends BaseJDBCTestCase
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
AMBIGUOUS_COLNAME |
private static java.lang.String |
COLUMN_NOT_IN_SCOPE |
private static java.lang.String |
NO_COLUMNS |
private static java.lang.String |
NON_COMPARABLE |
private static java.lang.String |
SYNTAX_ERROR |
private static java.lang.String |
TABLE_NAME_NOT_IN_SCOPE |
private static java.lang.String |
VALUES_WITH_NULL |
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Constructor and Description |
---|
JoinTest(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
private static java.lang.String[][] |
cross(java.lang.String[][] t1,
java.lang.String[][] t2)
Calculate the Cartesian product of two tables.
|
private void |
fillTable(java.lang.String sql,
java.lang.String[][] data)
Fill a table with rows.
|
(package private) static void |
insertTourRow(java.sql.PreparedStatement ps,
int a,
java.lang.String b,
java.lang.String c) |
(package private) static void |
insertTourRow(java.sql.PreparedStatement ps,
java.lang.String a,
java.lang.String b) |
private static java.lang.String[][] |
project(int[] cols,
java.lang.String[][] rows)
Project columns from a table.
|
private static java.lang.String[][] |
reverse(java.lang.String[][] rows)
Reverse the order of rows in a table.
|
static junit.framework.Test |
suite() |
void |
testCrossJoins()
Test the CROSS JOIN syntax that was added in DERBY-4355.
|
void |
testDerby_4405()
Derby-4405 improve rewrite of OUTER JOIN to INNER JOIN in presence of
null intolerant predicate.
|
void |
testDerby_4679()
DERBY-4679.
|
void |
testDerby_4695()
This test works prior to applying the patch for DERBY-4695, but the
corrected (internal, intermediate) behavior can be observed by applying
the patch
trace-remapping.diff attached to this issue in JIRA and
copmparing the results before and after the rest of the patch is
applied. |
void |
testDerby_5933()
DERBY-5933.
|
void |
testDerby4372()
DERBY-4372: Some joins used to miss some rows after an index was
created, because the start and stop keys passed to the index scan were
wrong if the IN list in the JOIN condition contained a NULL.
|
void |
testDerby4387()
Test that computation of transitive closure of equi-join does not give
rise to eternal loop in a case where a predicate of type T1.x = T1.y is
added to the closure.
|
void |
testNaturalJoin()
Tests for the NATURAL JOIN syntax added in DERBY-4495.
|
void |
testNullabilityInLeftOrRightOuterJoin()
Test that the columns returned by a left or right outer join have the
correct nullability.
|
void |
testNullabilityInValues()
DERBY-4365 Test that the NULL values are caught in VALUES clause when it
is part of a non-INSERT statement.
|
void |
testSubqueryInON()
Test that ON clauses can contain subqueries (DERBY-4380).
|
void |
testUsingClause()
Tests for the USING clause added in DERBY-4370.
|
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
private static final java.lang.String SYNTAX_ERROR
private static final java.lang.String AMBIGUOUS_COLNAME
private static final java.lang.String COLUMN_NOT_IN_SCOPE
private static final java.lang.String NON_COMPARABLE
private static final java.lang.String NO_COLUMNS
private static final java.lang.String TABLE_NAME_NOT_IN_SCOPE
private static final java.lang.String VALUES_WITH_NULL
public static junit.framework.Test suite()
public void testNullabilityInValues() throws java.sql.SQLException
java.sql.SQLException
public void testNullabilityInLeftOrRightOuterJoin() throws java.sql.SQLException
java.sql.SQLException
public void testDerby4372() throws java.sql.SQLException
java.sql.SQLException
public void testCrossJoins() throws java.sql.SQLException
java.sql.SQLException
private void fillTable(java.lang.String sql, java.lang.String[][] data) throws java.sql.SQLException
sql
- the insert statement used to populate the tabledata
- the rows to insert into the tablejava.sql.SQLException
private static java.lang.String[][] cross(java.lang.String[][] t1, java.lang.String[][] t2)
t1
- the rows in the table on the left sidet2
- the rows in the table on the right sideprivate static java.lang.String[][] project(int[] cols, java.lang.String[][] rows)
cols
- the column indexes (0-based) to projectrows
- the rows in the tableprivate static java.lang.String[][] reverse(java.lang.String[][] rows)
rows
- the rows in the tablepublic void testUsingClause() throws java.sql.SQLException
java.sql.SQLException
public void testNaturalJoin() throws java.sql.SQLException
java.sql.SQLException
public void testSubqueryInON() throws java.sql.SQLException
java.sql.SQLException
public void testDerby4387() throws java.sql.SQLException
java.sql.SQLException
public void testDerby_4405() throws java.sql.SQLException
java.sql.SQLException
static void insertTourRow(java.sql.PreparedStatement ps, java.lang.String a, java.lang.String b) throws java.sql.SQLException
java.sql.SQLException
static void insertTourRow(java.sql.PreparedStatement ps, int a, java.lang.String b, java.lang.String c) throws java.sql.SQLException
java.sql.SQLException
public void testDerby_4679() throws java.sql.SQLException
java.sql.SQLException
public void testDerby_4695() throws java.sql.SQLException
trace-remapping.diff
attached to this issue in JIRA and
copmparing the results before and after the rest of the patch is
applied.java.sql.SQLException
public void testDerby_5933() throws java.sql.SQLException
java.sql.SQLException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.