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

Bad column type created for TEXT(1431655798) CHARACTER SET utf8

Details

    Description

      CREATE OR REPLACE TABLE t1 (a TEXT(1431655798) CHARACTER SET utf8);
      SHOW CREATE TABLE t1;
      

      +-------+-----------------------------------------------------------------------------------------------------------+
      | Table | Create Table                                                                                              |
      +-------+-----------------------------------------------------------------------------------------------------------+
      | t1    | CREATE TABLE `t1` (
        `a` tinytext CHARACTER SET utf8 DEFAULT NULL
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
      +-------+-----------------------------------------------------------------------------------------------------------+
      

      Notice, it created a TINYTEXT column.
      The expected type is LONGTEXT.

      Attachments

        Issue Links

          Activity

            bar Alexander Barkov added a comment - - edited

            In 10.2 the above script crashes on assert:

            mysqld: /home/bar/maria-git/server.10.3/sql/field.h:4346: void Column_definition::create_length_to_internal_length_string(): Assertion `length <= 0xFFFFFFFFL' failed.
             
            Program received signal SIGABRT, Aborted.
            0x00007ffff5e42a28 in __GI_raise (sig=sig@entry=6)
                at ../sysdeps/unix/sysv/linux/raise.c:55
            55	  return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
            

            with the following stack:

            #3  0x00007ffff5e3b2d2 in __GI___assert_fail (
                assertion=0x12ff30c "length <= 0xFFFFFFFFL", 
                file=0x12ff2e0 "/home/bar/maria-git/server.10.3/sql/field.h", line=4346, 
                function=0x1301760 <Column_definition::create_length_to_internal_length_string()::__PRETTY_FUNCTION__> "void Column_definition::create_length_to_internal_length_string()") at assert.c:101
            #4  0x000000000083cced in Column_definition::create_length_to_internal_length_string (this=0x7ffe60013330) at /home/bar/maria-git/server.10.3/sql/field.h:4346
            #5  0x00000000008273f6 in Column_definition::prepare_stage1_string (
                this=0x7ffe60013330, thd=0x7ffe60000a98, mem_root=0x7ffe60006110, 
                file=0x7ffe600137f0, table_flags=264484092609758)
                at /home/bar/maria-git/server.10.3/sql/sql_table.cc:3186
            #6  0x000000000093d36b in Type_handler_string_result::Column_definition_prepare_stage1 (this=0x1ee7fd8 <type_handler_blob>, thd=0x7ffe60000a98, 
                mem_root=0x7ffe60006110, def=0x7ffe60013330, file=0x7ffe600137f0, 
                table_flags=264484092609758)
                at /home/bar/maria-git/server.10.3/sql/sql_type.cc:1679
            #7  0x00000000008275db in Column_definition::prepare_stage1 (
                this=0x7ffe60013330, thd=0x7ffe60000a98, mem_root=0x7ffe60006110, 
                file=0x7ffe600137f0, table_flags=264484092609758)
                at /home/bar/maria-git/server.10.3/sql/sql_table.cc:3228
            #8  0x0000000000828117 in mysql_prepare_create_table (thd=0x7ffe60000a98, 
                create_info=0x7ffff0c1e4e0, alter_info=0x7ffff0c1e3f0, 
                db_options=0x7ffff0c1cc04, file=0x7ffe600137f0, 
                key_info_buffer=0x7ffff0c1e2d0, key_count=0x7ffff0c1e2cc, 
                create_table_mode=0)
            

            bar Alexander Barkov added a comment - - edited In 10.2 the above script crashes on assert: mysqld: /home/bar/maria-git/server.10.3/sql/field.h:4346: void Column_definition::create_length_to_internal_length_string(): Assertion `length <= 0xFFFFFFFFL' failed.   Program received signal SIGABRT, Aborted. 0x00007ffff5e42a28 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55 55 return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig); with the following stack: #3 0x00007ffff5e3b2d2 in __GI___assert_fail ( assertion=0x12ff30c "length <= 0xFFFFFFFFL", file=0x12ff2e0 "/home/bar/maria-git/server.10.3/sql/field.h", line=4346, function=0x1301760 <Column_definition::create_length_to_internal_length_string()::__PRETTY_FUNCTION__> "void Column_definition::create_length_to_internal_length_string()") at assert.c:101 #4 0x000000000083cced in Column_definition::create_length_to_internal_length_string (this=0x7ffe60013330) at /home/bar/maria-git/server.10.3/sql/field.h:4346 #5 0x00000000008273f6 in Column_definition::prepare_stage1_string ( this=0x7ffe60013330, thd=0x7ffe60000a98, mem_root=0x7ffe60006110, file=0x7ffe600137f0, table_flags=264484092609758) at /home/bar/maria-git/server.10.3/sql/sql_table.cc:3186 #6 0x000000000093d36b in Type_handler_string_result::Column_definition_prepare_stage1 (this=0x1ee7fd8 <type_handler_blob>, thd=0x7ffe60000a98, mem_root=0x7ffe60006110, def=0x7ffe60013330, file=0x7ffe600137f0, table_flags=264484092609758) at /home/bar/maria-git/server.10.3/sql/sql_type.cc:1679 #7 0x00000000008275db in Column_definition::prepare_stage1 ( this=0x7ffe60013330, thd=0x7ffe60000a98, mem_root=0x7ffe60006110, file=0x7ffe600137f0, table_flags=264484092609758) at /home/bar/maria-git/server.10.3/sql/sql_table.cc:3228 #8 0x0000000000828117 in mysql_prepare_create_table (thd=0x7ffe60000a98, create_info=0x7ffff0c1e4e0, alter_info=0x7ffff0c1e3f0, db_options=0x7ffff0c1cc04, file=0x7ffe600137f0, key_info_buffer=0x7ffff0c1e2d0, key_count=0x7ffff0c1e2cc, create_table_mode=0)

            People

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.