-
Notifications
You must be signed in to change notification settings - Fork 57
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
LOB variables and file reference variables arrays #2396
LOB variables and file reference variables arrays #2396
Conversation
1ae427d
to
91bd8fc
Compare
I am wondering if we need to add the newly added lexemes to the coloring and auto completion. |
@@ -64,6 +68,8 @@ xml_lobNO_size: BLOB_FILE | CLOB_FILE | DBCLOB_FILE; | |||
|
|||
xml_as: XML AS; | |||
|
|||
occurs_clause: OCCURS T=dbs_integer {validateIntegerRange($T.text, 1, 32767);} TIMES?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like above approach of dbs_host_var_levels_arrays
, where it a single rule for validation. Obviously there is nothing wrong in this as well.
public List<Node> visitLob_host_variables_arrays(Db2SqlParser.Lob_host_variables_arraysContext ctx) { | ||
List<Node> hostVariableDefinitionNode = createHostVariableDefinitionNode(ctx, ctx.dbs_host_var_levels_arrays(), ctx.entry_name()); | ||
if (ctx.lobWithSize() != null && ctx.lobWithSize().BINARY() != null) { | ||
generateVarbinVariables((VariableDefinitionNode) hostVariableDefinitionNode.get(0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't see use case tests for these
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would also apply to the BLOB
variant, not just the BINARY LARGE OBJECT
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more question to this - what is the origin of the restriction to binary lobs only?
I see this in the DB2 preprocessor output:
04 VAR4 OCCURS 30.
49 VAR4-LENGTH PIC S9(9) COMP-5.
49 VAR4-DATA PIC X(20).
* 04 VAR4 USAGE IS SQL TYPE IS BLOB (20) OCCURS 30 TIMES.
04 VAR5 OCCURS 30.
49 VAR5-LENGTH PIC S9(9) COMP-5.
49 VAR5-DATA PIC X(20).
* 04 VAR5 USAGE IS SQL TYPE IS CLOB (20) OCCURS 30 TIMES.
04 VAR6 OCCURS 40.
49 VAR6-LENGTH PIC S9(9) COMP-5.
49 VAR6-DATA PIC G(30720) DISPLAY-1
* 04 VAR6 USAGE IS SQL TYPE IS DBCLOB (30 K) OCCURS 40.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more question to this - what is the origin of the restriction to binary lobs only? I see this in the DB2 preprocessor output:
04 VAR4 OCCURS 30. 49 VAR4-LENGTH PIC S9(9) COMP-5. 49 VAR4-DATA PIC X(20). * 04 VAR4 USAGE IS SQL TYPE IS BLOB (20) OCCURS 30 TIMES. 04 VAR5 OCCURS 30. 49 VAR5-LENGTH PIC S9(9) COMP-5. 49 VAR5-DATA PIC X(20). * 04 VAR5 USAGE IS SQL TYPE IS CLOB (20) OCCURS 30 TIMES. 04 VAR6 OCCURS 40. 49 VAR6-LENGTH PIC S9(9) COMP-5. 49 VAR6-DATA PIC G(30720) DISPLAY-1 * 04 VAR6 USAGE IS SQL TYPE IS DBCLOB (30 K) OCCURS 40.
Someone checked that on the mainframe. Probably only binary lobs was checked at that time.
I will make changes for CLOB and DBLOB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last details - DBCLOB generates PIC G(...)
, not PIC X(...)
.
91bd8fc
to
ddfafec
Compare
same have been added under PR #2394 |
server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlHostVariable.java
Outdated
Show resolved
Hide resolved
177d256
to
f553f7f
Compare
f553f7f
to
8fce484
Compare
public List<Node> visitLob_host_variables_arrays(Db2SqlParser.Lob_host_variables_arraysContext ctx) { | ||
List<Node> hostVariableDefinitionNode = createHostVariableDefinitionNode(ctx, ctx.dbs_host_var_levels_arrays(), ctx.entry_name()); | ||
if (ctx.lobWithSize() != null && ctx.lobWithSize().BINARY() != null) { | ||
generateVarbinVariables((VariableDefinitionNode) hostVariableDefinitionNode.get(0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last details - DBCLOB generates PIC G(...)
, not PIC X(...)
.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: