Issue Details (XML | Word | Printable)

Key: DNET-761
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Jiri Cincura
Reporter: Andrew Ayre
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
.NET Data provider

FbScript not parsing comments in SQL script.

Created: 09/May/17 05:04 AM   Updated: 09/May/17 02:54 PM
Component/s: ADO.NET Provider
Affects Version/s: 5.9.0.0
Fix Version/s: None

Environment: NET45. Problem may exist is other versions as well.
Issue Links:
Relate
 


 Description  « Hide
Some older version of the .NET Data Provider seem to work OK.
I think the issue was introduced on 5-Oct-2015.

In general this issue seems to be related to the parsing of SQL by FbScript.

This issues seems to be related to how comment are handled within an SQL script when it is parsed by FbScript.
Both multiline comments as well as single line comments are impacted.

Multiline comments seem to have an issue if the comment contains a "@" character.
The below is an example of valid SQL that fails to parse correctly with FbScript:

====== Begin SQL Example 1 ======
/*@@Metadata
<Title Metadata>
Summary: Metadata.
Description Metadata is the collection of scripts that create the structure and
supporting business rules for the Firebird Database.
All scripts are written in ANSI92 SQL language which is the language used by the Firebird Server.

* *
Developers please consult the SDK for coding and documentation standards.
*/

CREATE EXCEPTION ACTUAL_DATE_CANCELLATION
  'Actual Date must be null if Cancellation Reason is set.';

====== End SQL Example 1======

The error returned is:
Exception thrown: 'FirebirdSql.Data.FirebirdClient.FbException' in FirebirdSql.Data.FirebirdClient.dll
Additional information: Must declare command parameters.




Single line comments seem to have an issue with comments occurring after the last SQL statement.
The below is an example of valid SQL that fails to parse correctly with FbScript:

====== Begin SQL Example 2 ======
CREATE EXCEPTION ACTUAL_DATE_CANCELLATION
  'Actual Date must be null if Cancellation Reason is set.';

-- This is a test
====== End SQL Example 2======

Exception thrown: 'System.ArgumentException' in FirebirdSql.Data.FirebirdClient.dll
Additional information: The type of the SQL statement could not be determined. See also UnknownStatement event.
Statement:

-- This is a test

.

SQL Scripts containing "Commit" also seem to have issues in some situations, but don't have any details at this time.
I will add more details regarding the issue of "Commit" within SQL script and FbScript parsing when I have more details.


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Jiri Cincura added a comment - 09/May/17 02:53 PM
The first one is duplicate of DNET-176.
The other one is expected. There's no statement after the previous `;`. You can handle it in `UnknownStatement`, as described in exception.