public class DistinctTest extends BaseJDBCTestCase
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Constructor and Description |
---|
DistinctTest(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
assertRowCount(int count,
java.sql.ResultSet rs)
Assert that the number of rows in the result set matches what we are expecting.
|
private void |
checkDistinctRows(int[] rowcounts)
Runs a set of 37 SQL queries on the current data in table t, testing
a number of different column combinations, predicates, and subqueries.
|
static junit.framework.Test |
suite() |
void |
testBasicDistinct() |
void |
testDistinctElimination()
Tests queries where distinct scan is eliminated.
|
void |
testDistinctFiltering() |
void |
testDistinctIdenticalAndDifferingRows() |
void |
testDistinctIdenticalNullRows() |
void |
testDistinctInInsert() |
void |
testDistinctInsertWithGeneratedColumn()
This test demonstrates that using distinct in a query for insert
does not cause gaps in numbering in autoincremented columns.
|
void |
testDistinctInValuesClause() |
void |
testDistinctManyNullRows() |
void |
testDistinctMixedNullRows() |
void |
testDistinctPaddingInVarcharIgnored() |
void |
testDistinctScanForSubquery()
Tests for DERBY-504 (select distinct from a subquery)
|
void |
testDistinctSomeNullRows() |
void |
testDistinctStoreSort() |
void |
testDistinctSyntaxErrors() |
void |
testDistinctTwoVaryingRows() |
void |
testDistinctWithBigInt() |
void |
testDistinctWithUpdatedRows() |
void |
testIdenticalRows() |
void |
testNoData() |
void |
testOneRow() |
void |
testResultSetInOrderWhenUsingIndex() |
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()
public void testNoData() throws java.sql.SQLException
java.sql.SQLException
public void testOneRow() throws java.sql.SQLException
java.sql.SQLException
public void testIdenticalRows() throws java.sql.SQLException
java.sql.SQLException
public void testDistinctIdenticalAndDifferingRows() throws java.sql.SQLException
java.sql.SQLException
public void testDistinctTwoVaryingRows() throws java.sql.SQLException
java.sql.SQLException
public void testDistinctIdenticalNullRows() throws java.sql.SQLException
java.sql.SQLException
public void testDistinctSomeNullRows() throws java.sql.SQLException
java.sql.SQLException
public void testDistinctManyNullRows() throws java.sql.SQLException
java.sql.SQLException
public void testDistinctMixedNullRows() throws java.sql.SQLException
java.sql.SQLException
public void testDistinctInValuesClause() throws java.sql.SQLException
java.sql.SQLException
public void testDistinctSyntaxErrors() throws java.sql.SQLException
java.sql.SQLException
public void testBasicDistinct() throws java.sql.SQLException
java.sql.SQLException
public void testDistinctPaddingInVarcharIgnored() throws java.sql.SQLException
java.sql.SQLException
public void testDistinctWithBigInt() throws java.sql.SQLException
java.sql.SQLException
public void testDistinctWithUpdatedRows() throws java.sql.SQLException
java.sql.SQLException
public void testDistinctInInsert() throws java.sql.SQLException
java.sql.SQLException
public void testDistinctInsertWithGeneratedColumn() throws java.sql.SQLException
java.sql.SQLException
public void testResultSetInOrderWhenUsingIndex() throws java.sql.SQLException
java.sql.SQLException
public void testDistinctStoreSort() throws java.sql.SQLException
java.sql.SQLException
public void testDistinctScanForSubquery() throws java.sql.SQLException
java.sql.SQLException
public void testDistinctElimination() throws java.sql.SQLException
java.sql.SQLException
public void testDistinctFiltering() throws java.sql.SQLException
java.sql.SQLException
private void checkDistinctRows(int[] rowcounts) throws java.sql.SQLException
rowcounts
- an array of integers with the expected row count for
each query.java.sql.SQLException
public void assertRowCount(int count, java.sql.ResultSet rs) throws java.sql.SQLException
count
- the number of rows we expect to findrs
- the result set to checkjava.sql.SQLException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.