public class RestrictedVTITest extends GeneratedColumnsHelper
Test RestrictedVTIs. See DERBY-4357.
BAD_BEFORE_TRIGGER, BAD_CAST, BAD_FOREIGN_KEY_ACTION, CANT_CONTAIN_NULLS, CANT_MODIFY_IDENTITY, CANT_OVERRIDE_GENERATION_CLAUSE, CANT_REFERENCE_GENERATED_COLUMN, CASCADED_COLUMN_DROP_WARNING, COLUMN_OUT_OF_SCOPE, CONSTRAINT_DROPPED_WARNING, CONSTRAINT_VIOLATION, DUPLICATE_CLAUSE, FORBIDDEN_DROP_TRIGGER, FORBIDDEN_ORDERING_OPERATION, FOREIGN_KEY_VIOLATION, GRANT_REVOKE_NOT_ALLOWED, ILLEGAL_ADD_DEFAULT, ILLEGAL_AGG, ILLEGAL_AGGREGATE, ILLEGAL_COMPARISON, ILLEGAL_DUPLICATE, ILLEGAL_RENAME, ILLEGAL_STORAGE, ILLEGAL_UDT_CLASS, JAVA_EXCEPTION, LACK_COLUMN_PRIV, LACK_EXECUTE_PRIV, LACK_TABLE_PRIV, LACK_USAGE_PRIV, LANG_INVALID_USE_OF_DEFAULT, LEXICAL_ERROR, LOCK_TIMEOUT, MISSING_OBJECT, NEED_EXPLICIT_DATATYPE, NO_GENERIC_PERMISSION, NO_SELECT_OR_UPDATE_PERMISSION, NO_TABLE_PERMISSION, NON_EMPTY_SCHEMA, NONEXISTENT_OBJECT, NOT_IMPLEMENTED, NOT_NULL_NEEDS_DATATYPE, NOT_NULL_VIOLATION, OBJECT_DOES_NOT_EXIST, OPERATION_FORBIDDEN, REDUNDANT_CLAUSE, ROUTINE_CANT_ISSUE_SQL, ROUTINE_DEPENDS_ON_TYPE, STRING_TRUNCATION, SYNTAX_ERROR, TABLE_DEPENDS_ON_TYPE, TOO_MUCH_CONTENTION, TRIGGER_DROPPED_WARNING, UNSTABLE_RESULTS, VIEW_DEPENDENCY
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Constructor and Description |
---|
RestrictedVTITest(java.lang.String name)
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
private void |
assertPR(java.sql.Connection conn,
java.lang.String query,
java.lang.String[][] expectedResults,
java.lang.String expectedProjection,
java.lang.String expectedRestriction)
Run a query against a RestrictedVTI and verify that the expected
projection and restriction are pushed into the VTI.
|
private void |
assertPR(java.sql.Connection conn,
java.lang.String query,
java.lang.String[][] expectedResults,
java.lang.String expectedProjection,
java.lang.String expectedRestriction,
int expectedQualifiedRowCount)
Run a query against a RestrictedVTI, verify that the expected
projection and restriction are pushed into the VTI, and verify
that the VTI returns the expected number of rows.
|
private static java.lang.String |
doubleQuote(java.lang.String text) |
private static java.lang.Integer |
i(int intValue) |
static IntegerArrayVTI |
integerList() |
static IntegerArrayVTI |
integerListSpecialColNames() |
static IntegerArrayVTI |
nullableIntegerList() |
private boolean |
routineExists(java.sql.Connection conn,
java.lang.String functionName)
Return true if the SQL routine exists
|
protected void |
setUp() |
static junit.framework.Test |
suite()
Construct top level suite in this JUnit test
|
private boolean |
tableExists(java.sql.Connection conn,
java.lang.String tableName)
Return true if the table exists
|
void |
test_01_heartbeat()
Heartbeat test to verify that projections and restrictions are being
pushed into RestrictedVTIs.
|
void |
test_02_aliasing()
Verify that aliases are correctly mapped to table column names.
|
void |
test_03_allRelationalOperators()
Verify that all relational operators are handled.
|
void |
test_04_misc()
Miscellaneous conditions.
|
void |
test_05_joins()
Test joins to RestrictedVTIs.
|
void |
test_06_distinct()
Test DISTINCT.
|
void |
test_07_subqueries()
Test subqueries.
|
void |
test_08_having()
Predicates in HAVING clauses are not (yet) pushed down to the VTI.
|
void |
test_09_4651()
Verify that attempts to create a trailing constant qualification do no
cause the VTI to return the wrong rows.
|
void |
test_10_quotes_in_column_names()
Test that
Restriction.toSQL() returns properly quoted column
names. |
void |
test_11_5369_5370()
Verify that Restriction.toSQL() returns usable SQL for all of the
comparable types.
|
void |
test_12_6036()
Verify that if you wrap a RestrictedVTI in a view, selects
from the view pass the restriction on to the RestrictedVTI.
|
private void |
vet5370negative(java.lang.String columnName,
java.lang.String columnValue) |
private void |
vet5370positive(java.sql.Connection conn,
java.lang.String columnName,
java.lang.String columnValue,
java.lang.String expectedValue,
java.lang.String negatedValue) |
private int |
vetDatatypeCount(java.sql.Connection conn,
int expectedTypeCount) |
assertColumnTypes, assertDeterministic, expectExecutionWarning, expectExecutionWarnings, expectInsertRowError, expectNoWarning, expectUpdateRowError, fill, verifyRestrictedDrop, verifyRevokePrivilege
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 RestrictedVTITest(java.lang.String name)
public static junit.framework.Test suite()
protected void setUp() throws java.lang.Exception
setUp
in class junit.framework.TestCase
java.lang.Exception
public void test_01_heartbeat() throws java.lang.Exception
Heartbeat test to verify that projections and restrictions are being pushed into RestrictedVTIs.
java.lang.Exception
public void test_02_aliasing() throws java.lang.Exception
Verify that aliases are correctly mapped to table column names. Also verify that SELECT list expressions cause columns to be included in the column list. Also verify that predicates which aren't qualifiers are not included in the restriction.
java.lang.Exception
public void test_03_allRelationalOperators() throws java.lang.Exception
Verify that all relational operators are handled.
java.lang.Exception
public void test_04_misc() throws java.lang.Exception
Miscellaneous conditions.
java.lang.Exception
public void test_05_joins() throws java.lang.Exception
Test joins to RestrictedVTIs.
java.lang.Exception
public void test_06_distinct() throws java.lang.Exception
Test DISTINCT.
java.lang.Exception
public void test_07_subqueries() throws java.lang.Exception
Test subqueries.
java.lang.Exception
public void test_08_having() throws java.lang.Exception
java.lang.Exception
public void test_09_4651() throws java.lang.Exception
java.lang.Exception
public void test_10_quotes_in_column_names() throws java.lang.Exception
Restriction.toSQL()
returns properly quoted column
names. DERBY-4654.java.lang.Exception
public void test_11_5369_5370() throws java.lang.Exception
java.lang.Exception
private void vet5370positive(java.sql.Connection conn, java.lang.String columnName, java.lang.String columnValue, java.lang.String expectedValue, java.lang.String negatedValue) throws java.lang.Exception
java.lang.Exception
private static java.lang.String doubleQuote(java.lang.String text)
private void vet5370negative(java.lang.String columnName, java.lang.String columnValue) throws java.lang.Exception
java.lang.Exception
private int vetDatatypeCount(java.sql.Connection conn, int expectedTypeCount) throws java.lang.Exception
java.lang.Exception
public void test_12_6036() throws java.lang.Exception
java.lang.Exception
public static IntegerArrayVTI integerList()
public static IntegerArrayVTI nullableIntegerList()
private static java.lang.Integer i(int intValue)
public static IntegerArrayVTI integerListSpecialColNames()
private boolean routineExists(java.sql.Connection conn, java.lang.String functionName) throws java.lang.Exception
java.lang.Exception
private boolean tableExists(java.sql.Connection conn, java.lang.String tableName) throws java.lang.Exception
java.lang.Exception
private void assertPR(java.sql.Connection conn, java.lang.String query, java.lang.String[][] expectedResults, java.lang.String expectedProjection, java.lang.String expectedRestriction, int expectedQualifiedRowCount) throws java.lang.Exception
Run a query against a RestrictedVTI, verify that the expected projection and restriction are pushed into the VTI, and verify that the VTI returns the expected number of rows.
java.lang.Exception
private void assertPR(java.sql.Connection conn, java.lang.String query, java.lang.String[][] expectedResults, java.lang.String expectedProjection, java.lang.String expectedRestriction) throws java.lang.Exception
Run a query against a RestrictedVTI and verify that the expected projection and restriction are pushed into the VTI.
java.lang.Exception
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.