Class MySQLParser

  • Direct Known Subclasses:
    MariaDBParser

    public class MySQLParser
    extends org.flywaydb.core.internal.parser.Parser
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.flywaydb.core.internal.parser.Parser

        org.flywaydb.core.internal.parser.Parser.ParserSqlStatementIterator
    • Field Summary

      • Fields inherited from class org.flywaydb.core.internal.parser.Parser

        configuration, parsingContext
    • Constructor Summary

      Constructors 
      Constructor Description
      MySQLParser​(org.flywaydb.core.api.configuration.Configuration configuration, org.flywaydb.core.internal.parser.ParsingContext parsingContext)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void adjustBlockDepth​(org.flywaydb.core.internal.parser.ParserContext context, java.util.List<org.flywaydb.core.internal.parser.Token> tokens, org.flywaydb.core.internal.parser.Token keyword, org.flywaydb.core.internal.parser.PeekingReader reader)  
      protected org.flywaydb.core.internal.parser.StatementType detectStatementType​(java.lang.String simplifiedStatement, org.flywaydb.core.internal.parser.ParserContext context, org.flywaydb.core.internal.parser.PeekingReader reader)  
      protected char getAlternativeStringLiteralQuote()  
      protected char getIdentifierQuote()  
      protected org.flywaydb.core.internal.parser.Token handleAlternativeStringLiteral​(org.flywaydb.core.internal.parser.PeekingReader reader, org.flywaydb.core.internal.parser.ParserContext context, int pos, int line, int col)  
      protected org.flywaydb.core.internal.parser.Token handleCommentDirective​(org.flywaydb.core.internal.parser.PeekingReader reader, org.flywaydb.core.internal.parser.ParserContext context, int pos, int line, int col)  
      protected org.flywaydb.core.internal.parser.Token handleKeyword​(org.flywaydb.core.internal.parser.PeekingReader reader, org.flywaydb.core.internal.parser.ParserContext context, int pos, int line, int col, java.lang.String keyword)  
      protected org.flywaydb.core.internal.parser.Token handleStringLiteral​(org.flywaydb.core.internal.parser.PeekingReader reader, org.flywaydb.core.internal.parser.ParserContext context, int pos, int line, int col)  
      protected boolean isCommentDirective​(java.lang.String text)  
      protected boolean isSingleLineComment​(java.lang.String peek, org.flywaydb.core.internal.parser.ParserContext context, int col)  
      protected void resetDelimiter​(org.flywaydb.core.internal.parser.ParserContext context)  
      protected boolean shouldAdjustBlockDepth​(org.flywaydb.core.internal.parser.ParserContext context, java.util.List<org.flywaydb.core.internal.parser.Token> tokens, org.flywaydb.core.internal.parser.Token token)  
      • Methods inherited from class org.flywaydb.core.internal.parser.Parser

        adjustDelimiter, createStatement, detectCanExecuteInTransaction, doTokensMatchPattern, getAlternativeIdentifierQuote, getClosingIdentifierSymbol, getDefaultDelimiter, getLastKeywordIndex, getLastKeywordIndex, getNextStatement, getOpeningIdentifierSymbol, getPreviousToken, getTransactionalDetectionCutoff, getValidKeywords, handleDelimiter, isAlternativeStringLiteral, isDelimiter, isKeyword, isLetter, lastTokenIs, lastTokenIsOnLine, parse, parse, readIdentifier, readKeyword, replacePlaceholders, shouldDiscard, supportsPeekingMultipleLines, supportsReferencedSqlScripts, tokenAtIndexIs
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MySQLParser

        public MySQLParser​(org.flywaydb.core.api.configuration.Configuration configuration,
                           org.flywaydb.core.internal.parser.ParsingContext parsingContext)
    • Method Detail

      • resetDelimiter

        protected void resetDelimiter​(org.flywaydb.core.internal.parser.ParserContext context)
        Overrides:
        resetDelimiter in class org.flywaydb.core.internal.parser.Parser
      • handleKeyword

        protected org.flywaydb.core.internal.parser.Token handleKeyword​(org.flywaydb.core.internal.parser.PeekingReader reader,
                                                                        org.flywaydb.core.internal.parser.ParserContext context,
                                                                        int pos,
                                                                        int line,
                                                                        int col,
                                                                        java.lang.String keyword)
                                                                 throws java.io.IOException
        Overrides:
        handleKeyword in class org.flywaydb.core.internal.parser.Parser
        Throws:
        java.io.IOException
      • getIdentifierQuote

        protected char getIdentifierQuote()
        Overrides:
        getIdentifierQuote in class org.flywaydb.core.internal.parser.Parser
      • getAlternativeStringLiteralQuote

        protected char getAlternativeStringLiteralQuote()
        Overrides:
        getAlternativeStringLiteralQuote in class org.flywaydb.core.internal.parser.Parser
      • isSingleLineComment

        protected boolean isSingleLineComment​(java.lang.String peek,
                                              org.flywaydb.core.internal.parser.ParserContext context,
                                              int col)
        Overrides:
        isSingleLineComment in class org.flywaydb.core.internal.parser.Parser
      • handleStringLiteral

        protected org.flywaydb.core.internal.parser.Token handleStringLiteral​(org.flywaydb.core.internal.parser.PeekingReader reader,
                                                                              org.flywaydb.core.internal.parser.ParserContext context,
                                                                              int pos,
                                                                              int line,
                                                                              int col)
                                                                       throws java.io.IOException
        Overrides:
        handleStringLiteral in class org.flywaydb.core.internal.parser.Parser
        Throws:
        java.io.IOException
      • handleAlternativeStringLiteral

        protected org.flywaydb.core.internal.parser.Token handleAlternativeStringLiteral​(org.flywaydb.core.internal.parser.PeekingReader reader,
                                                                                         org.flywaydb.core.internal.parser.ParserContext context,
                                                                                         int pos,
                                                                                         int line,
                                                                                         int col)
                                                                                  throws java.io.IOException
        Overrides:
        handleAlternativeStringLiteral in class org.flywaydb.core.internal.parser.Parser
        Throws:
        java.io.IOException
      • handleCommentDirective

        protected org.flywaydb.core.internal.parser.Token handleCommentDirective​(org.flywaydb.core.internal.parser.PeekingReader reader,
                                                                                 org.flywaydb.core.internal.parser.ParserContext context,
                                                                                 int pos,
                                                                                 int line,
                                                                                 int col)
                                                                          throws java.io.IOException
        Overrides:
        handleCommentDirective in class org.flywaydb.core.internal.parser.Parser
        Throws:
        java.io.IOException
      • isCommentDirective

        protected boolean isCommentDirective​(java.lang.String text)
        Overrides:
        isCommentDirective in class org.flywaydb.core.internal.parser.Parser
      • detectStatementType

        protected org.flywaydb.core.internal.parser.StatementType detectStatementType​(java.lang.String simplifiedStatement,
                                                                                      org.flywaydb.core.internal.parser.ParserContext context,
                                                                                      org.flywaydb.core.internal.parser.PeekingReader reader)
        Overrides:
        detectStatementType in class org.flywaydb.core.internal.parser.Parser
      • shouldAdjustBlockDepth

        protected boolean shouldAdjustBlockDepth​(org.flywaydb.core.internal.parser.ParserContext context,
                                                 java.util.List<org.flywaydb.core.internal.parser.Token> tokens,
                                                 org.flywaydb.core.internal.parser.Token token)
        Overrides:
        shouldAdjustBlockDepth in class org.flywaydb.core.internal.parser.Parser
      • adjustBlockDepth

        protected void adjustBlockDepth​(org.flywaydb.core.internal.parser.ParserContext context,
                                        java.util.List<org.flywaydb.core.internal.parser.Token> tokens,
                                        org.flywaydb.core.internal.parser.Token keyword,
                                        org.flywaydb.core.internal.parser.PeekingReader reader)
        Overrides:
        adjustBlockDepth in class org.flywaydb.core.internal.parser.Parser