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, assertCompileError, assertEquals, assertEquals, assertEquals, assertEquivalentDataType, assertErrorCode, assertGetIntError, assertNextError, assertPreparedStatementError, assertSQLExceptionEquals, assertSQLState, assertSQLState, assertStatementError, assertStatementError, assertStatementError, assertStatementError, assertStatementErrorUnordered, assertTableRowCount, assertUpdateCount, assertUpdateCount, assertWarning, checkAllConsistency, checkEstimatedRowCount, closeStatement, commit, createStatement, createStatement, createStatement, dropTable, dropTable, dropView, dropView, emptyStatementCache, getClientTransactionID, getConnection, getDatabaseProperty, getLastSQLException, 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, usingEmbeddedalarm, assertDirectoryDeleted, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertLaunchedJUnitTestMethod, assertLaunchedJUnitTestMethod, assertSecurityManager, assertThrowableEquals, currentDirectory, execJavaCmd, execJavaCmd, fail, getClassVersionMajor, getEmmaJar, getFailureFolder, getFilesWith, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, hasInterruptibleIO, isCVM, isIBMJVM, isJ9Platform, isJava5, isJava7, isJava8, isPhoneME, isPlatform, isSunJVM, isWindowsPlatform, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeFiles, removeSystemProperty, runsWithEmma, runsWithJaCoCo, setSystemProperty, sleep, sleepAtLeastOneTick, traceitassertEquals, 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, toStringpublic static junit.framework.Test suite()
public void testNoData()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testOneRow()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testIdenticalRows()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testDistinctIdenticalAndDifferingRows()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testDistinctTwoVaryingRows()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testDistinctIdenticalNullRows()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testDistinctSomeNullRows()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testDistinctManyNullRows()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testDistinctMixedNullRows()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testDistinctInValuesClause()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testDistinctSyntaxErrors()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testBasicDistinct()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testDistinctPaddingInVarcharIgnored()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testDistinctWithBigInt()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testDistinctWithUpdatedRows()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testDistinctInInsert()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testDistinctInsertWithGeneratedColumn()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testResultSetInOrderWhenUsingIndex()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testDistinctStoreSort()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testDistinctScanForSubquery()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testDistinctElimination()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testDistinctFiltering()
throws java.sql.SQLException
java.sql.SQLExceptionprivate void checkDistinctRows(int[] rowcounts)
throws java.sql.SQLException
rowcounts - an array of integers with the expected row count for
each query.java.sql.SQLExceptionpublic 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.SQLExceptionApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.