public class StatementsTest extends BaseTestCase
| Modifier and Type | Class and Description |
|---|---|
static class |
StatementsTest.QueryInfoQueryInterceptor |
BaseTestCase.MockConnectionConfiguration| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
testDateString |
private java.lang.String |
testDateTimeString |
private java.lang.String |
testISODateTimeString |
private java.time.LocalDate |
testLocalDate |
private java.time.LocalDateTime |
testLocalDateTime |
private java.time.LocalTime |
testLocalTime |
private java.time.OffsetDateTime |
testOffsetDateTime |
private java.time.OffsetTime |
testOffsetTime |
private java.sql.Date |
testSqlDate |
private java.sql.Time |
testSqlTime |
private java.sql.Timestamp |
testSqlTimeStamp |
private java.lang.String |
testTimeString |
private java.time.ZonedDateTime |
testZonedDateTime |
conn, dbClass, dbName, dbUrl, isOpenSSL, mainConnectionUrl, pstmt, rs, serverVersion, stmt, timeZoneFreeDbUrl| Constructor and Description |
|---|
StatementsTest() |
| Modifier and Type | Method and Description |
|---|---|
private void |
checkUnsupportedTypesBehavior(java.sql.PreparedStatement prepStmt)
Helper method for *SetObject* tests.
|
private int |
insertTestDataLocalDTTypes(java.sql.PreparedStatement prepStmt)
Helper method for *SetObject* tests.
|
private int |
insertTestDataOffsetDTTypes(java.sql.PreparedStatement prepStmt)
Helper method for *SetObject* tests.
|
void |
testAccessorsAndMutators() |
void |
testAutoIncrement() |
void |
testBatchRewriteErrors() |
void |
testBinaryResultSetNumericTypes()
Tests all variants of numerical types (signed/unsigned) for correct operation when used as return values from a prepared statement.
|
private void |
testBinaryResultSetNumericTypesInternal(java.sql.Connection con) |
void |
testCallableStatement()
Tests stored procedure functionality
|
void |
testCallStmtExecuteLargeBatch()
Test for CallableStatement.executeLargeBatch().
|
void |
testCallStmtExecuteLargeUpdate()
Test for CallableStatement.executeLargeUpdate().
|
void |
testCallStmtRegisterOutParameter()
Test for CallableStatement.registerOutParameter().
|
void |
testCallStmtRegisterOutParameterNewUnsupportedTypes()
Test for CallableStatement.registerOutParameter(), unsupported SQL types TIME_WITH_TIMEZONE, TIMESTAMP_WITH_TIMEZONE and REF_CURSOR.
|
void |
testCallStmtRegisterOutParameterWithMysqlType()
Test for CallableStatement.registerOutParameter(...MysqlType...).
|
void |
testCallStmtSetObjectAndNewSupportedTypes()
Test for CallableStatement.setObject().
|
void |
testCallStmtSetObjectAndNewUnsupportedTypes()
Test for CallableStatement.setObject(), unsupported SQL types TIME_WITH_TIMEZONE, TIMESTAMP_WITH_TIMEZONE and REF_CURSOR.
|
void |
testCancelStatement() |
void |
testClose() |
void |
testEnableStreamingResults() |
void |
testGetNCharacterStream()
Tests for ResultSet.getNCharacterStream()
|
void |
testGetNClob()
Tests for ResultSet.getNClob()
|
void |
testGetNString()
Tests for ResultSet.getNString()
|
void |
testHoldingResultSetsOverClose() |
void |
testInsert() |
void |
testJdbc4LoadBalancing() |
void |
testLocalInfileHooked() |
void |
testMultiStatements()
Tests multiple statement support
|
void |
testNulls()
Tests that NULLs and '' work correctly.
|
void |
testParameterBindings() |
void |
testParsedConversionWarning() |
void |
testPreparedStatement() |
void |
testPreparedStatementBatch() |
void |
testPrepStmtExecuteLargeBatch()
Test for PreparedStatement.executeLargeBatch().
|
void |
testPrepStmtExecuteLargeUpdateExplicitGeneratedKeys()
Test for PreparedStatement.executeLargeUpdate().
|
void |
testPrepStmtExecuteLargeUpdateNoGeneratedKeys()
Test for PreparedStatement.executeLargeUpdate().
|
void |
testPrepStmtSetObjectAndNewSupportedTypes()
Test for PreparedStatement.setObject().
|
void |
testPrepStmtSetObjectAndNewUnsupportedTypes()
Test for PreparedStatement.setObject(), unsupported SQL types TIME_WITH_TIMEZONE, TIMESTAMP_WITH_TIMEZONE and REF_CURSOR.
|
void |
testQueryInfoParsingAndRewrittingInsertSetEroteme() |
void |
testQueryInfoParsingAndRewrittingInsertValuesEroteme() |
void |
testQueryInfoParsingAndRewrittingInsertValuesRowEroteme() |
void |
testQueryInfoParsingAndRewrittingInsertValuesStatic() |
void |
testQueryInfoParsingAndRewrittingLoadData() |
void |
testQueryInfoParsingAndRewrittingReplaceSetEroteme() |
void |
testQueryInfoParsingAndRewrittingReplaceValuesRowEroteme() |
void |
testQueryInfoParsingAndRewrittingReplaceVauesEroteme() |
void |
testQueryInfoParsingAndRewrittingSpecialCases() |
void |
testQueryInterceptors() |
void |
testReadOnlySafeStatements() |
void |
testResultSetProducingQueries() |
void |
testRowFetch() |
void |
testSelectColumns() |
void |
testServerPreparedStatementsCaching()
WL#11101 - Remove de-cache and close of SSPSs on double call to close()
|
void |
testServerPrepStmtExecuteLargeBatch()
Test for (Server)PreparedStatement.executeLargeBatch().
|
void |
testServPrepStmtSetObjectAndNewSupportedTypes()
Test for (Server)PreparedStatement.setObject().
|
void |
testServPrepStmtSetObjectAndNewUnsupportedTypes()
Test for (Server)PreparedStatement.setObject(), unsupported SQL types TIME_WITH_TIMEZONE, TIMESTAMP_WITH_TIMEZONE and REF_CURSOR.
|
void |
testSetNCharacterStream()
Tests for PreparedStatement.setNCharacterSteam()
|
void |
testSetNCharacterStreamServer()
Tests for ServerPreparedStatement.setNCharacterSteam()
|
void |
testSetNClob()
Tests for PreparedStatement.setNClob()
|
void |
testSetNClobServer()
Tests for ServerPreparedStatement.setNClob()
|
void |
testSetNString()
Tests for PreparedStatement.setNString()
|
void |
testSetNStringServer()
Tests for ServerPreparedStatement.setNString()
|
void |
testSetObject()
Tests for PreparedStatement.setObject()
|
void |
testSetObjectWithMysqlType()
Tests for PreparedStatement.setObject(...SQLType...)
|
void |
testSharedTestData()
Test shared test data validity.
|
void |
testStatementRewriteBatch() |
void |
testStmtExecuteLargeBatch()
Test for Statement.executeLargeBatch().
|
void |
testStmtExecuteLargeUpdate()
Test for Statement.executeLargeUpdate(String, _).
|
void |
testStmtExecuteLargeUpdateNoGeneratedKeys()
Test for Statement.executeLargeUpdate(String).
|
void |
testStmtGetSetLargeMaxRows()
Test for Statement.[get/set]LargeMaxRows().
|
void |
testStreamChange() |
void |
testStubbed() |
void |
testTruncationOnRead() |
void |
testUpdateNCharacterStream()
Tests for ResultSet.updateNCharacterStream()
|
void |
testUpdateNClob()
Tests for ResultSet.updateNClob()
|
void |
testUpdateNString()
Tests for ResultSet.updateNString()
|
private void |
validateTestDataLocalDTTypes(java.lang.String tableName,
int expectedRowCount)
Helper method for *SetObject* tests.
|
private void |
validateTestDataOffsetDTTypes(java.lang.String tableName,
int expectedRowCount)
Helper method for *SetObject* tests.
|
appendRequiredProperties, assertByteArrayEquals, assertConnectionsHistory, assertEqualsFSAware, assertNonSecureConnection, assertResultSetLength, assertResultSetsEqual, assertSecureConnection, assertSecureConnection, assertSessionStatusEquals, assertThrows, assertThrows, assertThrows, assertThrows, cleanupTempFiles, createDatabase, createDatabase, createFunction, createFunction, createProcedure, createProcedure, createSchemaObject, createSchemaObject, createTable, createTable, createTable, createTable, createUser, createUser, createView, createView, currentTimeMillis, dropDatabase, dropDatabase, dropFunction, dropFunction, dropProcedure, dropProcedure, dropSchemaObject, dropSchemaObject, dropTable, dropTable, dropUser, dropUser, dropView, dropView, fillPrimitiveDefaults, getConnectionWithProps, getConnectionWithProps, getConnectionWithProps, getConnectionWithProps, getEncodedHostFromTestsuiteUrl, getEncodedHostPortPairFromTestsuiteUrl, getFailoverConnection, getFailoverConnection, getHostFreePropertiesFromTestsuiteUrl, getHostFreePropertiesFromTestsuiteUrl, getHostFromTestsuiteUrl, getInstanceNumber, getLoadBalancedConnection, getLoadBalancedConnection, getLoadBalancedConnection, getMysqlVariable, getMysqlVariable, getNewConnection, getNoDbUrl, getPort, getPortFreeHostname, getPortFromTestsuiteUrl, getPropertiesFromTestsuiteUrl, getPropertiesFromUrl, getRowCount, getSingleIndexedValueWithQuery, getSingleIndexedValueWithQuery, getSingleValue, getSingleValueWithQuery, getSourceReplicaReplicationConnection, getSourceReplicaReplicationConnection, getSourceReplicaUrl, getSourceReplicaUrl, getUnreliableFailoverConnection, getUnreliableFailoverConnection, getUnreliableLoadBalancedConnection, getUnreliableLoadBalancedConnection, getUnreliableMultiHostConnection, getUnreliableReplicationConnection, getUnreliableReplicationConnection, getUnreliableReplicationConnection, isClassAvailable, isCommunityEdition, isEnterpriseEdition, isMysqlRunningLocally, isRunningOnJRockit, isServerRunningOnWindows, isSysPropDefined, logDebug, newTempBinaryFile, randomString, removeHostRelatedProps, removeSqlMode, runLongTests, setUpBase, supportsLoadLocalInfile, supportsTestCachingSha2PasswordKeys, supportsTestCertificates, supportsTestSha256PasswordKeys, supportsTimeZoneNames, supportsTLSv1_2, tearDownBase, versionMeetsMinimum, versionMeetsMinimumprivate final java.lang.String testDateString
private final java.lang.String testTimeString
private final java.lang.String testDateTimeString
private final java.lang.String testISODateTimeString
private final java.sql.Date testSqlDate
private final java.sql.Time testSqlTime
private final java.sql.Timestamp testSqlTimeStamp
private final java.time.LocalDate testLocalDate
private final java.time.LocalTime testLocalTime
private final java.time.LocalDateTime testLocalDateTime
private final java.time.OffsetDateTime testOffsetDateTime
private final java.time.OffsetTime testOffsetTime
private final java.time.ZonedDateTime testZonedDateTime
@Test
public void testAccessorsAndMutators()
throws java.sql.SQLException
java.sql.SQLException@Test
public void testAutoIncrement()
throws java.sql.SQLException
java.sql.SQLException@Test
public void testBinaryResultSetNumericTypes()
throws java.lang.Exception
java.lang.Exception@Test
private void testBinaryResultSetNumericTypesInternal(java.sql.Connection con)
throws java.lang.Exception
java.lang.Exception@Test
public void testCallableStatement()
throws java.lang.Exception
java.lang.Exception@Test
public void testCancelStatement()
throws java.lang.Exception
java.lang.Exception@Test
public void testClose()
throws java.sql.SQLException
java.sql.SQLException@Test
public void testEnableStreamingResults()
throws java.lang.Exception
java.lang.Exception@Test
public void testHoldingResultSetsOverClose()
throws java.lang.Exception
java.lang.Exception@Test
public void testInsert()
throws java.sql.SQLException
java.sql.SQLException@Test
public void testMultiStatements()
throws java.lang.Exception
java.lang.Exception@Test
public void testNulls()
throws java.sql.SQLException
java.sql.SQLException@Test
public void testParsedConversionWarning()
throws java.lang.Exception
java.lang.Exception@Test
public void testPreparedStatement()
throws java.sql.SQLException
java.sql.SQLException@Test
public void testPreparedStatementBatch()
throws java.sql.SQLException
java.sql.SQLException@Test
public void testRowFetch()
throws java.lang.Exception
java.lang.Exception@Test
public void testSelectColumns()
throws java.sql.SQLException
java.sql.SQLException@Test
public void testSetObject()
throws java.lang.Exception
java.lang.Exception@Test
public void testSetObjectWithMysqlType()
throws java.lang.Exception
java.lang.Exception@Test
public void testStatementRewriteBatch()
throws java.lang.Exception
java.lang.Exception@Test
public void testBatchRewriteErrors()
throws java.lang.Exception
java.lang.Exception@Test
public void testStreamChange()
throws java.lang.Exception
java.lang.Exception@Test
public void testStubbed()
throws java.sql.SQLException
java.sql.SQLException@Test
public void testTruncationOnRead()
throws java.lang.Exception
java.lang.Exception@Test
public void testQueryInterceptors()
throws java.lang.Exception
java.lang.Exception@Test
public void testParameterBindings()
throws java.lang.Exception
java.lang.Exception@Test
public void testLocalInfileHooked()
throws java.lang.Exception
java.lang.Exception@Test
public void testGetNCharacterStream()
throws java.lang.Exception
java.lang.Exception@Test
public void testGetNClob()
throws java.lang.Exception
java.lang.Exception@Test
public void testGetNString()
throws java.lang.Exception
java.lang.Exception@Test
public void testSetNCharacterStream()
throws java.lang.Exception
java.lang.Exception@Test
public void testSetNCharacterStreamServer()
throws java.lang.Exception
java.lang.Exception@Test
public void testSetNClob()
throws java.lang.Exception
java.lang.Exception@Test
public void testSetNClobServer()
throws java.lang.Exception
java.lang.Exception@Test
public void testSetNString()
throws java.lang.Exception
java.lang.Exception@Test
public void testSetNStringServer()
throws java.lang.Exception
java.lang.Exception@Test
public void testUpdateNCharacterStream()
throws java.lang.Exception
java.lang.Exception@Test
public void testUpdateNClob()
throws java.lang.Exception
java.lang.Exception@Test
public void testUpdateNString()
throws java.lang.Exception
java.lang.Exception@Test
public void testJdbc4LoadBalancing()
throws java.lang.Exception
java.lang.Exception@Test
public void testSharedTestData()
throws java.lang.Exception
java.lang.Exception@Test
public void testStmtExecuteLargeBatch()
throws java.lang.Exception
java.lang.Exception@Test
public void testStmtExecuteLargeUpdateNoGeneratedKeys()
throws java.lang.Exception
java.lang.Exception@Test
public void testStmtExecuteLargeUpdate()
throws java.lang.Exception
java.lang.Exception@Test
public void testPrepStmtExecuteLargeBatch()
throws java.lang.Exception
java.lang.Exception@Test
public void testPrepStmtExecuteLargeUpdateNoGeneratedKeys()
throws java.lang.Exception
java.lang.Exception@Test
public void testPrepStmtExecuteLargeUpdateExplicitGeneratedKeys()
throws java.lang.Exception
java.lang.Exception@Test
public void testCallStmtExecuteLargeBatch()
throws java.lang.Exception
java.lang.Exception@Test
public void testCallStmtExecuteLargeUpdate()
throws java.lang.Exception
java.lang.Exception@Test
public void testServerPrepStmtExecuteLargeBatch()
throws java.lang.Exception
java.lang.Exception@Test
public void testStmtGetSetLargeMaxRows()
throws java.lang.Exception
java.lang.Exception@Test
public void testPrepStmtSetObjectAndNewSupportedTypes()
throws java.lang.Exception
java.lang.Exception@Test
public void testPrepStmtSetObjectAndNewUnsupportedTypes()
throws java.lang.Exception
java.lang.Exception@Test
public void testCallStmtSetObjectAndNewSupportedTypes()
throws java.lang.Exception
java.lang.Exception@Test
public void testCallStmtSetObjectAndNewUnsupportedTypes()
throws java.lang.Exception
java.lang.Exception@Test
public void testServPrepStmtSetObjectAndNewSupportedTypes()
throws java.lang.Exception
java.lang.Exception@Test
public void testServPrepStmtSetObjectAndNewUnsupportedTypes()
throws java.lang.Exception
java.lang.Exceptionprivate int insertTestDataLocalDTTypes(java.sql.PreparedStatement prepStmt)
throws java.lang.Exception
prepStmt - java.lang.Exceptionprivate void validateTestDataLocalDTTypes(java.lang.String tableName,
int expectedRowCount)
throws java.lang.Exception
tableName - expectedRowCount - java.lang.Exceptionprivate int insertTestDataOffsetDTTypes(java.sql.PreparedStatement prepStmt)
throws java.lang.Exception
prepStmt - java.lang.Exceptionprivate void validateTestDataOffsetDTTypes(java.lang.String tableName,
int expectedRowCount)
throws java.lang.Exception
tableName - expectedRowCount - java.lang.Exceptionprivate void checkUnsupportedTypesBehavior(java.sql.PreparedStatement prepStmt)
prepStmt - @Test
public void testCallStmtRegisterOutParameter()
throws java.lang.Exception
java.lang.Exception@Test
public void testCallStmtRegisterOutParameterWithMysqlType()
throws java.lang.Exception
java.lang.Exception@Test
public void testCallStmtRegisterOutParameterNewUnsupportedTypes()
throws java.lang.Exception
java.lang.Exception@Test
public void testServerPreparedStatementsCaching()
throws java.lang.Exception
java.lang.Exception@Test
public void testResultSetProducingQueries()
throws java.lang.Exception
java.lang.Exception@Test
public void testReadOnlySafeStatements()
throws java.lang.Exception
java.lang.Exception@Test
public void testQueryInfoParsingAndRewrittingLoadData()
throws java.lang.Exception
java.lang.Exception@Test
public void testQueryInfoParsingAndRewrittingInsertValuesStatic()
throws java.lang.Exception
java.lang.Exception@Test
public void testQueryInfoParsingAndRewrittingInsertValuesEroteme()
throws java.lang.Exception
java.lang.Exception@Test
public void testQueryInfoParsingAndRewrittingInsertValuesRowEroteme()
throws java.lang.Exception
java.lang.Exception@Test
public void testQueryInfoParsingAndRewrittingInsertSetEroteme()
throws java.lang.Exception
java.lang.Exception@Test
public void testQueryInfoParsingAndRewrittingReplaceVauesEroteme()
throws java.lang.Exception
java.lang.Exception@Test
public void testQueryInfoParsingAndRewrittingReplaceValuesRowEroteme()
throws java.lang.Exception
java.lang.Exception@Test
public void testQueryInfoParsingAndRewrittingReplaceSetEroteme()
throws java.lang.Exception
java.lang.Exception@Test
public void testQueryInfoParsingAndRewrittingSpecialCases()
throws java.lang.Exception
java.lang.Exception