Bug #25290 When error comes, it clears SQL Query Area.
Submitted: 27 Dec 2006 6:18 Modified: 15 Feb 2007 15:07
Reporter: Kaushik Gadani Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Query Browser Severity:S2 (Serious)
Version:1.2.8 beta OS:Windows (Windows XP)
Assigned to: Mike Lischke CPU Architecture:Any
Tags: SQL Query Area

[27 Dec 2006 6:18] Kaushik Gadani
Description:
When I execute stored procedure using call statement, if it has some error while executing it; it clear or blanks the area where I am writing SQLs i.e. SQL Query Area.

There is no way to get back all queries written in that area. It completely losts all other SQLs too.

How to repeat:
Again do the same step i.e. call sp_name();

Suggested fix:
Its obvious that it should not clears the sql whenever there is any kind of error.
[27 Dec 2006 6:20] Kaushik Gadani
Screenshot When it clears SQL query area.

Attachment: Screen.JPG (image/pjpeg, text), 60.68 KiB.

[27 Dec 2006 6:22] Kaushik Gadani
Screen snap it attached herewith. 

Example of Query:
    call SP_F05_ReadAndConvert ('2007-01-01', 0);

Now stored procedure SP_F05_ReadAndConvert is contains calling another SP within it. Please note this another SP has some error which throws on with such a way that SQL Query Area removes whatever written on it.
[27 Dec 2006 8:48] Valeriy Kravchuk
Thank you for a problem report. Please, send all the code that is needed to get the behaviour described each and every time. We need a (better - simple) test case.
[28 Dec 2006 7:07] Kaushik Gadani
I dont know how to give feedback, so I choose this way.

I am copying one SP which has same case inside it, as same as original one. I could not copy original SP because to see/read/understand its too difficult as its 2500 lines of complex algorithm. Any way SP is here:

DELIMITER $$

DROP PROCEDURE IF EXISTS `test`.`sp_Test` $$
CREATE PROCEDURE `test`.`sp_Test` ()
BEGIN
  declare test1 int;
  select test1 = count(*)
  from stud;   -- This table exists in database, you can take any table...

  select  test1 = count(*)
  from stud1;  -- This table doesnot exists, you do not need to create...
END $$

DELIMITER ;

See, I found soluion too. When I use like "test1 = count(*)" it clears SQL query area, but when I use like "count(*) into test1", it does not clear SQL query area. You do not need to create table stud1, as to simulate error case.

Please note if its my fault of writting SQL in such a way, I apologize sincerely to waste yout valuable time.
[28 Dec 2006 11:37] Valeriy Kravchuk
Verified just as described in your last comment. This is a bug! Whatever SQL you use, and whatever errors you get while running SP, SQL Queryu Area should not be cleared.
[15 Jan 2007 15:07] Mike Lischke
Actually, this is not a bug. This may sound strange, but the impression you get from QB is not what it truly is. What happens is that the SP returns more than one result set, so more than one result set grid is created. Each of them has an associated query text but only the first one has the actual query that created the result sets.

The displayed text in the query area is that of the currently active (focused) result set grid. Since all others except the first result only have an empty query text stored (there is no single command that could be associated) the query area becomes empty when they are activated. The last grid is active after the query returns.

Try to activate the first result set (the top most) and you will see all your query text again. Let me know if you still have trouble with that.
[16 Feb 2007 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".