Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-12390

Wrong error line numbers reported with sql_mode=IGNORE_SPACE

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.0(EOL), 10.1(EOL), 10.2(EOL)
    • 10.2.5
    • Parser
    • None

    Description

      If I set sql_mode=IGNORE_SPACE, messages about syntax errors report wrong line numbers:

      SET sql_mode=IGNORE_SPACE;
      DROP PROCEDURE IF EXISTS p1;
      DELIMITER $$
      CREATE PROCEDURE p1()
      BEGIN
        SELECT 1+1;
        syntax error;
      END;
      $$
      DELIMITER ;
      

      ERROR 1064 (42000): You have an error in your SQL syntax ... near 'error...' at line 3
      

      Notice, the line number 3 is wrong. The syntax error is actually on the line 4.

      If I change to sql_mode=DEFAULT, it correctly reports 'at line 4':

      SET sql_mode=DEFAULT;
      DROP PROCEDURE IF EXISTS p1;
      DELIMITER $$
      CREATE PROCEDURE p1()
      BEGIN
        SELECT 1+1;
        syntax error;
      END;
      $$
      DELIMITER ;
      

      ERROR 1064 (42000): You have an error in your SQL syntax ... near 'error...' at line 4
      

      Attachments

        Activity

          bar Alexander Barkov created issue -
          bar Alexander Barkov made changes -
          Field Original Value New Value
          Status Open [ 1 ] In Progress [ 3 ]
          bar Alexander Barkov made changes -
          Affects Version/s 10.0 [ 16000 ]
          Affects Version/s 10.1 [ 16100 ]
          bar Alexander Barkov made changes -
          Status In Progress [ 3 ] Stalled [ 10000 ]
          bar Alexander Barkov made changes -
          Fix Version/s 10.2.4 [ 22116 ]
          Fix Version/s 10.2 [ 14601 ]
          bar Alexander Barkov made changes -
          Fix Version/s 10.2.5 [ 22117 ]
          Fix Version/s 10.2.4 [ 22116 ]
          bar Alexander Barkov made changes -
          issue.field.resolutiondate 2018-06-21 07:45:38.0 2018-06-21 07:45:38.341
          bar Alexander Barkov made changes -
          Resolution Fixed [ 1 ]
          Status Stalled [ 10000 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 80163 ] MariaDB v4 [ 151879 ]

          People

            bar Alexander Barkov
            bar Alexander Barkov
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.