showddl does not work for SPJs

Bug #1350627 reported by Aruna Sadashiva
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Trafodion
Fix Committed
High
Cliff Gray

Bug Description

SHOWDDL fails for SPJs.

>>get procedures;

Procedures in Schema TRAFODION.T4QA
===================================

CALLABLESTATEMENTSAMPLE
RS349

--- SQL operation complete.
>>showddl rs349;

*** ERROR[1389] Object RS349 does not exist in Trafodion.

*** ERROR[4082] Object TRAFODION.T4QA.RS349 does not exist or is inaccessible.

--- SQL operation failed with errors.

Tags: sql-cmu
Changed in trafodion:
milestone: r0.9 → r1.0
Changed in trafodion:
assignee: Suresh Subbiah (suresh-subbiah) → Justin Du (justin-du-2)
Justin Du (justin-du-2)
Changed in trafodion:
status: New → In Progress
Revision history for this message
Justin Du (justin-du-2) wrote :
Download full text (4.8 KiB)

Looks that we do try to get stored procedure with type COM_BASE_TABLE_OBJECT. Should be using COM_STORED_PROCEDURE_OBJECT? We found that the object is in Seabase MD table, but we only check if it is base table, index table, or view in ComSeabaseDDL::getSeabaseUserTableDesc(). Or we should have code to deal with stored procedure?

Here is the stack when failed to find the stored procedure with correct name given:
(gdb) bt
#0 CmpSeabaseDDL::getSeabaseUserTableDesc (this=0x7ffffffebad0, catName=...,
    schName=..., objName=..., objType=COM_BASE_TABLE_OBJECT,
    includeInvalidDefs=0) at ../sqlcomp/CmpSeabaseDDLtable.cpp:6708
#1 0x00007ffff0a4d6b4 in CmpSeabaseDDL::getSeabaseTableDesc (
    this=0x7ffffffebad0, catName=..., schName=..., objName=...,
    objType=COM_BASE_TABLE_OBJECT, includeInvalidDefs=0)
    at ../sqlcomp/CmpSeabaseDDLtable.cpp:7437
#2 0x00007fffef095a97 in NATableDB::get (this=0x7fffe7ee46b8, corrName=...,
    bindWA=0x7ffffffec630, inTableDescStruct=0x0)
    at ../optimizer/NATable.cpp:8006
#3 0x00007fffeede2298 in BindWA::getNATable (this=0x7ffffffec630,
    corrName=..., catmanCollectTableUsages=1, inTableDescStruct=0x0)
    at ../optimizer/BindRelExpr.cpp:1445
#4 0x00007ffff09abc14 in CmpDescribeSeabaseTable (dtName=..., type=2,
    outbuf=@0x7fffd681e378, outbuflen=@0x7fffd681e370, heap=0x7fffe8a75c08,
    pkeyStr=0x0, withPartns=1, withoutSalt=0, withoutDivisioning=0,
    noTrailingSemi=0) at ../sqlcomp/CmpDescribe.cpp:2449
#5 0x00007ffff09a5f4b in CmpDescribe (query=0x7fffd681da68 "showddl rs363;",
    queryExpr=0x7fffd6806968, outbuf=@0x7fffd681e378,
    outbuflen=@0x7fffd681e370, heap=0x7fffe8a75c08)
    at ../sqlcomp/CmpDescribe.cpp:785
#6 0x00007ffff5486a4f in CmpStatement::process (this=0x7fffd67eb880,
    statement=...) at ../arkcmp/CmpStatement.cpp:998
#7 0x00007ffff547530e in CmpContext::compileDirect (this=0x7fffe7edf090,
    data=0x7fffd63b0710 "showddl rs363;", data_len=14, outHeap=0x7fffe94e5138,
    charset=15, op=CmpMessageObj::DESCRIBE, gen_code=@0x7fffe8a7a120,
    gen_code_len=@0x7fffe8a7a128, parserFlags=0, diagsArea=0x7fffd5f65cd0)
    at ../arkcmp/CmpContext.cpp:727
#8 0x00007ffff4847452 in ExDescribeTcb::work (this=0x7fffe8a79db8)
    at ../executor/ex_ddl.cpp:584
#9 0x00007ffff4863a67 in ex_tcb::sWork (tcb=0x7fffe8a79db8)
    at ../executor/ex_tcb.h:99
#10 0x00007ffff49cc22f in ExSubtask::work (this=0x7fffe8a7a7b0)
    at ../executor/ExScheduler.cpp:751
#11 0x00007ffff49cb5f2 in ExScheduler::work (this=0x7fffe8a79920,
    prevWaitTime=0) at ../executor/ExScheduler.cpp:328
#12 0x00007ffff48ba746 in ex_root_tcb::execute (this=0x7fffe8a7a830,
    cliGlobals=0xb847a0, glob=0x7fffd5eb2658, input_desc=0x7fffe8abfa38,
    diagsArea=@0x7fffffff1740, reExecute=0) at ../executor/ex_root.cpp:1055
#13 0x00007ffff5ef475a in CliStatement::execute (this=0x7fffe8a69bd0,
    cliGlobals=0xb847a0, input_desc=0x7fffe8abfa38, diagsArea=...,
    execute_state=CliStatement::INITIAL_STATE_, fixupOnly=0, cliflags=0)
    at ../cli/Statement.cpp:4812
#14 0x00007ffff5e7d37f in SQLCLI_PerformTasks(CliGlobals *, ULng32, SQLSTMT_ID *, SQLDESC_ID *, SQLDESC_ID *, Lng32, Lng32, typedef __va_list_tag __...

Read more...

Changed in trafodion:
milestone: r1.0 → r1.1
Revision history for this message
Justin Du (justin-du-2) wrote :

Per conversation with Roberta, assign this to Cliff.

This feature is no longer needed by any POC now, so it could be moved to R1.2 if it needs more time to fix.

Changed in trafodion:
assignee: Justin Du (justin-du-2) → Cliff Gray (cliff-gray)
Cliff Gray (cliff-gray)
Changed in trafodion:
milestone: r1.1 → none
Cliff Gray (cliff-gray)
Changed in trafodion:
milestone: none → r1.2
tags: added: sql-cmu
removed: sql-general
Revision history for this message
Cliff Gray (cliff-gray) wrote :

Reported problems now fixed.

Changed in trafodion:
status: In Progress → Fix Committed
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.