SPJ with result set failed with ERROR[4011] & ERROR[8804]

Bug #1355032 reported by Chong Hsu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Trafodion
Fix Committed
High
Pavani Puppala

Bug Description

Tested with Trafodion build, 20140801-0830.

Calling a SPJ with result set:

   public static void getobject(ResultSet[] paramArrayOfResultSet)
     throws Exception
   {
     String str1 = "jdbc:default:connection";
     String str2 = "select * from t1,t2";
     Connection localConnection = DriverManager.getConnection(str1);
     Statement localStatement = localConnection.createStatement();
     paramArrayOfResultSet[0] = localStatement.executeQuery(str2);
   }

it failed with ERROR[4011]:

*** ERROR[4011] Reference made to column TRAFODION.TESTSPJ.SP_RESULT_SET_1.A via star (*) is ambiguous. [2014-08-08 22:50:35]
*** ERROR[8912] The request to allocate a stored procedure result set failed. An unexpected internal error was encountered. [2014-08-08 22:50:35]

In the same session (from Trafci) after the error, any SPJ calls all failed with error:

*** ERROR[8804] The provided input statement does not exist in the current context. [2014-08-08 22:50:45]
*** ERROR[8804] The provided input statement does not exist in the current context. [2014-08-08 22:50:45]

The SPJ Jar and java file are attached. Here are the steps to produce the error:

set schema testspj;

create library spjrs file '/<Jar location>/Testrs.jar';

create procedure RS100()
       language java
       parameter style java
       external name 'Testrs.getobject'
       dynamic result sets 2
      library spjrs;

create table T1
  (
    A INT DEFAULT NULL
  , B INT DEFAULT NULL
  ) no partitions;

create table T2
  (
    A CHAR(10) CHARACTER SET ISO88591 COLLATE
      DEFAULT DEFAULT NULL
  , B CHAR(10) CHARACTER SET ISO88591 COLLATE
      DEFAULT DEFAULT NULL
  , C VARCHAR(10) CHARACTER SET ISO88591 COLLATE
      DEFAULT DEFAULT NULL
  ) no partitions;

call rs100();

*** ERROR[4011] Reference made to column TRAFODION.TESTSPJ.SP_RESULT_SET_1.A via star (*) is ambiguous. [2014-08-08 22:50:35]
*** ERROR[8912] The request to allocate a stored procedure result set failed. An unexpected internal error was encountered. [2014-08-08 22:50:35]

call rs100();

*** ERROR[8804] The provided input statement does not exist in the current context. [2014-08-08 22:50:45]
*** ERROR[8804] The provided input statement does not exist in the current context. [2014-08-08 22:50:45]

Tags: sql-exe
Revision history for this message
Chong Hsu (chong-hsu) wrote :
Revision history for this message
Chong Hsu (chong-hsu) wrote :
Changed in trafodion:
assignee: nobody → Pavani Puppala (pavani-puppala)
Changed in trafodion:
milestone: none → r0.9
Changed in trafodion:
milestone: r0.9 → r1.0
Revision history for this message
Pavani Puppala (pavani-puppala) wrote :

Problem is in binder as SPJ result set virtual table columns names were not renamed in table desc. Because of this when two tables were joined in an SPJ that have the same column names, they could not be resolved. Fixed the problem will checkin later as part of other SPJ fixes.

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