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

Warnings inconsistently issued upon CHECK on table from older versions

Details

    Description

      Note: I'm fine with closing it as not a bug as long as all aspects of the new behavior are considered and confirmed to be expected. It was discussed a little on slack as a probably innocent consequence of MDEV-19292 fix, but I am not sure there was a final conclusion.

      Here is an example of the table:

      CREATE TABLE t1 (
        `c01` int(10) unsigned zerofill NOT NULL DEFAULT 0000000000,
        `c03` varchar(1024) NOT NULL DEFAULT '',
        `c04` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
        `c06` double(16,8) DEFAULT NULL COMMENT 'Percentage',
        `c07` date DEFAULT NULL,
        `c12` varchar(64) GENERATED ALWAYS AS (concat(`c09`,' ',`c10`)) VIRTUAL,
        `c05` longblob NOT NULL DEFAULT '',
        `c11` varchar(64) GENERATED ALWAYS AS (concat(`c09`,' ',`c10`)) PERSISTENT,
        `c08` text DEFAULT '',
        `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
        `c02` char(3) NOT NULL DEFAULT '',
        `c10` bigint(20) DEFAULT NULL COMMENT 'Y',
        `c09` bigint(20) DEFAULT NULL COMMENT 'X',
        PRIMARY KEY (`id`),
        UNIQUE KEY `idx1` (`c01`,`c02`),
        KEY `idx2` (`c05`(128))
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
      

      Server options: --innodb-compression-algorithm=none --innodb-page-size=4K, otherwise defaults.

      The table gets created on a pre-MDEV-19292 server with without any warnings (on a post-MDEV-19292 server it gets rejected).
      When a post-MDEV-19292 server starts on the old datadir, CHECK TABLE t1 produces the warning:

      10.2 fc77a66c

      +---------+-------+----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      | Table   | Op    | Msg_type | Msg_text                                                                                                                                                                                            |
      +---------+-------+----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      | test.t1 | check | Warning  | Row size too large (> 1982). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. |
      | test.t1 | check | status   | OK                                                                                                                                                                                                  |
      +---------+-------+----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      

      First, it's unclear whether MDEV-19292 patch was supposed to affect REDUNDANT / COMPACT tables at all.

      Secondly, the warning, if it's true, could have been helpful if it was reliable; but it is only issued on the first opening of the table:

      MariaDB [test]> check table t1;
      +---------+-------+----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      | Table   | Op    | Msg_type | Msg_text                                                                                                                                                                                            |
      +---------+-------+----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      | test.t1 | check | Warning  | Row size too large (> 1982). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. |
      | test.t1 | check | status   | OK                                                                                                                                                                                                  |
      +---------+-------+----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      2 rows in set (0.005 sec)
       
      MariaDB [test]> check table t1;
      +---------+-------+----------+----------+
      | Table   | Op    | Msg_type | Msg_text |
      +---------+-------+----------+----------+
      | test.t1 | check | status   | OK       |
      +---------+-------+----------+----------+
      1 row in set (0.005 sec)
      

      Which makes it fairly useless.

      And finally, the error log gets a different strange-looking warning instead:

      2019-07-28  0:57:51 140189814937344 [Warning] InnoDB: Cannot add field `c08` in table `test`.`t1` because after adding it, the row size is 2484 which is greater than maximum allowed size (1982) for a record on index leaf page.
      

      Attachments

        Issue Links

          Activity

            Also if we decide to continue having these warnings in the error log, could we at least only have them logged if innodb_strict_mode=ON?

            Another option is that if innodb_strict_mode=OFF is set, then the logging behavior can be based on log_warnings, as requested in MDEV-20832.

            GeoffMontee Geoff Montee (Inactive) added a comment - Also if we decide to continue having these warnings in the error log, could we at least only have them logged if innodb_strict_mode=ON? Another option is that if innodb_strict_mode =OFF is set, then the logging behavior can be based on log_warnings , as requested in MDEV-20832 .

            Some of my comments related to the MDEV-20949 fix should be helpful for fixing this.

            marko Marko Mäkelä added a comment - Some of my comments related to the MDEV-20949 fix should be helpful for fixing this.

            As demonstrated in MDEV-21748, in MariaDB 10.3 the function instant_alter_column_possible() is computing max_size in the wrong way, not taking blob_prefix correctly into account. This will unnecessarily prevent instant ADD COLUMN operations.

            marko Marko Mäkelä added a comment - As demonstrated in MDEV-21748 , in MariaDB 10.3 the function instant_alter_column_possible() is computing max_size in the wrong way, not taking blob_prefix correctly into account. This will unnecessarily prevent instant ADD COLUMN operations.

            Patch is in bb-10.3-MDEV-20194

            thiru Thirunarayanan Balathandayuthapani added a comment - Patch is in bb-10.3- MDEV-20194

            Thank you. I spotted a possible off-by-one error for ROW_FORMAT=REDUNDANT node pointer records. Otherwise, it looks OK to me.

            marko Marko Mäkelä added a comment - Thank you. I spotted a possible off-by-one error for ROW_FORMAT=REDUNDANT node pointer records. Otherwise, it looks OK to me.

            People

              thiru Thirunarayanan Balathandayuthapani
              elenst Elena Stepanova
              Votes:
              2 Vote for this issue
              Watchers:
              8 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.