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

Hitting "Row size too large" for DDL could cause crash on shutdown later

    XMLWordPrintable

Details

    Description

      MDEV-21316-master.opt
      -----------------------------------------
      --innodb-page-size=4k
       
      MDEV-21316.test
      ------------------------------
      --source include/have_innodb.inc
       
      # Compact and Redundant crash
        CREATE TABLE t3 ( col_varchar VARCHAR(500), col_text TEXT ) ENGINE = InnoDB ROW_FORMAT = Compact ;
      # CREATE TABLE t3 ( col_varchar VARCHAR(500), col_text TEXT ) ENGINE = InnoDB ROW_FORMAT = Redundant ;
      # No crash
      # CREATE TABLE t3 ( col_varchar VARCHAR(500), col_text TEXT ) ENGINE = InnoDB ROW_FORMAT = Dynamic ;
      # CREATE TABLE t3 ( col_varchar VARCHAR(500), col_text TEXT ) ENGINE = InnoDB ROW_FORMAT = Compressed ;
       
      # required
      ALTER TABLE t3 ADD COLUMN col_text_2 TEXT;
      # required
      --error ER_TOO_BIG_ROWSIZE
      ALTER TABLE t3 ADD FULLTEXT INDEX ( col_text ) ;
       
      --enable_abort_on_error
      SET GLOBAL innodb_fast_shutdown=0;
      --source include/restart_mysqld.inc
      DROP TABLE t3;
       
      Result of run (test name was different but code like above) against 10.5.1 compiled with debug
      ...
      worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019
      CREATE TABLE t3 ( col_varchar VARCHAR(500), col_text TEXT ) ENGINE = InnoDB ROW_FORMAT = Compact ;
      ALTER TABLE t3 ADD COLUMN col_text_2 TEXT;
      ALTER TABLE t3 ADD FULLTEXT INDEX ( col_text ) ;
      ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 1982. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
      SET GLOBAL innodb_fast_shutdown=0;
      # restart
      DROP TABLE t3;
      main.RQG_TO_MTR 'innodb'                 [ fail ]  Found warnings/errors in server log file!
              Test ended at 2019-12-13 19:38:36
      line
      2019-12-13 19:38:33 4 [ERROR] InnoDB: Cannot add field `col_text_2` in table `test`.`#sql-3351_4` because after adding it, the row size is 2107 which is greater than maximum allowed size (1982 bytes) for a record on index leaf page.
      Attempting backtrace. You can use the following information to find out
      ...
      Thread 1 (Thread 0x7f08cf5fe740 (LWP 13137)):
      #0  __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      #1  0x000055c087c99fb7 in my_write_core (sig=6) at mysys/stacktrace.c:518
      #2  0x000055c0873c5467 in handle_fatal_signal (sig=6) at sql/signal_handler.cc:343
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
      #5  0x00007f08cd00af5d in __GI_abort () at abort.c:90
      #6  0x00007f08cd05328d in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7f08cd17a528 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:181
      #7  0x00007f08cd05a64a in malloc_printerr (action=<optimized out>, str=0x7f08cd176eae "free(): invalid pointer", ptr=<optimized out>, ar_ptr=<optimized out>) at malloc.c:5426
      #8  0x00007f08cd05c73e in _int_free (av=0x7f08cd3acc20 <main_arena>, p=<optimized out>, have_lock=0) at malloc.c:4175
      #9  0x00007f08cd06144e in __GI___libc_free (mem=<optimized out>) at malloc.c:3145
      #10 0x000055c0879daad6 in LatchCounter::~LatchCounter (this=0x55c089c0d848, __in_chrg=<optimized out>) at storage/innobase/include/sync0types.h:579
      #11 0x000055c0879dd4a0 in LatchMeta<LatchCounter>::~LatchMeta (this=0x55c089c0d820, __in_chrg=<optimized out>) at storage/innobase/include/sync0types.h:758
      #12 0x000055c0879da756 in sync_latch_meta_destroy () at storage/innobase/sync/sync0debug.cc:1539
      #13 0x000055c0879da914 in sync_check_close () at storage/innobase/sync/sync0debug.cc:1742
      #14 0x000055c0879ca2fc in innodb_shutdown () at storage/innobase/srv/srv0start.cc:2408
      #15 0x000055c08779b10a in innobase_end () at storage/innobase/handler/ha_innodb.cc:4131
      #16 0x000055c0873c869b in ha_finalize_handlerton (plugin=0x55c089b430a8) at sql/handler.cc:489
      #17 0x000055c08709f2d2 in plugin_deinitialize (plugin=0x55c089b430a8, ref_check=true) at sql/sql_plugin.cc:1255
      #18 0x000055c08709f83c in reap_plugins () at sql/sql_plugin.cc:1331
      #19 0x000055c0870a1c65 in plugin_shutdown () at sql/sql_plugin.cc:2000
      #20 0x000055c086f3edd2 in clean_up (print_message=true) at sql/mysqld.cc:1983
      #21 0x000055c086f46f14 in mysqld_main (argc=155, argv=0x55c089a00ba8) at sql/mysqld.cc:5747
      #22 0x000055c086f3b1ca in main (argc=24, argv=0x7ffefc3e7668) at sql/main.cc:25
       
      10.5 commit bbd2fa5c653bf0336f6ec0131ef41b8928c5ab86 2019-12-12
       
      No crash on 10.4.9
      There I get
      ALTER TABLE t3 ADD FULLTEXT INDEX ( col_text ) ' succeeded - should have failed with errno 1118.
      followed by an abort of the test.
      
      

      Attachments

        1. MDEV-21316.prt
          11 kB
        2. MDEV-21316.test
          0.7 kB
        3. MDEV-21316-master.opt
          0.0 kB

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              mleich Matthias Leich
              Votes:
              1 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.