public final class AlterTableTest extends BaseJDBCTestCase
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
CANNOT_ALTER_NON_IDENTITY_COLUMN |
private static java.lang.String |
CANNOT_MODIFY_ALWAYS_IDENTITY_COLUMN |
private static java.lang.String |
DUPLICATE_KEY |
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Constructor and Description |
---|
AlterTableTest(java.lang.String name)
Public constructor required for running test as standalone JUnit.
|
Modifier and Type | Method and Description |
---|---|
private void |
assertBytes(byte[] expected,
byte[] actual) |
private void |
checkValStartInc(java.sql.Statement st,
java.lang.String nm,
java.lang.String v,
java.lang.String s,
java.lang.String inc) |
private void |
checkWarning(java.sql.Statement st,
java.lang.String expectedWarning) |
private void |
createTableAndInsertData(java.sql.Statement s,
java.lang.String tableName,
java.lang.String column1,
java.lang.String column2) |
private void |
createTestObjects(java.sql.Statement st) |
private byte[] |
makeBytes(int seed,
int length) |
private int |
numberOfRowsInSysdepends(java.sql.Statement st) |
static junit.framework.Test |
suite() |
void |
test_5679_longRows()
More tests for DERBY-5679.
|
void |
test_5679_manyColumns()
More tests for DERBY-5679.
|
void |
test_5679()
Verify that rollback works properly if a column with a null default
is added and then the table is updated.
|
void |
test_6882_import()
Second test for feature 6882.
|
void |
test_6882()
Test that identity columns can be switched between
ALWAYS and DEFAULT modes.
|
void |
testAddColumn() |
void |
testAddConstraint() |
void |
testAddIdentityColumn() |
void |
testAddIdentityColumn2()
Slight changes to testAddIdentityColumn.
|
void |
testAddIdentityColumn3()
Slight changes to testAddIdentityColumn.
|
void |
testAddIdentityColumn4()
Slight changes to testAddIdentityColumn.
|
void |
testAddIdentityColumn5()
Slight changes to testAddIdentityColumn.
|
void |
testAlterColumn() |
private void |
testAlterColumnNullability(java.sql.Statement st,
boolean standardSyntax)
Test cases for altering the nullability of a column.
|
void |
testAlterTableAndSysdepends() |
void |
testDerby5157_addColumnWithDefaultValue()
Test that an ALTER TABLE statement that adds a new column with a
default value, doesn't fail if the schema name, table name or column
name contains a double quote character.
|
void |
testDerby5157_changeIncrement()
Test that an ALTER TABLE statement that changes the increment value of
an identity column, doesn't fail if the schema name, table name or
column name contains a double quote character.
|
void |
testDropColumn() |
void |
testDropColumnTriggerDependency() |
void |
testDropConstraint() |
void |
testDropObjects() |
void |
testJira2371() |
void |
testJira3175() |
void |
testJira3177() |
void |
testJira3355() |
void |
testJira4256() |
void |
testRenameAutoincrementColumn()
See DERBY-4693 for a case where this was broken.
|
void |
testTemporaryTable() |
void |
testTriggersAndSynonyms() |
void |
testWithSchema() |
private void |
triggersExist(java.sql.Statement st,
java.lang.String[][] expectedTriggers) |
private void |
vetBytes_5679(java.sql.Connection conn,
byte[][] expected) |
private void |
vetSequenceState(java.lang.String tableName,
java.lang.String columnDatatype,
long currentValue,
long startValue,
long stepValue) |
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 CANNOT_ALTER_NON_IDENTITY_COLUMN
private static final java.lang.String CANNOT_MODIFY_ALWAYS_IDENTITY_COLUMN
private static final java.lang.String DUPLICATE_KEY
public AlterTableTest(java.lang.String name)
public static junit.framework.Test suite()
private void createTestObjects(java.sql.Statement st) throws java.sql.SQLException
java.sql.SQLException
private void checkWarning(java.sql.Statement st, java.lang.String expectedWarning) throws java.lang.Exception
java.lang.Exception
public void testAddColumn() throws java.lang.Exception
java.lang.Exception
public void testAddIdentityColumn() throws java.sql.SQLException
java.sql.SQLException
public void testAddIdentityColumn5() throws java.sql.SQLException
Another version of testAddIdenityColumn that provides slightly different code path, found useful while debugging DERBY-6774.
java.sql.SQLException
public void testAddIdentityColumn4() throws java.sql.SQLException
Another version of testAddIdenityColumn that provides slightly different code path, found useful while debugging DERBY-6774.
java.sql.SQLException
public void testAddIdentityColumn3() throws java.sql.SQLException
Another version of testAddIdenityColumn that provides slightly different code path, found useful while debugging DERBY-6774.
java.sql.SQLException
public void testAddIdentityColumn2() throws java.sql.SQLException
Another version of testAddIdenityColumn that provides slightly different code path, found useful while debugging DERBY-6774.
java.sql.SQLException
public void testDropObjects() throws java.lang.Exception
java.lang.Exception
public void testAddConstraint() throws java.lang.Exception
java.lang.Exception
public void testDropConstraint() throws java.lang.Exception
java.lang.Exception
public void testWithSchema() throws java.lang.Exception
java.lang.Exception
public void testTemporaryTable() throws java.lang.Exception
java.lang.Exception
public void testRenameAutoincrementColumn() throws java.lang.Exception
java.lang.Exception
private void vetSequenceState(java.lang.String tableName, java.lang.String columnDatatype, long currentValue, long startValue, long stepValue) throws java.lang.Exception
java.lang.Exception
private void checkValStartInc(java.sql.Statement st, java.lang.String nm, java.lang.String v, java.lang.String s, java.lang.String inc) throws java.lang.Exception
java.lang.Exception
private void testAlterColumnNullability(java.sql.Statement st, boolean standardSyntax) throws java.sql.SQLException
ALTER TABLE t ALTER COLUMN c [NOT] NULL
), and SQL standard
syntax (ALTER TABLE t ALTER COLUMN c SET NOT NULL
, and
ALTER TABLE t ALTER COLUMN c DROP NOT NULL
).st
- a statement to use for executing SQL statementsstandardSyntax
- if true, test the standard SQL syntax;
otherwise, test the legacy syntaxjava.sql.SQLException
- if a database error occurspublic void testAlterColumn() throws java.lang.Exception
java.lang.Exception
public void testAlterTableAndSysdepends() throws java.lang.Exception
java.lang.Exception
public void testTriggersAndSynonyms() throws java.lang.Exception
java.lang.Exception
public void testDropColumnTriggerDependency() throws java.lang.Exception
java.lang.Exception
public void testDropColumn() throws java.lang.Exception
java.lang.Exception
private void createTableAndInsertData(java.sql.Statement s, java.lang.String tableName, java.lang.String column1, java.lang.String column2) throws java.sql.SQLException
java.sql.SQLException
private int numberOfRowsInSysdepends(java.sql.Statement st) throws java.sql.SQLException
java.sql.SQLException
private void triggersExist(java.sql.Statement st, java.lang.String[][] expectedTriggers) throws java.sql.SQLException
java.sql.SQLException
public void testJira3175() throws java.lang.Exception
java.lang.Exception
public void testJira3177() throws java.lang.Exception
java.lang.Exception
public void testJira2371() throws java.lang.Exception
java.lang.Exception
public void testJira3355() throws java.lang.Exception
java.lang.Exception
public void testJira4256() throws java.sql.SQLException
java.sql.SQLException
public void testDerby5157_addColumnWithDefaultValue() throws java.sql.SQLException
java.sql.SQLException
public void testDerby5157_changeIncrement() throws java.sql.SQLException
java.sql.SQLException
public void test_5679() throws java.lang.Exception
java.lang.Exception
public void test_5679_manyColumns() throws java.lang.Exception
java.lang.Exception
public void test_5679_longRows() throws java.lang.Exception
java.lang.Exception
private byte[] makeBytes(int seed, int length)
private void vetBytes_5679(java.sql.Connection conn, byte[][] expected) throws java.lang.Exception
java.lang.Exception
private void assertBytes(byte[] expected, byte[] actual) throws java.lang.Exception
java.lang.Exception
public void test_6882() throws java.lang.Exception
java.lang.Exception
public void test_6882_import() throws java.lang.Exception
java.lang.Exception
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.