Project

General

Profile

Bug #2052

conversion error resolving master temp-table buffer

Added by Eric Faulhaber about 11 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Start date:
02/25/2013
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
case_num:

ecf_upd20130225b.zip (1.53 KB) Eric Faulhaber, 02/25/2013 03:40 PM

ecf_upd20130225c.zip (3.86 KB) Eric Faulhaber, 02/25/2013 04:51 PM

History

#1 Updated by Eric Faulhaber about 11 years ago

The error occurs because there is an expectation of a DEFINE TEMP-TABLE xyz statement appearing earlier in the AST than a DEFINE BUFFER b-xyz FOR xyz. However, in this case, the AST seems to have been restructured, such that line 5075 (where DEFINE BUFFER is) comes immediately after line 2189:

    <ast col="0" hidden="true" id="57432302686637" line="0" text="procedure" type="PROCEDURE">
      <annotation datatype="java.lang.String" key="javaname" value="displayLinks"/>
      <annotation datatype="java.lang.String" key="name" value="displayLinks"/>
      <annotation datatype="java.lang.Long" key="numparms" value="0"/>
      <ast col="1" id="57432302686638" line="2189" text="PROCEDURE" type="KW_PROC">
        <ast col="11" id="57432302686641" line="2189" text="displayLinks" type="SYMBOL"/>
        <ast col="24" id="57432302686644" line="2189" text="IN" type="KW_IN">
          <ast col="27" id="57432302686646" line="2189" text="SUPER" type="KW_SUPER"/>
        </ast>
      </ast>
      <ast col="0" id="57432302686648" line="0" text="block" type="BLOCK">
        <annotation datatype="java.lang.Boolean" key="recordscoping" value="true"/>
        <ast col="0" id="57432302698730" line="0" text="statement" type="STATEMENT">
          <ast col="1" id="57432302698731" line="5075" text="DEFINE" type="DEFINE_BUFFER">
            <ast col="15" id="57432302698734" line="5075" text="BAltRowObject" type="SYMBOL">
              <annotation datatype="java.lang.String" key="bufname" value="baltrowobject"/>
            </ast>
            <ast col="29" id="57432302698737" line="5075" text="FOR" type="KW_FOR">
              <ast col="33" id="57432302698739" line="5075" text="RowObject" type="TEMP_TABLE">
                <annotation datatype="java.lang.String" key="schemaname" value="rowobject"/>
                <annotation datatype="java.lang.String" key="bufname" value="baltrowobject"/>
                <annotation datatype="java.lang.String" key="dbname" value=""/>
                <annotation datatype="java.lang.Long" key="recordtype" value="14"/>
                <annotation datatype="java.lang.String" key="classname" value="TempRecord3"/>
                <annotation datatype="java.lang.String" key="bufclassname" value="TempRecord3.Buf"/>
                <annotation datatype="java.lang.String" key="pkgname" value="com.something.server.dmo._temp"/>
                <annotation datatype="java.lang.String" key="javaname" value="baltrowobject"/>
                <annotation datatype="java.lang.Long" key="bufreftype" value="18"/>
                <annotation datatype="java.lang.String" key="uniquename" value="baltrowobject_rowobject"/>
              </ast>
            </ast>
          </ast>
        </ast>
      </ast>
    </ast>

The DEFINE TEMP-TABLE statement comes after line 2189 in the cache file, so it is not yet available for the lookup we're trying to do for the DEFINE BUFFER.

Any idea why the AST was restructured this way?

LE: GES removed a customer-specific package path from this entry.

#2 Updated by Constantin Asofiei about 11 years ago

I think this is related to annotations/record_scoping_post.rules H008.

#3 Updated by Eric Faulhaber about 11 years ago

OK, I'll try postponing the DEFINE BUFFER lookups until all the DEFINE TEMP-TABLE statements in a file have been visited.

#4 Updated by Constantin Asofiei about 11 years ago

This testcase is related to this issue:

procedure proc0:
   def buffer per for book.
   def buffer bb for per.
   def buffer cc for bb.
   def buffer dd for bb.
end.

The buffers get reordered, but no proper order is maintained.

OK, I'll try postponing the DEFINE BUFFER lookups until all the DEFINE TEMP-TABLE statements in a file have been visited.

I don't think DEFINE TEMP-TABLE is at fault, as this can not be used inside a procedure.

#5 Updated by Eric Faulhaber about 11 years ago

Constantin Asofiei wrote:

This testcase is related to this issue:
[...]

The buffers get reordered, but no proper order is maintained.

OK, I'll try postponing the DEFINE BUFFER lookups until all the DEFINE TEMP-TABLE statements in a file have been visited.

I don't think DEFINE TEMP-TABLE is at fault, as this can not be used inside a procedure.

Thanks for the test case. Yes, that seems to be a different problem (using permanent table instead of temp-table). I'm going to open a separate issue for that.

The attached update gets us past the original problem. I'm going to put it through conversion regression testing, but here it is in case someone needs it in the meantime...

#6 Updated by Eric Faulhaber about 11 years ago

Turns out the previous update fixed the symptom rather than the root cause. Turns out we were not handling empty internal procedures, functions, triggers properly when moving buffer definitions around in record_scoping_post.rules. Newer fix is attached, currently in conversion regression testing.

#7 Updated by Eric Faulhaber about 11 years ago

This update has passed conversion regression testing and is checked into bzr revision 10205.

#8 Updated by Eric Faulhaber about 11 years ago

  • Status changed from WIP to Closed
  • % Done changed from 0 to 100

#9 Updated by Greg Shah over 7 years ago

  • Target version changed from Milestone 4 to Conversion Support for Server Features

Also available in: Atom PDF