| Summary: | Can not execute sql script with multiple statements | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] Data Tools | Reporter: | John Graham <jgraham> | ||||
| Component: | SQL Editor Framework | Assignee: | Hui Cao <hui.cao> | ||||
| Status: | CLOSED FIXED | QA Contact: | |||||
| Severity: | critical | ||||||
| Priority: | P3 | CC: | hiroyuki.inaba, hung.hsi | ||||
| Version: | 1.0 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
John Graham
Created attachment 53649 [details]
Sample script from BIRT test database
Modified Derby sql parser to correctly recognize the satement terminators. Tested using the attached sample derby script. Verified in DTP 1.0RC1 12/1 build and closing. A similar problem was detected.
In SQL execution from SQL editor, two or more CREATE TABLE became execution of one.
EX;
CREATE TABLE ..... ;
CREATE TABLE ..... ;
CREATE TABLE ..... ;
In org.eclipse.datatools.sqltools.db.generic plugin,
create_stmts method of GenericSQLParser class call "any_stmt_token()".
In any_stmt_token(),
call "error_skiptobefore(new int[]{END, SEMICOLON, GO}, STMT_START)".
FIXED => error_skiptobefore(new int[]{END}, STMT_START_TERMINATORS)
NOTE: STMT_START_TERMINATORS = STMT_START + TERMINATORS
The sentence ends by correcting this bug before ";".
I think that you should apply the same correction as GenericSQLParser.
Hui, please look into it. See 191721. |