Alter table add IDENTITY column cores sqlci at alterSeabaseTableAddColumn()
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:
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=0x00007ffff1
#
# 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.
#
# Core dump written. Default location: <mydir>/core or core.10930
#
# An error report file with more information is saved as:
# <mydir>
#
# If you would like to submit a bug report, please visit:
# http://
# 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/
#3 0x00007ffff72a0f87 in VMError:
from /opt/home/
#4 0x00007ffff712596f in JVM_handle_
from /opt/home/
#5 <signal handler called>
#6 origOpType (this=0x7ffffff
currCatName
at ../optimizer/
#7 CmpSeabaseDDL:
alterAddCol
currSchName
#8 0x00007ffff111460b in CmpSeabaseDDL:
this=
currCatName
at ../sqlcomp/
#9 0x00007ffff55c3c2f in CmpStatement:
statement=
#10 0x00007ffff55b4c25 in CmpContext:
data=
charset=15, op=CmpMessageOb
gen_
parentQid=
at ../arkcmp/
#11 0x00007ffff4b1a844 in ExDDLTcb::work (this=0x7fffe96
at ../executor/
#12 0x00007ffff4c52613 in ExScheduler::work (this=0x7fffe96
prevWaitTim
#13 0x00007ffff4b785c2 in ex_root_
cliGlobals=
diagsArea=
#14 0x00007ffff5fac844 in CliStatement:
cliGlobals=
diagsArea=
fixupOnly=0, cliflags=0) at ../cli/
#15 0x00007ffff5f5425c in SQLCLI_
statement_
num_
input_
#16 0x00007ffff5f54f92 in SQLCLI_
cliGlobals=
input_
num_
ptr_
#17 0x00007ffff5fbb27b in SQL_EXEC_Exec (statement_
input_
#18 0x00007ffff79cc81b in SqlCmd::doExec (sqlci_
prep_
unnamedPara
unnamedPara
at ../sqlci/
#19 0x00007ffff79cd212 in SqlCmd::do_execute (sqlci_
prep_
unnamedPara
#20 0x00007ffff79cd93d in DML::process (this=0x1f6b390, sqlci_env=0xb83990)
at ../sqlci/
#21 0x00007ffff79b37f4 in Obey::process (this=0x219fc10,
sqlci_
#22 0x00007ffff79bbfd4 in SqlciEnv::run (this=0xb83990,
in_
at ../sqlci/
#23 0x00000000004019c2 in main (argc=3, argv=0x7fffffff
at ../bin/
Changed in trafodion: | |
assignee: | nobody → Anoop Sharma (anoop-sharma) |
Changed in trafodion: | |
status: | New → In Progress |
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.