Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 369645 - Upon error, SQL Query Builder resets sql script to "Select * from"
Summary: Upon error, SQL Query Builder resets sql script to "Select * from"
Status: NEW
Alias: None
Product: Data Tools
Classification: Tools
Component: SQL Query Builder (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: dtp.sqldevtools-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-25 06:56 EST by Missing name CLA
Modified: 2012-01-25 06:56 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Missing name CLA 2012-01-25 06:56:29 EST
Build Identifier: All builds: 3.6.x

When opening an incorrect SQL script like

select * from tbla a where

SQL query builder gives an error message like:

The SQL cannot be parsed because it is either invalid or is not currently supported. An empty SQL Statement will be will be created in  the SQL Query Builder                                                 
                                                                                                                                               
Error log shows stacktrace:                                           
                                                                       
org.eclipse.datatools.sqltools.parsers.sql.SQLParserException: Unable to
parse the input: "select * from tbla a                                 
where;".                                                             
at org.eclipse.datatools.sqltools.parsers.sql.AbstractSQLParser.parser(Unknown Source)                                                           
at org.eclipse.datatools.sqltools.parsers.sql.SQLParserManager.makeAST(Unknown Source)                                                           
at org.eclipse.datatools.sqltools.parsers.sql.SQLParserManager.parse(Unknown Source)                                                             
at org.eclipse.datatools.sqltools.parsers.sql.query.SQLQueryParserManager.parseQuery(Unknown Source)                                             
                                                                       
It works with a script like
select * from tbla where

(so with no table alias)

Even if the script is incorrect, SQL Query builder should not replace it by an empty/default statement and should allow the developer to correct it.
Otherwise, developer might save the file and lose his work. Also it is not possible to correct the script because it has been replaced.


Reproducible: Always

Steps to Reproduce:
1.From the Data perspective, create an SQL script like select * from tbla a where
2.Open it using the SQL Query Builder: error is raised and content has been replaced by a defalt select statement