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

Bug 369645

Summary: Upon error, SQL Query Builder resets sql script to "Select * from"
Product: [Tools] Data Tools Reporter: Missing name <olivier.gauneau>
Component: SQL Query BuilderAssignee: dtp.sqldevtools-inbox <dtp.sqldevtools-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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