[comp.databases] Informix 4gl bug

jw@pan.UUCP (Jamie Watson) (08/31/88)

Given the following trivial 4gl program,

database bletch
main
  start report foo
    output to report foo (1)
  finish report foo
end main
report foo (bar)
  define
    bar integer
  order by bar
  format
    before group of bar
      print "Before ", bar
    on every row
      print "Every ", bar
    after group of bar
      print "After ", bar
end report

The output produced, believe it or not, is this:

     Before           1
     Every           1
     After           1
     After           0

Looks like about one too many calls to the 'after group of bar' routine to me.

The problem does not appear in any of these cases:

- Change the 'order by bar' to 'order external by bar'

- Get rid of the 'order by bar' statement

- Feed two values to the report.  It doesn't have to be two different values.

jw

aland@infmx.UUCP (Dr. Scump) (09/03/88)

In article <463@pan.UUCP>, jw@pan.UUCP (Jamie Watson) writes:
| 
| Given the following trivial 4gl program,
| 
| [program which sends exactly 1 row to a report and sorts it]
| 
| The output produced, believe it or not, is this:
|      Before           1
|      Every           1
|      After           1
|      After           0
| 
| The problem does not appear in any of these cases:
| - Change the 'order by bar' to 'order external by bar'
| - Get rid of the 'order by bar' statement
| - Feed two values to the report.  It doesn't have to be two different values.
| jw

This is a known problem (Problem #1668, for reference).  It happens
only under these exact circumstances (report on a single row, sort
in the report rather than the select, using AFTER GROUP OF control
blocks).  Such an AFTER block executes twice in this case.
It is scheduled to be fixed in the next 4GL release.

-- 
 Alan S. Denney  |  Informix Software, Inc.  |  {pyramid|uunet}!infmx!aland
 Disclaimer: These opinions are mine alone.  If I am caught or killed,
             the secretary will disavow any knowledge of my actions.
 Santos' 4th Law: "Anything worth fighting for is worth fighting *dirty* for"