Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 356407

Summary: Add parser/validation for SQL DataSource
Product: z_Archived Reporter: Paul Harmon <pharmon>
Component: EDTAssignee: Justin Spadea <jspadea>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: carrollk, pharmon, zhuzhi
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Open statement validation testcase none

Description Paul Harmon CLA 2011-08-31 16:48:57 EDT
Support needs to be added to core to support the SQL DataSource specification.

This includes:

1) updating parser 
2) coming up with a scheme to register validators for the I/O statements based on the target
3) writing the validation code

See Bug 355573 for the spec
Comment 1 Zhi Zhu CLA 2011-09-14 05:34:10 EDT
Paul, how about the sample validator?

I am not familiar with this part, can you list specific classes affected? and how to test them? so I can begin thanks
Comment 2 Paul Harmon CLA 2011-09-28 14:04:18 EDT
Created attachment 204207 [details]
Open statement validation testcase
Comment 3 Paul Harmon CLA 2011-09-28 14:05:00 EDT
I have finished adding the validator for the Open statement. I have added validation for all semantic checks for Open that were listed in the spec.

You can use this class (org.eclipse.edt.compiler.internal.egl2mof.eglx.persistence.sql.validation.OpenStatementValidator)as a template to add validation for the other statements. 

The starting point for validation is:
org.eclipse.edt.compiler.internal.egl2mof.eglx.persistence.sql.SQLActionStatementValidator

I have added a call to the OpenStatementValidator in this class, but I have it commented out currently.

When adding error messages, you will need to update IProblemRequestor to add the constants. The message text is stored in EglValidationResources.properties.
If you add validation for anything to do with types, you should follow the pattern used in messages 8500-8502. Then you will also need to update DefaultProblemRequester to add the messages to the list of messagesWithLineNumberInserts (this is done so that the messages are built properly when validating top level functions).

I am attaching my project containing the validation tests that I used for OpenStatement.
Comment 4 Zhi Zhu CLA 2011-09-28 20:45:36 EDT
Paul, thanks for your explanation, I will do SQL validation based on your work.
But I can begin doing it after Oct,10, since China National Day is coming and those two days I have to resolve two ERs
Comment 5 Justin Spadea CLA 2011-10-13 10:28:22 EDT
Validation has been added to edt.compiler. While working on this, I found some things in the spec that were incorrect, so it's possible that other parts of the spec are incomplete/incorrect. If so, please open separate bugs for any missing or incorrect validation checks.

Also, Paul Harmon added parser changes in support of validation, based on the spec.
Comment 6 Lisa Lasher CLA 2011-11-04 11:46:40 EDT
Closing this work item