Package io.debezium.connector.mysql
Class MySqlAntlrDdlParserTest
java.lang.Object
io.debezium.connector.mysql.MySqlAntlrDdlParserTest
- Author:
- Roman Kuchár <kucharrom@gmail.com>.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate io.debezium.connector.mysql.MySqlValueConvertersprivate SimpleDdlParserListenerprivate DdlParserprivate Propertiesprivate Tablesprivate TableSchemaBuilder -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidassertColumn(Table table, String name, String typeName, int jdbcType, int length, int scale, boolean optional, boolean generated, boolean autoIncremented) private voidassertColumn(Table table, String name, String typeName, int jdbcType, int length, int scale, boolean optional, boolean generated, boolean autoIncremented, boolean hasDefaultValue, Object defaultValue) private voidassertColumn(Table table, String name, String typeName, int jdbcType, int length, String charsetName, boolean optional) private voidassertGlobalVariable(String name, String expectedValue) private voidassertLocalVariable(String name, String expectedValue) private voidassertParseEnumAndSetOptions(String typeExpression, String... expectedValues) Assert whether the providedtypeExpressionstring after being parsed results in a list ofENUMorSEToptions that match exactly to the provided list ofexpecetedValues.private voidassertSessionVariable(String name, String expectedValue) private voidassertVariable(SystemVariables.Scope scope, String name, String expectedValue) private voidassertVariable(String name, String expectedValue) voidprivate org.apache.kafka.connect.data.SchemagetColumnSchema(Table table, String column) voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidprivate voidprivate Stringprivate StringReads the lines starting with a given line number from the specified file on the classpath.voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidprivate StringtoIsoString(String timestamp)
-
Field Details
-
parser
-
tables
-
listener
-
converters
private io.debezium.connector.mysql.MySqlValueConverters converters -
tableSchemaBuilder
-
properties
-
-
Constructor Details
-
MySqlAntlrDdlParserTest
public MySqlAntlrDdlParserTest()
-
-
Method Details
-
beforeEach
public void beforeEach() -
shouldApplyCorrectColumnInfoWhenAlterColumnType
-
shouldProcessCreateUniqueBeforePrimaryKeyDefinitions
-
shouldProcessAlterAddDefinitions
-
shouldProcessNoPrimaryKeyForTable
-
shouldProcessLargeColumn
-
shouldProcessMultipleSignedUnsignedForTable
-
shouldProcessDefaultCharsetForTable
-
shouldProcessCommentForTable
-
shouldAllowAggregateWindowedFunction
-
shouldAllowIndexExpressionForTable
-
shouldProcessQueryWithoutFromStatement
-
shouldProcessQueryWithIndexHintPrimary
public void shouldProcessQueryWithIndexHintPrimary() -
shouldProcessExpressionWithDefault
-
shouldAllowCharacterVarying
-
shouldAllowNonAsciiIdentifiers
-
shouldProcessDimensionalBlob
-
shouldUseDatabaseCharacterSet
-
shouldUseCharacterSetFromCollation
-
shouldParseCharacterDatatype
-
shouldParseOtherDbDatatypes
-
shouldUpdateSchemaForRemovedDefaultValue
-
shouldUpdateSchemaForChangedDefaultValue
-
shouldNotUpdateExistingTable
-
shouldHandleQuotes
-
shouldUpdateAndRenameTable
-
shouldDropPrimaryKeyColumn
-
shouldSupportBinaryCharset
-
shouldSupportCreateIndexBothAlgoAndLock
-
shouldProcessMariadbCreateIndex
-
shouldSupportCreateTableWithEcrytion
-
shouldSupportCreateTableWithCompressed
-
shouldSupportUtfMb3Charset
-
shouldParseInternalColumnId
-
shouldNotGetExceptionOnParseAlterStatementsWithoutCreate
public void shouldNotGetExceptionOnParseAlterStatementsWithoutCreate() -
shouldSupportInstantAlgoOnAlterStatements
-
shouldParseFloatVariants
-
shouldParseDecimalVariants
-
shouldProcessSerialDatatype
-
shouldProcessSerialDefaultValue
-
shouldParseGeneratedColumn
-
shouldParseAlterTableMultiTableOptions
-
shouldParseCheckTableKeywords
-
shouldParseCheckTableSomeOtherKeyword
-
shouldParseTimeWithNowDefault
-
shouldParseCreateStatements
public void shouldParseCreateStatements() -
shouldParseTestStatements
public void shouldParseTestStatements() -
shouldParseSomeLinesFromCreateStatements
public void shouldParseSomeLinesFromCreateStatements() -
shouldParseMySql56InitializationStatements
public void shouldParseMySql56InitializationStatements() -
shouldParseMySql57InitializationStatements
public void shouldParseMySql57InitializationStatements() -
shouldParseButSkipAlterTableWhenTableIsNotKnown
-
shouldParseTruncateStatementsAfterCreate
public void shouldParseTruncateStatementsAfterCreate() -
shouldParseCreateViewStatementStartSelect
public void shouldParseCreateViewStatementStartSelect() -
shouldParseDropView
public void shouldParseDropView() -
shouldParseAlterTableRename
-
shouldParseCreateViewStatementColumnAlias
public void shouldParseCreateViewStatementColumnAlias() -
shouldParseCreateViewStatementColumnAliasInnerSelect
public void shouldParseCreateViewStatementColumnAliasInnerSelect() -
shouldParseAlterViewStatementColumnAliasInnerSelect
public void shouldParseAlterViewStatementColumnAliasInnerSelect() -
shouldUseFiltersForAlterTable
public void shouldUseFiltersForAlterTable() -
shouldParseFunctionNamedDatabase
-
shouldParseConstraintCheck
-
shouldParseCommentWithEngineName
-
shouldRenameColumnWithoutDefinition
-
parseAddPartition
-
parseGeomCollection
-
parseAlterEnumColumnWithNewCharacterSet
-
parseAlterEnumColumnWithEmbeddedOrEscapedCharacters
-
shouldParseEnumOptions
-
shouldParseEscapedEnumOptions
-
shouldParseSetOptions
-
shouldParseMultipleStatements
public void shouldParseMultipleStatements() -
shouldParseAlterStatementsAfterCreate
public void shouldParseAlterStatementsAfterCreate() -
shouldParseCreateTableStatementWithSingleGeneratedAndPrimaryKeyColumn
public void shouldParseCreateTableStatementWithSingleGeneratedAndPrimaryKeyColumn() -
shouldParseCreateTableStatementWithSingleGeneratedColumnAsPrimaryKey
public void shouldParseCreateTableStatementWithSingleGeneratedColumnAsPrimaryKey() -
shouldParseCreateTableStatementWithMultipleColumnsForPrimaryKey
public void shouldParseCreateTableStatementWithMultipleColumnsForPrimaryKey() -
shouldParseCreateTableStatementWithCollate
-
shouldParseThirdPartyStorageEngine
-
shouldParseEngineNameWithApostrophes
-
shouldParseNonBinaryStringWithBinaryCollationAsString
-
shouldParseCreateUserTable
public void shouldParseCreateUserTable() -
shouldParseCreateTableStatementWithSignedTypes
public void shouldParseCreateTableStatementWithSignedTypes() -
shouldParseCreateTableStatementWithCharacterSetForTable
public void shouldParseCreateTableStatementWithCharacterSetForTable() -
shouldParseCreateTableStatementWithCharacterSetForColumns
public void shouldParseCreateTableStatementWithCharacterSetForColumns() -
shouldParseAlterTableStatementThatAddsCharacterSetForColumns
public void shouldParseAlterTableStatementThatAddsCharacterSetForColumns() -
shouldParseCreateDatabaseAndTableThatUsesDefaultCharacterSets
public void shouldParseCreateDatabaseAndTableThatUsesDefaultCharacterSets() -
shouldParseCreateDatabaseAndUseDatabaseStatementsAndHaveCharacterEncodingVariablesUpdated
public void shouldParseCreateDatabaseAndUseDatabaseStatementsAndHaveCharacterEncodingVariablesUpdated() -
shouldParseSetCharacterSetStatement
public void shouldParseSetCharacterSetStatement() -
shouldParseSetNamesStatement
public void shouldParseSetNamesStatement() -
shouldParseAlterTableStatementAddColumns
public void shouldParseAlterTableStatementAddColumns() -
shouldParseAlterTableStatementAddConstraintUniqueKey
-
shouldParseCreateTableWithEnumAndSetColumns
public void shouldParseCreateTableWithEnumAndSetColumns() -
shouldParseDefiner
public void shouldParseDefiner() -
shouldParseCreateAndAlterWithOnUpdate
-
shouldParseCreateAndRemoveTwiceOrDoesNotExist
-
shouldParseGrantStatement
-
shouldParseGrantStatementWithoutSpecifiedHostName
-
shouldParseSetOfOneVariableStatementWithoutTerminator
public void shouldParseSetOfOneVariableStatementWithoutTerminator() -
shouldParseSetOfOneVariableStatementWithTerminator
public void shouldParseSetOfOneVariableStatementWithTerminator() -
shouldParseSetOfSameVariableWithDifferentScope
public void shouldParseSetOfSameVariableWithDifferentScope() -
shouldParseSetOfMultipleVariablesWithInferredScope
public void shouldParseSetOfMultipleVariablesWithInferredScope() -
shouldParseSetOfGlobalVariable
public void shouldParseSetOfGlobalVariable() -
shouldParseSetOfLocalVariable
public void shouldParseSetOfLocalVariable() -
shouldParseSetOfSessionVariable
public void shouldParseSetOfSessionVariable() -
shouldParseButNotSetUserVariableWithUnderscoreDelimiter
public void shouldParseButNotSetUserVariableWithUnderscoreDelimiter() -
shouldParseVariableWithUnderscoreDelimiter
public void shouldParseVariableWithUnderscoreDelimiter() -
shouldParseAndIgnoreDeleteStatements
public void shouldParseAndIgnoreDeleteStatements() -
shouldParseAndIgnoreInsertStatements
public void shouldParseAndIgnoreInsertStatements() -
shouldParseStatementsWithQuotedIdentifiers
public void shouldParseStatementsWithQuotedIdentifiers() -
shouldParseIntegrationTestSchema
public void shouldParseIntegrationTestSchema() -
shouldParseStatementForDbz106
public void shouldParseStatementForDbz106() -
shouldParseStatementForDbz123
public void shouldParseStatementForDbz123() -
shouldParseAndIgnoreCreateFunction
-
shouldParseScientificNotationNumber
-
shouldParseAlterTableWithNewlineFeeds
-
shouldParseButIgnoreCreateTriggerWithDefiner
-
shouldParseFulltextKeyInCreateTable
-
shouldParseProcedureWithCase
-
shouldParseProcedureEmbeddedIfs
-
shouldParseProcedureIfWithParenthesisStart
-
shouldParseButIgnoreCreateFunctionWithDefiner
-
shouldParseButIgnoreCreateFunctionC
-
shouldParseButIgnoreCreateFunctionD
-
shouldParseButIgnoreCreateFunctionE
-
shouldParseButIgnoreCreateFunctionF
-
shouldParseButIgnoreCreateFunctionG
-
shouldParseButIgnoreCreateFunctionH
-
shouldParseAlterTableWithDropIndex
-
shouldParseAlterTableWithIndex
-
shouldParseIndex
-
shouldParseStringSameAsKeyword
-
shouldParseStatementForDbz200
-
shouldParseAlterTableThatChangesMultipleColumns
-
shouldParseTicketMonsterLiquibaseStatements
public void shouldParseTicketMonsterLiquibaseStatements() -
shouldParseCreateTableWithEnumDefault
-
shouldParseCreateTableWithBitDefault
-
shouldParseTableMaintenanceStatements
-
shouldParseCreateTableUnionStatement
public void shouldParseCreateTableUnionStatement() -
shouldParseAlterTableUnionStatement
-
shouldParseCreateTableWithUnnamedPrimaryKeyConstraint
-
shouldParseStatementForDbz142
public void shouldParseStatementForDbz142() -
shouldParseCreateTableStatementWithColumnNamedColumn
-
shouldParseCreateTableWithTextType
-
shouldParseCreateTableWithDoublePrecisionKeyword
-
shouldParseAlterTableStatementWithColumnNamedColumnWithoutColumnWord
@FixFor({"DBZ-408","DBZ-412"}) public void shouldParseAlterTableStatementWithColumnNamedColumnWithoutColumnWord() -
shouldParseAlterTableStatementWithColumnNamedColumnWithColumnWord
@FixFor({"DBZ-408","DBZ-412","DBZ-524"}) public void shouldParseAlterTableStatementWithColumnNamedColumnWithColumnWord() -
shouldParseAlterTableAlterDefaultColumnValue
-
parseDdlForDecAndFixed
public void parseDdlForDecAndFixed() -
parseDdlForUnscaledDecAndFixed
-
parseTableWithPageChecksum
public void parseTableWithPageChecksum() -
parseTableWithNegativeDefault
-
parseUserDdlStatements
-
parseCreateUserDdlStatement
-
parsePartitionReorganize
-
parsePartitionWithEngine
-
parseAddMultiplePartitions
-
shouldParseChangeColumnAndKeepName
-
parseDefaultValue
public void parseDefaultValue() -
parseDefaultValueWhichNeedTrim
-
shouldTreatPrimaryKeyColumnsImplicitlyAsNonNull
-
shouldNotNullPositionBeforeOrAfterDefaultValue
-
shouldParseTimestampDefaultValue
-
shouldSupportMariaDbCurrentTimestamp
-
shouldSupportNationalChar
-
shouldParseCreateTableWithBitDefaultLength
-
toIsoString
-
assertParseEnumAndSetOptions
Assert whether the providedtypeExpressionstring after being parsed results in a list ofENUMorSEToptions that match exactly to the provided list ofexpecetedValues. In this particular implementation, we construct aCREATEstatement and invoke the antlr parser on the statement defining a column namedoptionsthat represents the suppliedENUMorSETexpression.- Parameters:
typeExpression- TheENUMorSETexpression to be parsedexpectedValues- An array of options expected to have been parsed from the expression.
-
assertVariable
-
assertVariable
-
assertGlobalVariable
-
assertSessionVariable
-
assertLocalVariable
-
printEvent
-
readFile
-
readLines
Reads the lines starting with a given line number from the specified file on the classpath. Any lines preceding the given line number will be included as empty lines, meaning the line numbers will match the input file.- Parameters:
startingLineNumber- the 1-based number designating the first line to be includedclasspathResource- the path to the file on the classpath- Returns:
- the string containing the subset of the file contents; never null but possibly empty
-
assertColumn
-
assertColumn
-
assertColumn
-
getColumnSchema
-