[This topic is migrated from our old forums. The original author name has been removed]
Critical error:
When I hit Ctrl . to execute the sql statement where the cursor is placed and the cursor is on a commented line the first sql statement in the open SQL commander is always executed, not the one where the cursor actually is.
Example:
The following is the content of the sql commander window:
--------------------------------------------------------------
select *
from smadr
;
select *
-- test
from smsm
;
select *
-- test
from smsm
;
--------------------------------------------------------------
If I place the cursor on any of the lines
-- test
the statement that gets executed is:
select *
from smadr
;
wich is the first in this window.
This is CRITICAL!
Hi Nils,
Thanks for reporting this. It will be fixed in the next maintenance release.
Best Regards,
Hans
a
anonymous
said
almost 12 years ago
[This reply is migrated from our old forums. The original author name has been removed]
Re: Critical Ctrl . execution error
Hi
Just found out this bug is MUCH worse than I thought.
It will also execute the first sql in the file even if the cursor is place properly inside another statement with no comments!
I have had to add a simple small non dangerous select statement as the first in all my sql files to make sure nothing wrong happens.
I hope the release with a fix for this is out VERY soon!
Hans Bergsten
said
almost 12 years ago
[This reply is migrated from our old forums.]
Re: Critical Ctrl . execution error
Hi Nils,
Can you please provide a detailed example? I cannot reproduce this with 9.0.
Best Regards,
Hans
a
anonymous
said
almost 12 years ago
[This reply is migrated from our old forums. The original author name has been removed]
Re: Critical Ctrl . execution error
select *
from sometable
;
select *
'-- test
from anothertable
;
Remove the ' in front of -- test so it's a regular commented line (the ' is there just so you can see the line properly)
Put ther cursor on the first column of the -- test line.
Hit ctrl . (control and point) to execute the select * from anothertable statement.
The statement that is actually executed is select * from sometable - every time!
Sometimes you don't need a commented line. Even if you place the cursor somewhere within a sql statement the very first statement that appears in the sql buffer will be executed.
This has so fare happened when I put the cursor FIRST on the first line of a select statement (where there is no commented lines). But not always, only sometimes. That behavior I don't yet have a simple set of statements for you where it happens.
But the above is consistently repeatable and I have found NO case where this works the way it should if there is a commented line and the cursor is first on that line when I hit Ctrl .
With the above sql statements I can put the cursor anywhere on the -- test line and the first statement (select * from sometable) will be executed.
Edited by: Nils Myklebust on Dec 12, 2012 3:17 PM
Edited by: Nils Myklebust on Dec 12, 2012 3:20 PM
Hans Bergsten
said
almost 12 years ago
[This reply is migrated from our old forums.]
Re: Critical Ctrl . execution error
Hi Nils,
The issue with Execute Current when the caret is on a line with a line comment can be reproduced and it will be fixed in the next maintenance release. I have not been able to reproduce the issue you describe without a comment line.
The issue with the comment was caused by an incorrect fix for another issue. That fix will be reverted and the other issue fixed in another way. This means this code will be the same as it is in 8.0, were we have not seen any issues with this.
Best Regards,
Hans
a
anonymous
said
almost 12 years ago
[This reply is migrated from our old forums. The original author name has been removed]
Re: Critical Ctrl . execution error
Hi Hans
I have just found the problem where there is no comment line.
There was a comment at the end of the line like this:
select count(*) antall -- some comment
from sometable
;
A comment anywhere on a line, not just a line with nothing but a comment, leads to the error of Ctrl . executing the first statement in the command file.
I hope this will also be fixed in your next maintenance release.
It's very frightening bug as I have lots of files with each lots of sql statements that are used quite regularly.
If I forgot to put a non dangerous (simple select statement) at the beginning of each file it could have had devastating results in a production database to use any of these files.
Some even contains drop table ... as their first statement and that wouldn't have been nice to execute!
I will try to put such non dangerous sql statements first anyway in case the error should rear it's ugly head again at some later time :-)
Regards Nils
Hans Bergsten
said
almost 12 years ago
[This reply is migrated from our old forums.]
Re: Critical Ctrl . execution error
Hi Nils,
Thanks for the clarification. Your example is one of the cases where a line comment caused the problem, and the fix will correct this case as well.
I totally agree that this is a bug that can have serious consequences so we will make sure we get it right.
Best Regards,
Hans
Roger Bjärevall
said
almost 12 years ago
[This reply is migrated from our old forums.]
Re: Critical Ctrl . execution error
Nils,
This is now fixed in the just released 9.0.1 version.
Regards
Roger
a
anonymous
said
almost 12 years ago
[This reply is migrated from our old forums. The original author name has been removed]
Re: Critical Ctrl . execution error
Thanks a lot.
Very happy that your are efficient in fixing bugs like this!
anonymous