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

SPIDER plugin initialization failed at 'create table if not exists mysql.spider_tables ... with 'Specified key was too long; max key length is 1000 bytes', Warning: Memory not freed: 10720

Details

    Description

      SET GLOBAL old_mode=4;
      INSTALL PLUGIN Spider SONAME 'ha_spider.so';
      

      Leads to:

      11.4.0 9bd95e914f3f12d0d9d93e7a1f2c49e6e8841f17 (Debug)

      2024-01-15 14:27:31 0 [Note] /test/MD271223-mariadb-11.4.0-linux-x86_64-dbg/bin/mariadbd: ready for connections.
      Version: '11.4.0-MariaDB-debug'  socket: '/test/MD271223-mariadb-11.4.0-linux-x86_64-dbg/socket.sock'  port: 10292  MariaDB Server
      [ERROR] SPIDER plugin initialization failed at 'create table if not exists mysql.spider_tables(  db_name char(64) not null default '',  table_name char(199) not null default '',  link_id int not null default 0,  priority bigint not null default 0,  server char(64) default null,  scheme char(64) default null,  host char(64) default null,  port char(5) default null,  socket text,  username char(64) default null,  password char(64) default null,  ssl_ca text,  ssl_capath text,  ssl_cert text,  ssl_cipher char(64) default null,  ssl_key text,  ssl_verify_server_cert tinyint not null default 0,  monitoring_binlog_pos_at_failing tinyint not null default 0,  default_file text,  default_group char(64) default null,  dsn char(64) default null,  filedsn text default null,  driver char(64) default null,  tgt_db_name char(64) default null,  tgt_table_name char(64) default null,  link_status tinyint not null default 1,  block_status tinyint not null default 0,  static_link_id char(64) default null,  primary key (db_name, table_name, link_id),  key idx1 (priority),  unique key uidx1 (db_name, table_name, static_link_id)) engine=MyISAM default charset=utf8 collate=utf8_bin' by 'Specified key was too long; max key length is 1000 bytes'
      2024-01-15 14:27:33 4 [ERROR] Plugin 'SPIDER' registration as a STORAGE ENGINE failed.
      

      And

      11.4.0 9bd95e914f3f12d0d9d93e7a1f2c49e6e8841f17 (Debug)

      2024-01-15 14:27:34 0 [Note] /test/MD271223-mariadb-11.4.0-linux-x86_64-dbg/bin/mariadbd: Shutdown complete
      Warning: Memory not freed: 10720
      

      The memory loss is the same in all versions. 10.11 To 11.4 are affected. Occurs in both dbg+opt builds.

      Attachments

        Issue Links

          Activity

            ycp Yuchen Pei added a comment - - edited

            I could reproduce in 10.6 d06b6de3050180ec2f96ef00963d1beab8e1b47a
            too (in mtr, not mysql client), but not in 10.4 or 10.5.

            For 10.11 d0c80c211c1fe3370b68be540bb9113028c6746f I could reproduce
            in the client.

            The output can vary but the log always reveals

            [ERROR] SPIDER plugin initialization failed at 'create table if not exists mysql.spider_tables ... engine=MyISAM default charset=utf8 collate=utf8_bin' by 'Specified key was too long; max key length is 1000 bytes'

            ycp Yuchen Pei added a comment - - edited I could reproduce in 10.6 d06b6de3050180ec2f96ef00963d1beab8e1b47a too (in mtr, not mysql client), but not in 10.4 or 10.5. For 10.11 d0c80c211c1fe3370b68be540bb9113028c6746f I could reproduce in the client. The output can vary but the log always reveals [ERROR] SPIDER plugin initialization failed at 'create table if not exists mysql.spider_tables ... engine=MyISAM default charset=utf8 collate=utf8_bin' by 'Specified key was too long; max key length is 1000 bytes'
            ycp Yuchen Pei added a comment - - edited

            Hi holyfoot, ptal thanks

            bb-10.6-mdev-33242 686b3ad052219e5c4de291e6f7e6dd45a6b3bb9d
            MDEV-33242 Make Spider init queries compatible with non-default old_mode
             
            Add UTF8_IS_UTF8MB3 to the (session) old_mode in connections made with
            sql service to run init queries
             
            The connection is new and the global variable value takes effect
            rather than the session value from the caller of spider_db_init
            

            It's the same kind of issue as MDEV-32753

            ycp Yuchen Pei added a comment - - edited Hi holyfoot , ptal thanks bb-10.6-mdev-33242 686b3ad052219e5c4de291e6f7e6dd45a6b3bb9d MDEV-33242 Make Spider init queries compatible with non-default old_mode   Add UTF8_IS_UTF8MB3 to the (session) old_mode in connections made with sql service to run init queries   The connection is new and the global variable value takes effect rather than the session value from the caller of spider_db_init It's the same kind of issue as MDEV-32753

            ok to push.

            holyfoot Alexey Botchkov added a comment - ok to push.
            ycp Yuchen Pei added a comment -

            pushed 1031c8848dd40672c7d90c946a188f0c4f2c0578 to 10.6 yesterday

            ycp Yuchen Pei added a comment - pushed 1031c8848dd40672c7d90c946a188f0c4f2c0578 to 10.6 yesterday
            Roel Roel Van de Paar added a comment - - edited

            ycp Hi! Thank you for the fix above.

            I had the following testcase today on 11.4:

            SET SESSION sql_mode=(SELECT CONCAT (@@sql_mode,',no_zero_date'));
            SET GLOBAL sql_mode=(SELECT REPLACE (@@sql_mode,',strict_all_tables',''));
            INSTALL SONAME 'ha_spider';
            SHUTDOWN;
            

            Which would result in the same amount of memory lost:

            11.4.0 9b1ea6904965dd345478dedd80e181ad54c767da (Debug)

            # 2024-02-19 16:52:33 4 [ERROR] Plugin 'SPIDER' registration as a STORAGE ENGINE failed.
            ...
            2024-02-19 16:52:33 0 [Note] /test/MD060224-mariadb-11.4.0-linux-x86_64-dbg/bin/mariadbd: Shutdown complete
             
            Warning: Memory not freed: 10720
            

            When I test 10.6 dbg, build on the 6th of Feb (one day after your push), the issue does not reproduce.
            I assume it is the same bug?
            Interesting also; the sql_mode change effect.

            Roel Roel Van de Paar added a comment - - edited ycp Hi! Thank you for the fix above. I had the following testcase today on 11.4: SET SESSION sql_mode=( SELECT CONCAT (@@sql_mode, ',no_zero_date' )); SET GLOBAL sql_mode=( SELECT REPLACE (@@sql_mode, ',strict_all_tables' , '' )); INSTALL SONAME 'ha_spider' ; SHUTDOWN; Which would result in the same amount of memory lost: 11.4.0 9b1ea6904965dd345478dedd80e181ad54c767da (Debug) # 2024-02-19 16:52:33 4 [ERROR] Plugin 'SPIDER' registration as a STORAGE ENGINE failed. ... 2024-02-19 16:52:33 0 [Note] /test/MD060224-mariadb-11.4.0-linux-x86_64-dbg/bin/mariadbd: Shutdown complete   Warning: Memory not freed: 10720 When I test 10.6 dbg, build on the 6th of Feb (one day after your push), the issue does not reproduce. I assume it is the same bug? Interesting also; the sql_mode change effect.
            ycp Yuchen Pei added a comment -

            Thanks Roel, new case split to MDEV-33494

            ycp Yuchen Pei added a comment - Thanks Roel , new case split to MDEV-33494

            People

              ycp Yuchen Pei
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.