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

Better handling of system versioning for generated stored columns

Details

    Description

      Now generated stored columns are always system versioned. WITH/WITHOUT SYSTEM VERSIONING is not supported for generated columns at parser level:

      field_def:
                opt_attribute
              | opt*generated_always AS virtual_column*func
               {
                 Lex->last*field->vcol*info= $3;
                 Lex->last*field->flags&= ~NOT_NULL*FLAG; // undo automatic NOT NULL for timestamps
               }
                vcol*opt_specifier vcol_opt*attribute
              | opt*generated_always AS ROW_SYM START_SYM opt_asrow*attribute
                {
                  if (Lex->last*field_generated_always_as_row*start())
                    MYSQL_YYABORT;
                }
              | opt*generated_always AS ROW_SYM END opt_asrow*attribute
                {
                  if (Lex->last*field_generated_always_as_row*end())
                    MYSQL_YYABORT;
                }
              ;
      

      Better feature would be to detect if all the components of generated stored column are WITHOUT SYSTEM VERSIONING and make it so accordingly. Of course independent WITHOUT SYSTEM VERSIONING for generated stored also makes sense.

      Please vote if your production use case will benefit from these features.

      Attachments

        Issue Links

          Activity

            test case: a system versioned table, a column f1 WITHOUT SYSTEM VERSIONING, a persisten generated column based on f1. Changing f1 should not generate a new history record.

            serg Sergei Golubchik added a comment - test case: a system versioned table, a column f1 WITHOUT SYSTEM VERSIONING , a persisten generated column based on f1. Changing f1 should not generate a new history record.

            People

              midenok Aleksey Midenkov
              midenok Aleksey Midenkov
              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.