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

Add sql_mode specific tokens for the keyword DECLARE

Details

    • Task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.3.11
    • Parser
    • None

    Description

      DECLARE has different meanings in the default sql_mode and in sql_mode=ORACLE.

      To unify sql_yacc.yy and sql_yacc_ora.yy easier, we'll add sql_mode specific tokens for this keyword and modify the grammar in sql_yacc.yy and sql_yacc_ora.yy accordingly.

      Instead of DECLARE_SYM, we'll have separate DECLARE_MARIADB_SYM and DECLARE_ORACLE_SYM.

      This will make possible for native and Oracle grammar rules to co-exists in the same *.yy files.

      By default, Lex_input_stream::find_keyword() will return DECLARE_MARIADB_SYM, and translate it to DECLARE_ORACLE_SYM in Oracle compatibility mode:

          if (m_thd->variables.sql_mode & MODE_ORACLE)
          {
            switch (symbol->tok) {
              ...
              case DECLARE_MARIADB_SYM:         return DECLARE_ORACLE_SYM;
              ...
            }
          }
      

      Attachments

        Issue Links

          Activity

            bar Alexander Barkov created issue -
            bar Alexander Barkov made changes -
            Field Original Value New Value
            bar Alexander Barkov made changes -
            Summary Add sql_mode specific tokens for the keyword DECODE Add sql_mode specific tokens for the keyword DECLARE
            bar Alexander Barkov made changes -
            Description Add sql_mode specific tokens for the keyword DECODE

            DECLARE has different meanings in the default sql_mode and in sql_mode=ORACLE.

            To unify sql_yacc.yy and sql_yacc_ora.yy easier, we'll add sql_mode specific tokens for this keyword and modify the grammar in sql_yacc.yy and sql_yacc_ora.yy accordingly.

            Instead of DECLARE_SYM, we'll have separate DECLARE_MARIADB_SYM and DECLARE_ORACLE_SYM.

            This will make possible for native and Oracle grammar rules to co-exists in the same *.yy files.

            By default, Lex_input_stream::find_keyword() will return DECLARE_MARIADB_SYM, and translate it to DECLARE_ORACLE_SYM in Oracle compatibility mode:

            {code:cpp}
                if (m_thd->variables.sql_mode & MODE_ORACLE)
                {
                  switch (symbol->tok) {
                    ...
                    case DECLARE_MARIADB_SYM: return DECLARE_ORACLE_SYM;
                    ...
                  }
                }
            {code}

            Add sql_mode specific tokens for the keyword DECLARE

            DECLARE has different meanings in the default sql_mode and in sql_mode=ORACLE.

            To unify sql_yacc.yy and sql_yacc_ora.yy easier, we'll add sql_mode specific tokens for this keyword and modify the grammar in sql_yacc.yy and sql_yacc_ora.yy accordingly.

            Instead of DECLARE_SYM, we'll have separate DECLARE_MARIADB_SYM and DECLARE_ORACLE_SYM.

            This will make possible for native and Oracle grammar rules to co-exists in the same *.yy files.

            By default, Lex_input_stream::find_keyword() will return DECLARE_MARIADB_SYM, and translate it to DECLARE_ORACLE_SYM in Oracle compatibility mode:

            {code:cpp}
                if (m_thd->variables.sql_mode & MODE_ORACLE)
                {
                  switch (symbol->tok) {
                    ...
                    case DECLARE_MARIADB_SYM: return DECLARE_ORACLE_SYM;
                    ...
                  }
                }
            {code}

            bar Alexander Barkov made changes -
            Description Add sql_mode specific tokens for the keyword DECLARE

            DECLARE has different meanings in the default sql_mode and in sql_mode=ORACLE.

            To unify sql_yacc.yy and sql_yacc_ora.yy easier, we'll add sql_mode specific tokens for this keyword and modify the grammar in sql_yacc.yy and sql_yacc_ora.yy accordingly.

            Instead of DECLARE_SYM, we'll have separate DECLARE_MARIADB_SYM and DECLARE_ORACLE_SYM.

            This will make possible for native and Oracle grammar rules to co-exists in the same *.yy files.

            By default, Lex_input_stream::find_keyword() will return DECLARE_MARIADB_SYM, and translate it to DECLARE_ORACLE_SYM in Oracle compatibility mode:

            {code:cpp}
                if (m_thd->variables.sql_mode & MODE_ORACLE)
                {
                  switch (symbol->tok) {
                    ...
                    case DECLARE_MARIADB_SYM: return DECLARE_ORACLE_SYM;
                    ...
                  }
                }
            {code}

            DECLARE has different meanings in the default sql_mode and in sql_mode=ORACLE.

            To unify sql_yacc.yy and sql_yacc_ora.yy easier, we'll add sql_mode specific tokens for this keyword and modify the grammar in sql_yacc.yy and sql_yacc_ora.yy accordingly.

            Instead of DECLARE_SYM, we'll have separate DECLARE_MARIADB_SYM and DECLARE_ORACLE_SYM.

            This will make possible for native and Oracle grammar rules to co-exists in the same *.yy files.

            By default, Lex_input_stream::find_keyword() will return DECLARE_MARIADB_SYM, and translate it to DECLARE_ORACLE_SYM in Oracle compatibility mode:

            {code:cpp}
                if (m_thd->variables.sql_mode & MODE_ORACLE)
                {
                  switch (symbol->tok) {
                    ...
                    case DECLARE_MARIADB_SYM: return DECLARE_ORACLE_SYM;
                    ...
                  }
                }
            {code}

            bar Alexander Barkov made changes -
            issue.field.resolutiondate 2018-11-12 05:25:31.0 2018-11-12 05:25:31.124
            bar Alexander Barkov made changes -
            Component/s Parser [ 10201 ]
            Fix Version/s 10.3.11 [ 23141 ]
            Fix Version/s 10.3 [ 22126 ]
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 90539 ] MariaDB v4 [ 133747 ]

            People

              bar Alexander Barkov
              bar Alexander Barkov
              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.