This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 152451 - SQL History: Statement with delimiter is broken for Java DB
Summary: SQL History: Statement with delimiter is broken for Java DB
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: SQL Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: John Baker
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-05 20:12 UTC by Roman Mostyka
Modified: 2009-05-25 20:55 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshot of broken statement in "SQL Hisory" dialog. (58.71 KB, image/jpeg)
2008-12-09 16:42 UTC, Roman Mostyka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Mostyka 2008-11-05 20:12:45 UTC
1. Connect to Java DB, open SQL editor and run following:
"delimiter \\
CREATE PROCEDURE p11 ()
BEGIN
  DECLARE x1 CHAR(5) DEFAULT 'outer';
  BEGIN
    DECLARE x1 CHAR(5) DEFAULT 'inner';
    SELECT x1;
  END;
  SELECT x1;
END; \\".
2. Open "SQL History" dialog and look at executed statements.

Result: The looks strange, I guess because of delimiter and because of statement isn't executed successfully.
Comment 1 John Baker 2008-11-05 20:40:39 UTC
as mentioned before, SQL History only captures what was executed.

This could be how the Java DB executes or how execution is handled.

Either SQL History should be changed to not capture failed SQL statements or we'll have to live with this
Comment 2 David Vancouvering 2008-11-05 20:54:49 UTC
You can't even create a procedure like this in Java DB, it's not even supported.  Java DB SQL syntax will never, ever
require the use of specifying a delimiter.  So in a way this is a very odd and unlikely issue, I'm relegating it to a P4.
Comment 3 David Vancouvering 2008-11-05 21:26:41 UTC
Actually, I'll revert that.  I can see you wanting to change the delimiter for some odd reason, but it's not needed
because of the procedural use case.  Java DB doesn't support SQL stored procedures, only Java procedures.  

We have an open issue to store delimiter statements.

So I guess this issue boils down to "correctly" saving statements that were not correctly executed?  Perhaps that is a
P3, if this really isn't being done correctly.  This issue doesn't have a screen shot to show what "looks strange" means.
Comment 4 Roman Mostyka 2008-11-07 09:34:06 UTC
Actually I tried with latest build, but without any success.
Before, statement for creation of stored procedure was divided into several lines in SQL History. I think that every
string with semicolon in the end was treated as particular statement.
But now, even for Java DB, when statement isn't executed successfully, it appears in SQL History in the same form as for
successfully executed statement. Probably this issue was fixed. I'll investigate further.
Comment 5 John Baker 2008-11-11 23:59:08 UTC
If we want to continue to save statements that failed to execute successfully, then to help resolve this issue, should
there be Delete support to delete those statements that look bad in the history dialog?
Comment 6 Roman Mostyka 2008-11-12 13:12:25 UTC
I already filed such issue some time ago: issue #138853.
Comment 7 John Baker 2008-11-18 16:22:24 UTC
report says will investigate further
Comment 8 Roman Mostyka 2008-12-09 16:42:35 UTC
Created attachment 74754 [details]
Screenshot of broken statement in "SQL Hisory" dialog.
Comment 9 Roman Mostyka 2008-12-09 16:44:12 UTC
In attach you can find a sample of broken statement. But actually I can't reproduce this issue anymore.
I'll try with latest dev build and if I'm not able to reproduce, I'll close this issue.
Comment 10 Roman Mostyka 2008-12-09 16:57:22 UTC
I can't this issue anymore. I'll reopen it if I have more information.
Comment 11 Roman Mostyka 2008-12-09 16:57:52 UTC
Verified with build 081209.