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

Server crashes on attempt to create a SPIDER table with a wrong version of mysql.spider_tables

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10.0.5
    • Component/s: None
    • Labels:
    • Environment:
      Ubuntu 12.04 Precise x86_64

      Description

      Going blind with spider quickly got me to a dark place...

      Since I don't know how to use spider properly, I just started the server, installed the plugin via

      install soname 'ha_spider.so'

      and tried to create a table:

      create table t1 (i int) engine=SPIDER;

      which produced a failure:

      ERROR 1146 (42S02): Table 'mysql.spider_tables' doesn't exist

      I find it questionable that the tables are supposed to be created manually, but I'll hold my judgement until we have the documentation

      So, I went to tests, picked up a statement which created mysql.spider_tables, ran it, tried to create a table again and got a nasty crash.
      It turned out that I picked create table for a wrong version of the plugin ("1" instead of "3"), but I suppose it isn't expected to crash anyway.

      INSTALL SONAME 'ha_spider.so';
      CREATE TABLE mysql.spider_tables(
          db_name char(64) not null default '',
          table_name char(64) not null default '',
          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 char(64) default null,
          username char(64) default null,
          password char(64) default null,
          tgt_db_name char(64) default null,
          tgt_table_name char(64) default null,
          PRIMARY KEY (db_name, table_name),
          KEY idx1 (priority)
        ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
      CREATE TABLE t1 (i INT) ENGINE=SPIDER;

      #5  0x00007f6c6af9cb8b in __GI_abort () at abort.c:91
      #6  0x00007f6c6afd739e in __libc_message (do_abort=2, fmt=0x7f6c6b0e1008 "*** glibc detected *** %s: %s: 0x%s ***\n") at ../sysdeps/unix/sysv/linux/libc_fatal.c:201
      #7  0x00007f6c6afe1b96 in malloc_printerr (action=3, str=0x7f6c6b0dd913 "free(): invalid pointer", ptr=<optimized out>) at malloc.c:5007
      #8  0x0000000000debf8b in my_free (ptr=0x7f6c4c047188) at 10.0/mysys/my_malloc.c:214
      #9  0x00007f6c598d4de4 in spider_free_mem (trx=0x7f6c4c05aba8, ptr=0x7f6c4c047198, my_flags=0) at 10.0/storage/spider/spd_malloc.cc:184
      #10 0x00007f6c5985d3af in spider_open_sys_table (thd=0x25603a8, table_name=0x7f6c59944de0 "spider_tables", table_name_length=13, write=true, open_tables_backup=0x7f6c680cf180, need_lock=false, error_num=0x7f6c680cf210) at 10.0/storage/spider/spd_sys_table.cc:165
      #11 0x00007f6c598fb28c in ha_spider::create (this=0x7f6c4c0335b0, name=0x7f6c680d17d0 "./test/t1", form=0x7f6c680d0030, info=0x7f6c680d1ae0) at 10.0/storage/spider/ha_spider.cc:9681
      #12 0x000000000080b9f2 in handler::ha_create (this=0x7f6c4c0335b0, name=0x7f6c680d17d0 "./test/t1", form=0x7f6c680d0030, info=0x7f6c680d1ae0) at 10.0/sql/handler.cc:4004
      #13 0x000000000080c7f4 in ha_create_table (thd=0x25603a8, path=0x7f6c680d17d0 "./test/t1", db=0x7f6c4c04cfb0 "test", table_name=0x7f6c4c04f880 "t1", create_info=0x7f6c680d1ae0, frm=0x7f6c680d1340) at 10.0/sql/handler.cc:4356
      #14 0x00000000007142c4 in rea_create_table (thd=0x25603a8, frm=0x7f6c680d1340, path=0x7f6c680d17d0 "./test/t1", db=0x7f6c4c04cfb0 "test", table_name=0x7f6c4c04f880 "t1", create_info=0x7f6c680d1ae0, file=0x7f6c4c02bd80) at 10.0/sql/unireg.cc:391
      #15 0x00000000006d05b5 in mysql_create_table_no_lock (thd=0x25603a8, db=0x7f6c4c04cfb0 "test", table_name=0x7f6c4c04f880 "t1", create_info=0x7f6c680d1ae0, alter_info=0x7f6c680d1bf0, is_trans=0x7f6c680d1a5e, create_table_mode=0) at 10.0/sql/sql_table.cc:4453
      #16 0x00000000006d0966 in mysql_create_table (thd=0x25603a8, create_table=0x7f6c4c0328e0, create_info=0x7f6c680d1ae0, alter_info=0x7f6c680d1bf0) at 10.0/sql/sql_table.cc:4553
      #17 0x0000000000624517 in mysql_execute_command (thd=0x25603a8) at 10.0/sql/sql_parse.cc:2940
      #18 0x000000000062d680 in mysql_parse (thd=0x25603a8, rawbuf=0x7f6c4c034610 "CREATE TABLE t1 (i INT) ENGINE=SPIDER", length=37, parser_state=0x7f6c680d2500) at 10.0/sql/sql_parse.cc:6176
      #19 0x0000000000620556 in dispatch_command (command=COM_QUERY, thd=0x25603a8, packet=0x25655a9 "CREATE TABLE t1 (i INT) ENGINE=SPIDER", packet_length=37) at 10.0/sql/sql_parse.cc:1274
      #20 0x000000000061f9cc in do_command (thd=0x25603a8) at 10.0/sql/sql_parse.cc:983
      #21 0x000000000073d820 in do_handle_one_connection (thd_arg=0x25603a8) at 10.0/sql/sql_connect.cc:1267
      #22 0x000000000073d573 in handle_one_connection (arg=0x25603a8) at 10.0/sql/sql_connect.cc:1181
      #23 0x00000000009d32b4 in pfs_spawn_thread (arg=0x23d4eb8) at 10.0/storage/perfschema/pfs.cc:1800
      #24 0x00007f6c6bf78e9a in start_thread (arg=0x7f6c680d3700) at pthread_create.c:308
      #25 0x00007f6c6b056cbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112

      bzr version-info

      revision-id: svoj@mariadb.org-20130627111848-b8kc0z60ywwpqavz
      revno: 3762
      branch-nick: 10.0

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              svoj Sergey Vojtovich
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: