Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-1324

SQL parser misinterprets -- in expressions and mishandles characters after block comments

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • None
    • 3.5.9
    • Other
    • None

    Description

      the client-side SQL parser (ClientParser), used to locate ? placeholders and to rewrite batches, has a parsing bugs:

      line comment "--" inside expressions are treated as a comment.
      Any "--" was treated as the start of an end-of-line comment.
      In MariaDB/MySQL, line comments only begins a comment when followed by whitespace or a control character, in an expression such as SELECT 2--1 (subtraction of a negative) the – is an operator, not a comment.
      The parser wrongly entered comment mode and discarded the rest of the statement, leading to incorrect placeholder splitting / query rewriting.

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            diego dupin Diego Dupin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.