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

              Assignee:
              serg Sergei Golubchik
              Reporter:
              RoyBellingan Roy Bellingan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: