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

TO_DATE no longer works as a variable

    XMLWordPrintable

Details

    • Can result in unexpected behaviour
    • Hide
      TO_DATE from the beginning of 12.3 has been a reserved keyword and now it is back to being a normal function and TO_DATE can be used as a variable/column name again. Its also the case that sql_mode=IGNORE_SPACE is required to make "TO_DATE (args)" a valid expression.
      Show
      TO_DATE from the beginning of 12.3 has been a reserved keyword and now it is back to being a normal function and TO_DATE can be used as a variable/column name again. Its also the case that sql_mode=IGNORE_SPACE is required to make "TO_DATE (args)" a valid expression.

    Description

      A variable called to_date can no longer be used after the upgrade to 12.3

      As reported on linkedIn

      fix:

      diff --git a/sql/lex.h b/sql/lex.h
      index 709d949cd6e..7f81d051f69 100644
      --- a/sql/lex.h
      +++ b/sql/lex.h
      @@ -675,7 +675,6 @@ SYMBOL symbols[] = {
         { "TINYINT",         SYM(TINYINT)},
         { "TINYTEXT",                SYM(TINYTEXT)},
         { "TO",              SYM(TO_SYM)},
      -  { "TO_DATE",         SYM(TO_DATE)},
         { "TRAILING",                SYM(TRAILING)},
         { "TRANSACTION",     SYM(TRANSACTION_SYM)},
         { "TRANSACTIONAL",   SYM(TRANSACTIONAL_SYM)},
      @@ -791,6 +790,7 @@ SYMBOL sql_functions[] = {
         { "SUBSTRING",       SYM(SUBSTRING)},
         { "SUM",             SYM(SUM_SYM)},
         { "SYSTEM_USER",      SYM(USER_SYM)},
      +  { "TO_DATE",         SYM(TO_DATE)},
         { "TRIM",            SYM(TRIM)},
         { "TRIM_ORACLE",     SYM(TRIM_ORACLE)},
         { "VARIANCE",                SYM(VARIANCE_SYM)},
      

      Attachments

        Issue Links

          Activity

            People

              danblack Daniel Black
              danblack Daniel Black
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 0.25d Original Estimate - 0.25d
                  0.25d
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 2.25h
                  2.25h

                  Git Integration

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