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

regression: str_to_date() cannot be used in the CHECK clause

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 12.3.2
    • N/A
    • Documentation
    • None
    • Linux

    Description

      The following table can be created under 12.2.2, but not 12.3.2.
      ```
      --------------
      CREATE TABLE observation(
      id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
      serial VARCHAR(20) NOT NULL,
      observation_date DATE NOT NULL,

      CONSTRAINT CHECK(observation_date >= (str_to_date(substr(serial, 6, 7), '%Y%j')))
      )
      --------------

      ERROR 1901 (HY000) at line 3: Function or expression 'str_to_date()' cannot be used in the CHECK clause of `CONSTRAINT_1`
      ```

      Attachments

        Issue Links

          Activity

            People

              maxmether Max Mether
              grg Graham Gower
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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