Menu

#487 (ok 3.2.5) Incorrect matching of delimiter keyword

closed-accepted
Parsing (8)
1
2010-01-10
2009-12-15
Greg Roach
No

The SQL parser is matching the word "delimiter" when it is not being used as a keyword. Examples include variable names in stored procedures and column names such as "my_delimiter".

This patch amends the parser to match the delimiter keyword only when not preceded by a character that could form part of an identifier.

Discussion

  • Greg Roach

    Greg Roach - 2009-12-15

    Patch against SVN 13164

     
  • Marc Delisle

    Marc Delisle - 2009-12-16

    Thanks for the patch. First, I try to reproduce the problem with version 3.2.4 by importing a file that contains only this:
    DELIMITER //
    /*
    Process FOO. See http://www.foo.com
    */
    DROP PROCEDURE IF EXISTS foo
    //

    and I cannot reproduce the problem (I had a procedure foo and it was deleted). Can you suggest a better way to test?

     
  • Marc Delisle

    Marc Delisle - 2009-12-16
    • assigned_to: nobody --> lem9
    • status: open --> pending
     
  • Greg Roach

    Greg Roach - 2009-12-16

    This patch is not for the problem described in your comment. It is for scripts that contain the character sequence "delimiter" in a context other than as a keyword.

    Create a new/empty database and run the attached delim_error.sql script.

    Before the patch, it reports that it has run two SQL statements, and does not execute the third one. After the patch, it runs all three.

     
  • Greg Roach

    Greg Roach - 2009-12-16
    • status: pending --> open
     
  • Greg Roach

    Greg Roach - 2009-12-16

    Script to reproduce the original bug

     
  • Marc Delisle

    Marc Delisle - 2009-12-17
    • priority: 5 --> 1
    • summary: Incorrect matching of delimiter keyword --> (ok 3.2.5) Incorrect matching of delimiter keyword
    • status: open --> open-accepted
     
  • Marc Delisle

    Marc Delisle - 2009-12-17

    Merged in subversion, thanks.

     
  • Marc Delisle

    Marc Delisle - 2010-01-10
    • status: open-accepted --> closed-accepted
     
MongoDB Logo MongoDB