Bug #63129 Executing several SQL Commands at once
Submitted: 7 Nov 2011 16:37 Modified: 15 Nov 2011 13:56
Reporter: Alexander Ratz Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:5.2.35 OS:MacOS
Assigned to: CPU Architecture:Any

[7 Nov 2011 16:37] Alexander Ratz
Description:
It is impossible to execute a single transaction that involved both definition and routines…

for example, this does NOT work.. which used to work in the previous and better version of MySQL GUI Tools:

DROP PROCEDURE [AAA];

DELIMITER $$

CREATE PROCEDURE [AAA] (..);

How to repeat:
Simply open the SQL Editor
[7 Nov 2011 17:16] Valeriy Kravchuk
What exact version, 5.x.y, you had tried to use? I see no problems with executing the following:

use test;
drop procedure proc1;
delimiter $$
create procedure proc1()
begin
  select 1 as a;
end
$$

from Workbench 5.2.35 on Mac OS X.
[7 Nov 2011 17:39] Alexander Ratz
version 5.2.35

In case it gets executed, there is no indication of any sort to its success as if you were to do them separately.
[7 Nov 2011 17:47] Alexander Ratz
Here is the query in visual format

Attachment: Screen Shot 2011-11-07 at 12.45.26 PM.png (image/png, text), 157.14 KiB.

[7 Nov 2011 17:48] Alexander Ratz
When you look at the file I attached you will see that the query is executed.

When I do, SHOW CREATE PROCEDURE USER_ASSIGN_MEMBERSHIP.

It says PROCEDURE does not exist... as you are able to see in the second file.

Hope this helps with this bug,

Alexander
[7 Nov 2011 17:48] Alexander Ratz
Procedure does not exist message after creating it

Attachment: Screen Shot 2011-11-07 at 12.47.58 PM.png (image/png, text), 98.37 KiB.

[7 Nov 2011 20:23] MySQL Verification Team
I couldn't repeat on Windows 7 too.
[13 Nov 2011 5:43] Alfredo Kojima
How are you executing the script?
Sounds like you are using cmd-enter which is bound to Execute Current Statement, which means it will only execute the statement under the cursor. If you want the whole script to be executed you need to press cmd-shift-enter or click the toolbar button to execute.
[15 Nov 2011 7:26] Alexander Ratz
Thanks for the tip, it actually works.

If this is as this is often the case, how can I change the short-cut to be cmd+enter instead of cmd+shift+enter ?
[15 Nov 2011 13:56] Alfredo Kojima
Right now the only way would be to edit the shortcut in the main_menu.xml file