Menu

Commit [r13095]  Maximize  Restore  History

C# back end: make ORDER BY reports compile

The ordered report path was almost complete - it creates the temp table,
prepares the insert, re-reads with an ORDER BY and replays the rows, matching
what A4GL_make_report_table and its siblings do in the C runtime, down to the
c0, c1 column naming. Three naming faults stopped any of it compiling:

- the reread cursor was used and never declared. Ordinary cursors become
class members when their DECLARE is compiled; this one is invented for the
reread and has no DECLARE, so it needs a local.
- the prepared statement was referenced without the Statement_ prefix that
print_prepare_cmd gives it.
- both, and a statement-level CALL ... RETURNING, need the module prefix
inside a report, which is emitted as a nested class. The expression form of
a call already had it; the statement form did not.

A4GL_cs_module_prefix exports that prefix for compile_cs_sql.c, which generates
the report body and cannot see the static function in compile_cs.c.

A report with an ORDER BY now compiles. Whether its rows come back sorted has
not been shown - that needs a database behind it.

mikeaubury 2026-09-06

changed /aubit4glsrc/trunk/lib/liblex/lex_cs/a4gl_lib_lex_fgl_int.h
changed /aubit4glsrc/trunk/lib/liblex/lex_cs/compile_cs.c
changed /aubit4glsrc/trunk/lib/liblex/lex_cs/compile_cs_sql.c
/aubit4glsrc/trunk/lib/liblex/lex_cs/a4gl_lib_lex_fgl_int.h Diff Switch to side-by-side view
Loading...
/aubit4glsrc/trunk/lib/liblex/lex_cs/compile_cs.c Diff Switch to side-by-side view
Loading...
/aubit4glsrc/trunk/lib/liblex/lex_cs/compile_cs_sql.c Diff Switch to side-by-side view
Loading...