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

Error inconsistency CLI vs error log on CREATE TABLE

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 11.6(EOL), 11.7, 11.8
    • 11.7
    • Character Sets
    • None

    Description

      Discussed with bar and marko. The following:

      CREATE TABLE t (a INT,b VARCHAR(512),c VARCHAR(16),PRIMARY KEY(a),INDEX (b (512))) KEY_BLOCK_SIZE=2;
      

      Will produce no error in 11.4 debug:

      CS 11.4.5 866a8ea6736d2edc0f6be552d1cdd6810c10d5ab (Debug)

      11.4.5-dbg>CREATE TABLE t (a INT,b VARCHAR(512),c VARCHAR(16),PRIMARY KEY(a),INDEX (b (512))) KEY_BLOCK_SIZE=2;
      Query OK, 0 rows affected (0.022 sec)
       
      11.4.5-dbg>SHOW CREATE TABLE t\G
      *************************** 1. row ***************************
             Table: t
      Create Table: CREATE TABLE `t` (
        `a` int(11) NOT NULL,
        `b` varchar(512) DEFAULT NULL,
        `c` varchar(16) DEFAULT NULL,
        PRIMARY KEY (`a`),
        KEY `b` (`b`)
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci KEY_BLOCK_SIZE=2
      1 row in set (0.000 sec)
      

      Whereas in 11.6 debug we see:

      CS 11.6.2 d8dad8c3b54cd09fefce7bc3b9749f427eed9709 (Debug)

      11.6.2-dbg>CREATE TABLE t (a INT,b VARCHAR(512),c VARCHAR(16),PRIMARY KEY(a),INDEX (b (512))) KEY_BLOCK_SIZE=2;
      ERROR 1118 (42000): Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
      

      While this may be expected due to the default collation change in MDEV-19123, in 11.6 we see an inconsistency even within the same server version (11.6) between the CLI output above, and the message in the error log:

      CS 11.6.2 d8dad8c3b54cd09fefce7bc3b9749f427eed9709 (Debug)

      2024-11-23 15:17:53 4 [ERROR] InnoDB: Cannot add field `b` in table `test`.`t` because after adding it, the row size is 2053 which is greater than maximum allowed size (1922 bytes) for a record on index leaf page.
      

      It would be good to 1) fix the error message inconsistency so that the client and error log show the same output, 2) verify that all is correct/as expected in this area as it seems there are a few things at play here.

      11.4: ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
      11.6: ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
      

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.