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

Check when doing ALTER TABLE table_name sequence=1 that table can be a sequence

Details

    Description

      When doing an ALTER TABLE table_name sequence=1 we should give an error if:

      • That table definition does not match what is required by sequences.
      • This should already be the case
      • The table has 1 row
      • The content matches an allowed sequence state

      Attachments

        Issue Links

          Activity

            ycp, I am not sure I understand your reasoning. Because it has been possible to introduce corruption in several releases of the product, it should remain useful to implement a check that would detect and flag such corruption, even if the possibility of future corruption was completely eliminated. After all, we support in-place upgrade from older versions of the product.

            marko Marko Mäkelä added a comment - ycp , I am not sure I understand your reasoning. Because it has been possible to introduce corruption in several releases of the product, it should remain useful to implement a check that would detect and flag such corruption, even if the possibility of future corruption was completely eliminated. After all, we support in-place upgrade from older versions of the product.
            ycp Yuchen Pei added a comment - - edited

            marko, I don't think it makes sense to add untested code, or do you know ways to still create a sequence with more than one row and a sequence with wrong metadata in an mtr test, after this change?

            ycp Yuchen Pei added a comment - - edited marko , I don't think it makes sense to add untested code, or do you know ways to still create a sequence with more than one row and a sequence with wrong metadata in an mtr test, after this change?
            ycp Yuchen Pei added a comment - - edited

            Inspired by marko's test in MDEV-36487, I was able to construct mtr cases that create sequences with wrong number of rows and wrong metadata, so I have restored the relevant checks in the top commit of the 12.0 patchset.

            Hi sanja, ptal at these patches instead, thanks

            10.11 (no change):

            cc17fba7d4f upstream/bb-10.11-mdev-36032 MDEV-36032 Check whether a table can be a sequence when ALTERed with SEQUENCE=1
            

            12.0 (the top commit has been updated):

            f96b44de6fd upstream/bb-12.0-mdev-36032 MDEV-22491 Adjust changes made in MDEV-24911 after MDEV-36032
            99515a4cecb MDEV-22491 Support mariadb-check and CHECK TABLE with SEQUENCE
            8a5b3f6d103 MDEV-36032 Check whether a table can be a sequence when ALTERed with SEQUENCE=1
            

            ycp Yuchen Pei added a comment - - edited Inspired by marko 's test in MDEV-36487 , I was able to construct mtr cases that create sequences with wrong number of rows and wrong metadata, so I have restored the relevant checks in the top commit of the 12.0 patchset. Hi sanja , ptal at these patches instead, thanks 10.11 (no change): cc17fba7d4f upstream/bb-10.11-mdev-36032 MDEV-36032 Check whether a table can be a sequence when ALTERed with SEQUENCE=1 12.0 (the top commit has been updated): f96b44de6fd upstream/bb-12.0-mdev-36032 MDEV-22491 Adjust changes made in MDEV-24911 after MDEV-36032 99515a4cecb MDEV-22491 Support mariadb-check and CHECK TABLE with SEQUENCE 8a5b3f6d103 MDEV-36032 Check whether a table can be a sequence when ALTERed with SEQUENCE=1
            sanja Oleksandr Byelkin added a comment -

            OK to push (BTW one line end of version test marker is modern variant (better merges))

            sanja Oleksandr Byelkin added a comment - OK to push (BTW one line end of version test marker is modern variant (better merges))
            ycp Yuchen Pei added a comment -

            thanks for the review - pushed 6f8ef26885073e1d0e3f69145d88c9452c0f4cf6 to 10.11

            ycp Yuchen Pei added a comment - thanks for the review - pushed 6f8ef26885073e1d0e3f69145d88c9452c0f4cf6 to 10.11

            People

              ycp Yuchen Pei
              monty Michael Widenius
              Votes:
              0 Vote for this issue
              Watchers:
              7 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.