You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "Alice Chen (JIRA)" <ji...@apache.org> on 2015/07/22 20:15:09 UTC
[jira] [Created] (TRAFODION-190) LP Bug: 1288991 - Alter table ...
drop column makes an empty table and select * crashes sqlci
Alice Chen created TRAFODION-190:
------------------------------------
Summary: LP Bug: 1288991 - Alter table ... drop column makes an empty table and select * crashes sqlci
Key: TRAFODION-190
URL: https://issues.apache.org/jira/browse/TRAFODION-190
Project: Apache Trafodion
Issue Type: Bug
Components: sql-exe
Reporter: Weishiun Tsai
Assignee: Anoop Sharma
Priority: Critical
Alter table … drop column should check if the column is the only column in the table before dropping it. Currently, it allows the user to alter the table to a complete empty table with no column in it at all. At that point, select * from this table would crash sqlci with a core.
This is seen on the datalake build trafodion-ci-project-datalake_64_1-20140303-v38027_release.tar. Here is the sequence of statements to reproduce this problem and the stack trace of the sqlci core.
-bash-4.1$ sqlci
Trafodion Conversational Interface 0.7.0
(c) Copyright 2014 Hewlett-Packard Development Company, LP.
>>create table t (a int);
--- SQL operation complete.
>>alter table t drop column a;
--- SQL operation complete.
>>showddl t;
CREATE TABLE TRAFODION.SEABASE.T
(
)
;
--- SQL operation complete.
>>select * from t;
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007ffff00f2fcd, pid=2494, tid=140737180245824
#
# JRE version: 7.0_09-b05
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23.5-b02 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [liboptimizer.so+0x3aefcd] bindRowValues(BindWA*, ItemExpr*, ValueIdList&, RelExpr*, int)+0x48d
#
# Core dump written. Default location: /opt/home/wtsai/dlv38027/sql/scripts/core or core.2494
#
# An error report file with more information is saved as:
# /opt/home/wtsai/dlv38027/sql/scripts/hs_err_pid2494.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)
(gdb) bt
#0 0x00000039e28328a5 in raise () from /lib64/libc.so.6
#1 0x00000039e2834085 in abort () from /lib64/libc.so.6
#2 0x00007ffff6d46455 in os::abort(bool) ()
from /opt/home/tools/jdk1.7.0_09_64/jre/lib/amd64/server/libjvm.so
#3 0x00007ffff6ea6717 in VMError::report_and_die() ()
from /opt/home/tools/jdk1.7.0_09_64/jre/lib/amd64/server/libjvm.so
#4 0x00007ffff6d49f60 in JVM_handle_linux_signal ()
from /opt/home/tools/jdk1.7.0_09_64/jre/lib/amd64/server/libjvm.so
#5 <signal handler called>
#6 0x00007ffff00f2fcd in bindRowValues (bindWA=0x7fffffff30a0,
exprTree=<value optimized out>, vidList=..., parent=<value optimized out>,
inTrueRoot=1) at ../optimizer/BindRelExpr.cpp:203
#7 0x00007ffff01001b2 in RelRoot::bindNode (this=0x7fff9a187c30,
bindWA=0x7fffffff30a0) at ../optimizer/BindRelExpr.cpp:5226
#8 0x00007ffff18f3044 in CmpMain::compile (this=0x7fffffff5190,
input_str=0x7fff9a1a82b8 "select * from t;", charset=15,
queryExpr=@0x7fffffff50c8, gen_code=0x7fff9a1a8670,
gen_code_len=0x7fff9a1a8668, heap=0x7fffe8fb8ac0, phase=CmpMain::END,
fragmentDir=0x7fffffff52e8, op=3004, useQueryCache=<value optimized out>,
cacheable=0x7fffffff50d8, begTime=0x7fffffff50b0, shouldLog=0)
at ../sqlcomp/CmpMain.cpp:1740
#9 0x00007ffff18f5aae in CmpMain::sqlcomp (this=0x7fffffff5190,
input_str=0x7fff9a1a82b8 "select * from t;", charset=15,
queryExpr=@0x7fffffff50c8, gen_code=0x7fff9a1a8670,
gen_code_len=0x7fff9a1a8668, heap=0x7fffe8fb8ac0, phase=CmpMain::END,
fragmentDir=0x7fffffff52e8, op=3004, useQueryCache=1,
cacheable=0x7fffffff50d8, begTime=0x7fffffff50b0, shouldLog=0)
at ../sqlcomp/CmpMain.cpp:1408
#10 0x00007ffff18f6b5c in CmpMain::sqlcomp (this=0x7fffffff5190, input=...,
gen_code=0x7fff9a1a8670, gen_code_len=0x7fff9a1a8668, heap=0x7fffe8fb8ac0,
phase=CmpMain::END, fragmentDir=0x7fffffff52e8, op=3004)
at ../sqlcomp/CmpMain.cpp:745
#11 0x00007fffef7b243f in CmpStatement::process (this=0x7fffe8423258,
sqltext=<value optimized out>) at ../arkcmp/CmpStatement.cpp:474
#12 0x00007fffef7a8202 in CmpContext::compileDirect (this=0x7fffe8423090,
data=0x7fffe8fc7e70 "\200", data_len=152, outHeap=0x7fffe9a2a648,
charset=15, op=CmpMessageObj::SQLTEXT_COMPILE, gen_code=@0x7fffffff56c0,
gen_code_len=@0x7fffffff56c8, parserFlags=0, diagsArea=0x7fffe8fc7f10)
at ../arkcmp/CmpContext.cpp:521
#13 0x00007ffff6116d87 in CliStatement::prepare2 (this=0x7fffe8fc63c8,
source=0x7fffe8fc6238 "select * from t;", diagsArea=...,
passed_gen_code=<value optimized out>,
passed_gen_code_len=<value optimized out>, charset=15, unpackTdbs=1,
cliFlags=129) at ../cli/Statement.cpp:1783
#14 0x00007ffff6117236 in CliStatement::prepare (this=0x7fffe8fc63c8,
source=0x7fffe8fc6238 "select * from t;", diagsArea=...,
passed_gen_code=<value optimized out>,
passed_gen_code_len=<value optimized out>, charset=<value optimized out>,
unpackTdbs=1, cliFlags=129) at ../cli/Statement.cpp:1374
#15 0x00007ffff60e382c in SQLCLI_Prepare2 (cliGlobals=0xba1040,
statement_id=0x13c52d0, sql_source=0x143dfa0, gencode_ptr=0x0,
gencode_len=0, ret_gencode_len=0x0, query_cost_info=0x7fffffff6c20,
query_comp_stats_info=0x7fffffff5990, uniqueStmtId=<value optimized out>,
uniqueStmtIdLen=0x7fffffff6cd8, flags=129) at ../cli/Cli.cpp:5940
#16 0x00007ffff6121a3e in SQL_EXEC_Prepare2 (statement_id=0x13c52d0,
sql_source=0x143dfa0, gencode_ptr=0x0, gencode_len=0, ret_gencode_len=0x0,
query_cost_info=0x7fffffff6c20, comp_stats_info=0x7fffffff5990,
uniqueStmtId=0x7fffffff6a90 " ", uniqueStmtIdLen=0x7fffffff6cd8,
flags=129) at ../cli/CliExtern.cpp:4849
#17 0x00007ffff7bd898f in SqlCmd::do_prepare (sqlci_env=0xb96f20,
prep_stmt=0x1932b40, sqlStmt=0x13c2f20 "select * from t;",
resetLastExecStmt=1, rsIndex=-38256, prepcode=0x7fffffff6dac,
statisticsType=0x7fffffff6da8) at ../sqlci/SqlCmd.cpp:879
#18 0x00007ffff7bd7de0 in DML::process (this=0xe56bd0, sqlci_env=0xb96f20)
at ../sqlci/SqlCmd.cpp:2781
#19 0x00007ffff7bc4cc6 in SqlciEnv::executeCommands (this=0xb96f20,
input_stmt=@0x7fffffff6f08) at ../sqlci/SqlciEnv.cpp:837
#20 0x00007ffff7bc6d6b in SqlciEnv::run (this=0xb96f20)
at ../sqlci/SqlciEnv.cpp:646
#21 0x0000000000401a76 in main (argc=1, argv=0x7fffffff70d8)
at ../bin/SqlciMain.cpp:303
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)