Riverside-Software / pct

Build automation for OpenEdge ABL
Apache License 2.0
96 stars 62 forks source link

"** Index value is too long. (141)" in the .CRC file #47

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. a bit hard to reproduce, we have a few procedures with lots of parameters. 
The xref in OE11 has a long "procedure" line for that procedure definition. 
This was truncated in the past (prior versions of OpenEdge). I located and 
fixed the issue, see the additional info section below.

What is the expected output? What do you see instead?
- I expect a proper crc file, listing the db table referenced along with their 
CRC number, instead I get a line with the "** Index value is too long. (141)" 
string

What version of the product are you using? On what operating system?
PCT-184, OE 11.3. This works fine with OE 10.1C, haven't tried any othet 
version.

Please provide any additional information below.

I located the issue in the code which reads the xref file in both 
pctBgCompile.p and pctCompile.p, namely the IMPORT STREAM sXREF ttXref. 
statement.

If the line has more than 2000 characters, OE does not move on the next line, 
but keeps reading this line. You read the file in 2 streams here and expect the 
reads to be in sync. The moment you hit a line > 2000 characters the 2 streams 
go out of sync, sXREF2 moves on, however sXREF reads the rest of the long line, 
from characters 2001 onwards. This makes the subsequent logic fail as the 2 
streams are expected to be in sync...

There are probably different ways to fix this, what I did was add the following 
        IF LENGTH (cTmp) > 2000 THEN
          IMPORT STREAM sXREF UNFORMATTED cTmp2.
immediately after 
        /* Sorry, this is crude... */
        IMPORT STREAM sXREF2 UNFORMATTED cTmp.

So my code now looks like this
    REPEAT:
        CREATE ttXref.
        IMPORT STREAM sXREF ttXref.

        /* Sorry, this is crude... */
        IMPORT STREAM sXREF2 UNFORMATTED cTmp.

        IF LENGTH (cTmp) > 2000 THEN
          IMPORT STREAM sXREF UNFORMATTED cTmp2.

        ASSIGN cTmp2 = ttXref.xLineNumber + ' ' + ttXref.xRefType + ' '.
        ...

This basically means once we hit a line > 2000 chars we read the rest of the 
line in cTmp2, just so the stream moves on the next line in the next iteration.

Cheers,
Simi

Original issue reported on code.google.com by legi...@gmail.com on 19 Jan 2014 at 11:28

GoogleCodeExporter commented 9 years ago
I've created the following procedure, and compiled it against sports2000. No 
problem in 11.3.1 / Win64. Could you confirm if you have the same behavior ?

Gilles

PROCEDURE lotsOfParameter.
  def input param ipThisIsAVeryLongParameterName01 as int no-undo.
  def input param ipThisIsAVeryLongParameterName02 as int no-undo.
  def input param ipThisIsAVeryLongParameterName03 as int no-undo.
  def input param ipThisIsAVeryLongParameterName04 as int no-undo.
  def input param ipThisIsAVeryLongParameterName05 as int no-undo.
  def input param ipThisIsAVeryLongParameterName06 as int no-undo.
  def input param ipThisIsAVeryLongParameterName07 as int no-undo.
  def input param ipThisIsAVeryLongParameterName08 as int no-undo.
  def input param ipThisIsAVeryLongParameterName09 as int no-undo.
  def input param ipThisIsAVeryLongParameterName10 as int no-undo.
  def input param ipThisIsAVeryLongParameterName11 as int no-undo.
  def input param ipThisIsAVeryLongParameterName12 as int no-undo.
  def input param ipThisIsAVeryLongParameterName13 as int no-undo.
  def input param ipThisIsAVeryLongParameterName14 as int no-undo.
  def input param ipThisIsAVeryLongParameterName15 as int no-undo.
  def input param ipThisIsAVeryLongParameterName16 as int no-undo.
  def input param ipThisIsAVeryLongParameterName17 as int no-undo.
  def input param ipThisIsAVeryLongParameterName18 as int no-undo.
  def input param ipThisIsAVeryLongParameterName19 as int no-undo.
  def input param ipThisIsAVeryLongParameterName20 as int no-undo.
  def input param ipThisIsAVeryLongParameterName21 as int no-undo.
  def input param ipThisIsAVeryLongParameterName22 as int no-undo.
  def input param ipThisIsAVeryLongParameterName23 as int no-undo.
  def input param ipThisIsAVeryLongParameterName24 as int no-undo.
  def input param ipThisIsAVeryLongParameterName25 as int no-undo.
  def input param ipThisIsAVeryLongParameterName26 as int no-undo.
  def input param ipThisIsAVeryLongParameterName27 as int no-undo.
  def input param ipThisIsAVeryLongParameterName28 as int no-undo.
  def input param ipThisIsAVeryLongParameterName29 as int no-undo.
  def input param ipThisIsAVeryLongParameterName30 as int no-undo.
  def input param ipThisIsAVeryLongParameterName31 as int no-undo.
  def input param ipThisIsAVeryLongParameterName32 as int no-undo.
  def input param ipThisIsAVeryLongParameterName33 as int no-undo.
  def input param ipThisIsAVeryLongParameterName34 as int no-undo.
  def input param ipThisIsAVeryLongParameterName35 as int no-undo.
  def input param ipThisIsAVeryLongParameterName36 as int no-undo.
  def input param ipThisIsAVeryLongParameterName37 as int no-undo.
  def input param ipThisIsAVeryLongParameterName38 as int no-undo.
  def input param ipThisIsAVeryLongParameterName39 as int no-undo.
  def input param ipThisIsAVeryLongParameterName40 as int no-undo.
  def input param ipThisIsAVeryLongParameterName41 as int no-undo.
  def input param ipThisIsAVeryLongParameterName42 as int no-undo.
  def input param ipThisIsAVeryLongParameterName43 as int no-undo.
  def input param ipThisIsAVeryLongParameterName44 as int no-undo.
  def input param ipThisIsAVeryLongParameterName45 as int no-undo.
  def input param ipThisIsAVeryLongParameterName46 as int no-undo.
  def input param ipThisIsAVeryLongParameterName47 as int no-undo.
  def input param ipThisIsAVeryLongParameterName48 as int no-undo.
  def input param ipThisIsAVeryLongParameterName49 as int no-undo.
  def input param ipThisIsAVeryLongParameterName50 as int no-undo.

  create item.

END PROCEDURE.

Original comment by g.quer...@gmail.com on 21 Jan 2014 at 9:37

GoogleCodeExporter commented 9 years ago
Hi Gilles,

I did say it is a bit tricky to replicate :) I did something similar before and 
didn't work, that's why I didn't attach a program with my issue.

Spent a bit more time on this today and figured out how to replicate.

See, you need an xref which has that long procedure line *before* other 
"interesting" xref lines (as in table references) so the code that processes 
the xref file still has work to do.

Your program worked fine for me as in the xref file the long procedure line is 
towards the end. However if create 2 similar internal procedures instead of one 
the error shows. See the attached files.

Cheers,
Simi

Original comment by legi...@gmail.com on 21 Jan 2014 at 9:20

Attachments:

GoogleCodeExporter commented 9 years ago
Reproduced with your test case, and your fix seems to work. But I'm interested 
in why there's a limit of 2000 characters when importing in a TT. Do you have 
any reference to that in the KB or documentation ?

Original comment by g.quer...@gmail.com on 26 Jan 2014 at 9:01

GoogleCodeExporter commented 9 years ago
Hi Gilles,

I could not find any reference to the 2k limit for the import. I tried to 
"force" things declaring the TT with a large format for a character field, but 
to no avail. Seems like a built in limit, Progress do like round numbers.

Cheers,
Simi

Original comment by legi...@gmail.com on 28 Jan 2014 at 9:04

GoogleCodeExporter commented 9 years ago
Integrated in dev branch, thanks for your fix !

Original comment by g.quer...@gmail.com on 16 Feb 2014 at 3:15