superbol-studio-oss
superbol-studio-oss copied to clipboard
SQL Preproc issue tracker
The starting point for this should be #370. And using OCamlPro Gixsql fork : https://github.com/OCamlPro/gixsql
Preproc file generation issues
- [x] Digit scale should be negative : TSQL005A (2 instead of -2 for NUM1)
- [ ] Failure due to issue in
cobol_indentwhen there is a tabulation as a first character : TSQL009A TSQL042A This causes errors when computing the variable prefix of statements - [x] Group vars need to be split into their elementary elements : TSQL025A
Group variable
TAB00-RECis passed as is toGIXSQLSetSQLParamswhere it should be the 3 elementary varsCID,FLD01andFLD02. - [x] Detecting group variable that are length-variable from non-esql variable: TSQL026A - 27A (eg SQLCOMMAND)
The test fails because the length attribute a variable-length variable should be negative, this is easily done when the variable is defined as
01 v SQL TYPE VARCHAR(100).but it can be the case from normal COBOL variable. - [ ] Fix
is_varying_lenmethod by adding support toCOMP-5to usage - [ ] --no-rec-code option to implement somehow: TSQL033-1
- [ ]
INCLUDEd parts of the working-storage should be accessible to (at least) theSql_typeckmodule: TSQL0042A The absence of the copy file in the compilation unit cause the typeck to return an unknown type/length/flags for all variable originating from such a file, but those value are passed toGIXSQLSetSQLParams. - [ ] Implement -P varchar option, it seems to activate flag autotrim on some fields: TSQL037A 37B
- [x] Fix support of null indicator (some var have :VAR:NULL-IND form, which is ill-supported): TSQL042A
Grammar issues
- [ ] Once the preproc option
--cobol85is remove, a grammar error appears in test TSQL018B : apparentlyLOREM IPSUMis a validEXEC SQLbloc... - [ ] Grammar should be able to parse 'SELECT CASE WHEN' statement: TSQL041A
Parser issues
- [ ]
VARYINGkeyword not supported : TSQL022 NB the test depends on preprocess file content - [ ] I think
EXEC SQL IGNOREblock should be handle by another preproc, (the default cobol one ?) as the token inside are to be copied as is in the generated file (I hacked a safeguard to avoid parsing such blocks) (TSQL011A)
I report here some issues I found with the gixsql test suite:
- The following warning message:
Internal warning: unable to join locations via limits in
`Cobol_preproc__Src_overlay.join_limits`
is emitted a lot of time. For instance with TSQL001A.cbl:
EXEC SQL found at line 51
END-EXEC found at 53
:1.22-1.29: Internal warning: unable to join locations via limits in
`Cobol_preproc__Src_overlay.join_limits`
[ctx=Sql_parser__Sql_overlay_manager-2]
:1.37-1.42: Internal warning: unable to join locations via limits in
`Cobol_preproc__Src_overlay.join_limits`
[ctx=Sql_parser__Sql_overlay_manager-2]
:1.51-1.56: Internal warning: unable to join locations via limits in
`Cobol_preproc__Src_overlay.join_limits`
[ctx=Sql_parser__Sql_overlay_manager-2]
EXEC SQL found at line 67
END-EXEC found at 69
:1.16-1.21: Internal warning: unable to join locations via limits in
`Cobol_preproc__Src_overlay.join_limits`
[ctx=Sql_parser__Sql_overlay_manager-2]
:1.35-1.37: Internal warning: unable to join locations via limits in
`Cobol_preproc__Src_overlay.join_limits`
[ctx=Sql_parser__Sql_overlay_manager-2]
:1.43-1.51: Internal warning: unable to join locations via limits in
`Cobol_preproc__Src_overlay.join_limits`
[ctx=Sql_parser__Sql_overlay_manager-2]
EXEC SQL found at line 79
END-EXEC found at 79
- An error of syntax with
TSQL042A.cbsqlandTSQL009A.cbsqltoo:
TSQL042A.cbsql: in paragraph '100-MAIN':
TSQL042A.cbsql:179: error: syntax error, unexpected Identifier, expecting SECTION or .
177 | SQLBOL* START TRANSACTION
178 | SQLBOL* END-EXEC.
179 > SQLBOL ENDCALL STATIC "GIXSQLStartSQL"
180 | SQLBOL ENDEND-CALL
181 | SQLBOL ENDCALL STATIC "GIXSQLExec" USING
TSQL042A.cbsql:179: note: unknown statement 'ENDCALL'
- Several errors of syntax with
TSQL040A.cbsql:
TSQL040A.cbsql:50: error: PROCEDURE DIVISION header missing
48 | SQLBOL* FILENAME VARCHAR(60) NOT NULL 0..
49 | SQLBOL* ) END-EXEC. 0..
50 > SQLBOL TODO.
51 | ******************************************************************0..
52 | * COBOL DECLARATION FOR TABLE AEPT.P_HISTORY_TD *0..
TSQL040A.cbsql:50: error: syntax error, unexpected Identifier
TSQL040A.cbsql:54: error: syntax error, unexpected Identifier, expecting SECTION or .
52 | * COBOL DECLARATION FOR TABLE AEPT.P_HISTORY_TD *0..
53 | ******************************************************************0..
54 > 01 DCLP-HISTORY-TD. 0..
55 | * DATAVAL 0..
56 | 10 P014-DATAVAL PIC X(10). 0..
TSQL040A.cbsql:54: note: unknown statement '01'
TSQL040A.cbsql:56: error: syntax error, unexpected Identifier, expecting SECTION or .
54 | 01 DCLP-HISTORY-TD. 0..
55 | * DATAVAL 0..
56 > 10 P014-DATAVAL PIC X(10). 0..
57 | * DATARIL 0..
58 | 10 P014-DATARIL PIC X(10). 0..
....
- Warning message with
TSQL015A.cbsql:
TSQL015A.cbsql:83: warning: OCCURS DEPENDING ON without TO phrase used [-Wdialect]
81 | DEPENDING ON Z-MY-ELEMENTS
82 | ASCENDING KEY IS MY-ID
83 > INDEXED BY I-TAB.
84 | 07 MY-ELEMENT.
85 | 10 MY-ID PIC 9(009) COMP-5 VALUE ZERO.