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

from_unixtime can not be longer used in Virtual Column

    XMLWordPrintable

Details

    Description

      This is no longer accept since the 10.4.12

      CREATE TABLE `expenditure2` (
        `ts` int(10) unsigned NOT NULL COMMENT 'midnight',
        `dateUTC` date AS (cast(from_unixtime(`ts`) as date)) PERSISTENT
      ) ENGINE=InnoDB;
      

      But if you already have a table with similar schema, is still working.

      I check in the doc / release note and the only possibly related entry I was able to find are:
      https://mariadb.com/kb/en/mariadb-10231-changelog/
      https://github.com/MariaDB/server/commit/8eec2d61fc

      MDEV-21249 MariaDB 10.3.10 When referring to bigint to generate timestamp data in the virtual generated column, the value of the generated column does not change when the time zone changes

      As a side note also the `

      create table like xxx
      

      ` no longer work so

      create table newTable like tableWithVirtColum;

      Gives
      Error in query (1901): Function or expression 'from_unixtime()' cannot be used in the GENERATED ALWAYS AS clause of `dateCET`

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              RoyBellingan Roy Bellingan
              Votes:
              3 Vote for this issue
              Watchers:
              7 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.