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

Persistent computed column is not updated when update query contains join

    XMLWordPrintable

Details

    • 5.5.48-0

    Description

      There is a table with persistent computed column:

      CREATE TABLE `some_table` (
        `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
        `name` varchar(254) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
        `name_hash` varchar(64) COLLATE utf8mb4_unicode_ci AS (sha2(name, 256)) PERSISTENT,
        PRIMARY KEY (`id`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

      I am updating name value using complex query which contains joins, this is much simplified version which does not work as well:

      update some_table join some_other_table using(id) set name = concat(name, '+1') where some_table.id in (2051,2041)

      It updates name values but name_hash remains untouched. I've tried different cases with join and all of them do not update computed column. Updates without joins work fine.

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            Alkev Aleksandr Vishnyakov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

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