Uploaded image for project: 'Apache Trafodion'
  1. Apache Trafodion
  2. TRAFODION-1596

LOB: Insert after alter table adding LOB column crashes sqlci

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.2-incubating
    • Fix Version/s: None
    • Component/s: sql-exe
    • Labels:
      None

      Description

      After using alter table to add a LOB column to an existing table, an insert statement to insert values into the new table would always crash sqlci at HbaseInsert::preCodeGen(), as shown in the following execution output:

      ----------------------------------------------------------------------

      Here is the execution output:

      >>control query default TRAF_BLOB_AS_VARCHAR 'OFF';

      — SQL operation complete.
      >>control query default TRAF_CLOB_AS_VARCHAR 'OFF';

      — SQL operation complete.
      >>
      >>create schema mytest12;

      — SQL operation complete.
      >>set schema mytest12;

      — SQL operation complete.
      >>
      >>create table t (c1 int);

      — SQL operation complete.
      >>alter table t add column c2 blob;

      — SQL operation complete.
      >>insert into table t values (1, stringtolob('column 1'));
      #

      1. A fatal error has been detected by the Java Runtime Environment:
        #
      2. SIGSEGV (0xb) at pc=0x0000003889b3372f, pid=17906, tid=140737178997440
        #
      3. JRE version: OpenJDK Runtime Environment (7.0_85-b01) (build 1.7.0_85-mockbuild_2015_07_25_13_10-b00)
      4. Java VM: OpenJDK 64-Bit Server VM (24.85-b03 mixed mode linux-amd64 compressed oops)
      5. Derivative: IcedTea 2.6.1
      6. Distribution: CentOS release 6.6 (Final), package rhel-2.6.1.3.el6_7-x86_64 u85-b01
      7. Problematic frame:
      8. C [libc.so.6+0x13372f]
        #
      9. Core dump written. Default location: /mnt/wtsai/bugs/lob_addcol/core or core.17906 (max size 1000000 kB). To ensure a full core dump, try "ulimit -c unlimited" before starting Java again
        #
      10. An error report file with more information is saved as:
      11. /tmp/jvm-17906/hs_error.log
        #
      12. If you would like to submit a bug report, please include
      13. instructions on how to reproduce the bug and visit:
      14. http://icedtea.classpath.org/bugzilla [^]
      15. The crash happened outside the Java Virtual Machine in native code.
      16. See problematic frame for where to report the bug.
        #
        Aborted (core dumped)

      Here is the back trace of the sqlci core:

      (gdb) bt
      #0 0x0000003889a32625 in raise () from /lib64/libc.so.6
      0000001 0x0000003889a33d8d in abort () from /lib64/libc.so.6
      0000002 0x00007ffff7148585 in ?? ()
      from /usr/lib/jvm/java-1.7.0-openjdk.x86_64/jre/lib/amd64/server/libjvm.so
      0000003 0x00007ffff72bbb9f in ?? ()
      from /usr/lib/jvm/java-1.7.0-openjdk.x86_64/jre/lib/amd64/server/libjvm.so
      0000004 0x00007ffff714d122 in JVM_handle_linux_signal ()
      from /usr/lib/jvm/java-1.7.0-openjdk.x86_64/jre/lib/amd64/server/libjvm.so
      0000005 <signal handler called>
      0000006 0x0000003889b3372f in __strlen_sse42 () from /lib64/libc.so.6
      0000007 0x00007ffff5bd106a in length (this=<value optimized out>, cs=0x0)
      at /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/char_traits.h:263
      0000008 assign (this=<value optimized out>, cs=0x0) at ../export/FBString.h:1598
      0000009 operator= (this=<value optimized out>, cs=0x0) at ../export/FBString.h:1310
      0000010 NAString::operator= (this=<value optimized out>, cs=0x0)
      at ../export/NAStringDef.cpp:141
      0000011 0x00007fffeecacdbe in HbaseInsert::preCodeGen (this=0x7fffd755ebf0,
      generator=0x7ffffffed6e0, externalInputs=<value optimized out>,
      pulledNewInputs=<value optimized out>) at ../generator/GenPreCode.cpp:5460
      0000012 0x00007fffeeca9d38 in RelRoot::preCodeGen (this=0x7fffd755dc48,
      generator=0x7ffffffed6e0, pulledNewInputs=...)
      at ../generator/GenPreCode.cpp:1984
      0000013 0x00007fffeec2f71f in Generator::preGenCode (this=0x7ffffffed6e0,
      expr_node=0x7fffd755dc48) at ../generator/Generator.cpp:542
      0000014 0x00007ffff0d17866 in CmpMain::compile (this=0x7fffffff0e20,
      input_str=0x7fffe82db4a8 "insert into table t values (1, stringtolob('column 1'));", charset=15, queryExpr=@0x7fffffff0d58, gen_code=0x7fffd7579e10,
      gen_code_len=0x7fffd7579e08, heap=0x7fffe8e71c00, phase=CmpMain::END,
      fragmentDir=0x7fffffff0f78, op=3004, useQueryCache=1,
      cacheable=0x7fffffff0d68, begTime=0x7fffffff0d40, shouldLog=0)
      at ../sqlcomp/CmpMain.cpp:2331
      0000015 0x00007ffff0d193bc in CmpMain::sqlcomp (this=0x7fffffff0e20,
      input_str=0x7fffe82db4a8 "insert into table t values (1, stringtolob('column 1'));", charset=15, queryExpr=@0x7fffffff0d58, gen_code=0x7fffd7579e10,
      gen_code_len=0x7fffd7579e08, heap=0x7fffe8e71c00, phase=CmpMain::END,
      fragmentDir=0x7fffffff0f78, op=3004, useQueryCache=1,
      cacheable=0x7fffffff0d68, begTime=0x7fffffff0d40, shouldLog=0)
      at ../sqlcomp/CmpMain.cpp:1684
      0000016 0x00007ffff0d1a6c8 in CmpMain::sqlcomp (this=0x7fffffff0e20, input=...,
      gen_code=0x7fffd7579e10, gen_code_len=0x7fffd7579e08, heap=0x7fffe8e71c00,
      phase=CmpMain::END, fragmentDir=0x7fffffff0f78, op=3004)
      at ../sqlcomp/CmpMain.cpp:819
      0000017 0x00007ffff5494a18 in CmpStatement::process (this=0x7fffd7555aa0,
      sqltext=<value optimized out>) at ../arkcmp/CmpStatement.cpp:499
      0000018 0x00007ffff54875b2 in CmpContext::compileDirect (this=0x7fffe82db090,
      data=0x7fffe8e9c6b8 "\200", data_len=192, outHeap=0x7fffe98e4128,
      charset=15, op=CmpMessageObj::SQLTEXT_COMPILE, gen_code=@0x7fffffff1500,
      gen_code_len=@0x7fffffff1508, parserFlags=0, parentQid=0x0,
      parentQidLen=0, diagsArea=0x7fffe8e9c780) at ../arkcmp/CmpContext.cpp:841
      0000019 0x00007ffff5e7eba8 in CliStatement::prepare2 (this=0x7fffe8e734c8,
      source=0x7fffe8e901a8 "insert into table t values (1, stringtolob('column 1'));", diagsArea=..., passed_gen_code=<value optimized out>,
      passed_gen_code_len=3918414120, charset=15, unpackTdbs=1, cliFlags=129)
      at ../cli/Statement.cpp:1775
      0000020 0x00007ffff5e2fad4 in SQLCLI_Prepare2 (cliGlobals=0xba04f0,
      statement_id=0x22529b0, sql_source=0x2338f10, gencode_ptr=0x0,
      gencode_len=0, ret_gencode_len=0x0, query_cost_info=0x7fffffff2a10,
      query_comp_stats_info=0x7fffffff1780, uniqueStmtId=<value optimized out>,
      uniqueStmtIdLen=0x7fffffff2ac8, flags=129) at ../cli/Cli.cpp:5927
      0000021 0x00007ffff5e8b8ce in SQL_EXEC_Prepare2 (statement_id=0x22529b0,
      sql_source=0x2338f10, gencode_ptr=0x0, gencode_len=0, ret_gencode_len=0x0,
      query_cost_info=0x7fffffff2a10, comp_stats_info=0x7fffffff1780,
      uniqueStmtId=0x7fffffff2880 " ", uniqueStmtIdLen=0x7fffffff2ac8,
      flags=129) at ../cli/CliExtern.cpp:5034
      0000022 0x00007ffff79ce413 in SqlCmd::do_prepare (sqlci_env=0xb88f10,
      prep_stmt=0x2b944c0,
      sqlStmt=0x2338820 "insert into table t values (1, stringtolob('column 1'));", resetLastExecStmt=1, rsIndex=-55168, prepcode=0x7fffffff2b9c,
      statisticsType=0x7fffffff2b98) at ../sqlci/SqlCmd.cpp:995
      0000023 0x00007ffff79cd800 in DML::process (this=0x1b5d280, sqlci_env=0xb88f10)
      at ../sqlci/SqlCmd.cpp:2883
      0000024 0x00007ffff79b3854 in Obey::process (this=0x2287580,
      sqlci_env=<value optimized out>) at ../sqlci/Obey.cpp:267
      0000025 0x00007ffff79bc084 in SqlciEnv::run (this=0xb88f10,
      in_filename=<value optimized out>, input_string=<value optimized out>)
      at ../sqlci/SqlciEnv.cpp:729
      0000026 0x00000000004019d2 in main (argc=3, argv=0x7fffffff2e68)
      at ../bin/SqlciMain.cpp:329

      Here is the entire script to reproduce this problem:

      log mytest.log clear;

      control query default TRAF_BLOB_AS_VARCHAR 'OFF';
      control query default TRAF_CLOB_AS_VARCHAR 'OFF';

      create schema mytest12;
      set schema mytest12;

      create table t (c1 int);
      alter table t add column c2 blob;
      insert into table t values (1, stringtolob('column 1'));
      drop table t cascade;

      drop schema mytest12 cascade;

        Attachments

          Activity

            People

            • Assignee:
              sandhya Sandhya Sundaresan
              Reporter:
              sandhya Sandhya Sundaresan
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: