Alter table add IDENTITY column cores sqlci at alterSeabaseTableAddColumn()

Bug #1448261 reported by Weishiun Tsai
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Trafodion
Fix Released
High
Anoop Sharma

Bug Description

Use the alter table statement to add an IDENTITY column is not supported (even in the old days). But it should return an error more gracefully. It currently cores sqlci at CmpSeabaseDDL::alterSeabaseTableAddColumn ().

This is seen on the v1.1.0rc2 (v0422) build.

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

Here is the entire script to reproduce it:

create schema mytest;
set schema mytest;

create table t (c2 int, c3 smallint);
alter table t add column c1 largeint GENERATED ALWAYS AS IDENTITY;

drop schema mytest;

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

Here is the execution output:

>>create schema mytest;

--- SQL operation complete.
>>set schema mytest;

--- SQL operation complete.
>>
>>create table t (c2 int, c3 smallint);

--- SQL operation complete.
>>alter table t add column c1 largeint GENERATED ALWAYS AS IDENTITY;
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007ffff1177b3b, pid=10930, tid=140737187609632
#
# JRE version: Java(TM) SE Runtime Environment (7.0_67-b01) (build 1.7.0_67-b01)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.65-b04 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libsqlcomp.so+0x14db3b] CmpSeabaseDDL::alterSeabaseTableAddColumn(StmtDDLAlterTableAddColumn*, NAString&, NAString&)+0xb3b
#
# Core dump written. Default location: <mydir>/core or core.10930
#
# An error report file with more information is saved as:
# <mydir>/hs_err_pid10930.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Aborted (core dumped)

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

Here is the stack trace of the core.

(gdb) bt
#0 0x00000039e28328a5 in raise () from /lib64/libc.so.6
#1 0x00000039e283400d in abort () from /lib64/libc.so.6
#2 0x00007ffff7120a55 in os::abort(bool) ()
   from /opt/home/tools/jdk1.7.0_67/jre/lib/amd64/server/libjvm.so
#3 0x00007ffff72a0f87 in VMError::report_and_die() ()
   from /opt/home/tools/jdk1.7.0_67/jre/lib/amd64/server/libjvm.so
#4 0x00007ffff712596f in JVM_handle_linux_signal ()
   from /opt/home/tools/jdk1.7.0_67/jre/lib/amd64/server/libjvm.so
#5 <signal handler called>
#6 origOpType (this=0x7ffffffefab0, alterAddColNode=0x7fffd97e2c80,
    currCatName=<value optimized out>, currSchName=...)
    at ../optimizer/ItemExpr.h:423
#7 CmpSeabaseDDL::alterSeabaseTableAddColumn (this=0x7ffffffefab0,
    alterAddColNode=0x7fffd97e2c80, currCatName=<value optimized out>,
    currSchName=...) at ../sqlcomp/CmpSeabaseDDLtable.cpp:3821
#8 0x00007ffff111460b in CmpSeabaseDDL::executeSeabaseDDL (
    this=0x7ffffffefab0, ddlExpr=0x7fffd97a1c10, ddlNode=0x7fffd97e2c80,
    currCatName=..., currSchName=..., dws=0x0)
    at ../sqlcomp/CmpSeabaseDDLcommon.cpp:7364
#9 0x00007ffff55c3c2f in CmpStatement::process (this=<value optimized out>,
    statement=<value optimized out>) at ../arkcmp/CmpStatement.cpp:933
#10 0x00007ffff55b4c25 in CmpContext::compileDirect (this=0x7fffe8b17090,
    data=0x7fffe96e45f0 "\200", data_len=224, outHeap=0x7fffea11d128,
    charset=15, op=CmpMessageObj::PROCESSDDL, gen_code=@0x7fffffff04b0,
    gen_code_len=@0x7fffffff04bc, parserFlags=0,
    parentQid=0x7fffe96e4440 "MXID11000010930212296660155641155000000000206U3333300_100___SQLCI_DML_LAST__", parentQidLen=76, diagsArea=0x7fffe96e46d8)
    at ../arkcmp/CmpContext.cpp:840
#11 0x00007ffff4b1a844 in ExDDLTcb::work (this=0x7fffe96c00d8)
    at ../executor/ex_ddl.cpp:278
#12 0x00007ffff4c52613 in ExScheduler::work (this=0x7fffe96bfc40,
    prevWaitTime=<value optimized out>) at ../executor/ExScheduler.cpp:328
#13 0x00007ffff4b785c2 in ex_root_tcb::execute (this=0x7fffe96c1050,
    cliGlobals=0xb84be0, glob=0x7fffe96e3fb8, input_desc=0x7fffe96e90c8,
    diagsArea=@0x7fffffff1be0, reExecute=0) at ../executor/ex_root.cpp:1055
#14 0x00007ffff5fac844 in CliStatement::execute (this=0x7fffe96aedb8,
    cliGlobals=0xb84be0, input_desc=0x7fffe96e90c8,
    diagsArea=<value optimized out>, execute_state=<value optimized out>,
    fixupOnly=0, cliflags=0) at ../cli/Statement.cpp:4558
#15 0x00007ffff5f5425c in SQLCLI_PerformTasks(CliGlobals *, ULng32, SQLSTMT_ID *, SQLDESC_ID *, SQLDESC_ID *, Lng32, Lng32, typedef __va_list_tag __va_list_tag *, SQLCLI_PTR_PAIRS *, SQLCLI_PTR_PAIRS *) (cliGlobals=0xb84be0, tasks=4882,
    statement_id=0x219acb0, input_descriptor=0x1f666d0, output_descriptor=0x0,
    num_input_ptr_pairs=0, num_output_ptr_pairs=0, ap=0x7fffffff1d80,
    input_ptr_pairs=0x0, output_ptr_pairs=0x0) at ../cli/Cli.cpp:3285
#16 0x00007ffff5f54f92 in SQLCLI_Exec(CliGlobals *, SQLSTMT_ID *, SQLDESC_ID *, Lng32, typedef __va_list_tag __va_list_tag *, SQLCLI_PTR_PAIRS *) (
    cliGlobals=<value optimized out>, statement_id=<value optimized out>,
    input_descriptor=<value optimized out>,
    num_ptr_pairs=<value optimized out>, ap=<value optimized out>,
    ptr_pairs=<value optimized out>) at ../cli/Cli.cpp:3532
#17 0x00007ffff5fbb27b in SQL_EXEC_Exec (statement_id=0x219acb0,
    input_descriptor=0x1f666d0, num_ptr_pairs=0) at ../cli/CliExtern.cpp:2071
#18 0x00007ffff79cc81b in SqlCmd::doExec (sqlci_env=0xb83990, stmt=0x219acb0,
    prep_stmt=<value optimized out>, numUnnamedParams=<value optimized out>,
    unnamedParamArray=<value optimized out>,
    unnamedParamCharSetArray=<value optimized out>, handleError=1)
    at ../sqlci/SqlCmd.cpp:1780
#19 0x00007ffff79cd212 in SqlCmd::do_execute (sqlci_env=0xb83990,
    prep_stmt=0x21a14c0, numUnnamedParams=0, unnamedParamArray=0x0,
    unnamedParamCharSetArray=0x0, prepcode=0) at ../sqlci/SqlCmd.cpp:2116
#20 0x00007ffff79cd93d in DML::process (this=0x1f6b390, sqlci_env=0xb83990)
    at ../sqlci/SqlCmd.cpp:2890
#21 0x00007ffff79b37f4 in Obey::process (this=0x219fc10,
    sqlci_env=<value optimized out>) at ../sqlci/Obey.cpp:264
#22 0x00007ffff79bbfd4 in SqlciEnv::run (this=0xb83990,
    in_filename=<value optimized out>, input_string=<value optimized out>)
    at ../sqlci/SqlciEnv.cpp:726
#23 0x00000000004019c2 in main (argc=3, argv=0x7fffffff38e8)
    at ../bin/SqlciMain.cpp:326

Tags: sql-exe
Changed in trafodion:
assignee: nobody → Anoop Sharma (anoop-sharma)
Changed in trafodion:
status: New → In Progress
Revision history for this message
Weishiun Tsai (wei-shiun-tsai) wrote :

Verified on the v0519 build installed on a cluster. This problem is now fixed:

>>create schema mytest;

--- SQL operation complete.
>>set schema mytest;

--- SQL operation complete.
>>
>>create table t (c2 int, c3 smallint);

--- SQL operation complete.
>>alter table t add column c1 largeint GENERATED ALWAYS AS IDENTITY;

*** ERROR[1514] Cannot add an IDENTITY column using ALTER TABLE command.

--- SQL operation failed with errors.
>>
>>drop schema mytest cascade;

--- SQL operation complete.

Changed in trafodion:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.