Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gixsql errors on fields outside of EXEC SQL (like LINKAGE) #155

Open
GitMensch opened this issue Jun 27, 2023 · 1 comment
Open

gixsql errors on fields outside of EXEC SQL (like LINKAGE) #155

GitMensch opened this issue Jun 27, 2023 · 1 comment

Comments

@GitMensch
Copy link
Contributor

GitMensch commented Jun 27, 2023

While gixpp used with gix needs to have more information, gixsql doesn't; it seems reasonable to have a "mode" in the driver so additional checks and the full tree can be skipped depending on that.

The current implementation of with gixpp for gixsql (that normally don't includes any copybooks - and shouldn't), along with a code as follows

       LINKAGE SECTION.
           COPY  MYROOT.
          05 FILLER PIC X.
           COPY  MYDATA.

break the checks and lead to a "parser error" (which is actually not a parser error, but a syntax error and - #154 misses the location):

parse error: FILLER level should start from 01 or 66 or 77 or 88

If there's a "mode" applied in the driver then everything outside of EXEC SQL DECLARE can be skipped (= it doesn't matter if this is "partial" code like the one above, it doesn't matter which exotic USAGEs or TYPEDEFs are used - as long as the parser understands that).
At least in "gixsql mode" the field tree does not necessarily need to be built - or can at least silently ignoring "errors" (in the field case possibly add "implied" artificial fields with expected level as parent).

Note: currently there's a follow-up issue after this message as it leaves the driver without a current field, workaround for that sigsegv in #152.

Workaround:

        LINKAGE SECTION.
+          01 GIXDUMMY.
+            05 FILLER PIC X.
            COPY  MYROOT.
           05 FILLER PIC X.
            COPY  MYDATA.
@GitMensch
Copy link
Contributor Author

@mridoni while the sigsegv is solved now, you likely want to inspect this as that is likely to be a problem for several production code COBOL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant