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

Add sql_mode specific tokens for keywords BLOB, CLOB, NUMBER, RAW, VARCHAR2

    Details

    • Type: Task
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Fix Version/s: 10.3.11
    • Component/s: Parser
    • Labels:
      None

      Description

      Keywords BLOB, CLOB, NUMBER, RAW, VARCHAR2 appear in different context in sql_yacc.yy and sql_yacc_ora.yy.

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

      Instead of say BLOB_SYM, we'll have separate BLOB_MARIADB_SYM and BLOB_ORACLE_SYM.

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

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

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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bar Alexander Barkov
                Reporter:
                bar Alexander Barkov
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: