Select is executed twice
Posted: Wed 24 Oct 2007 08:24
This example shows that MyDevStudio executes selects twice which is wrong:
Prepare table and function for test:
Execute this select once from MyDevStudio:
And you'll have two lines in the table "test":
MyDevStudio v2.10.71.1
MySQL v5.0.32
Prepare table and function for test:
Code: Select all
create table test (
c1 int auto_increment,
primary key (c1)
);
delimiter //
create function fn_test()
returns int
reads sql data
begin
insert into test () values ();
return last_insert_id();
end;
//
delimiter ;
Code: Select all
select fn_test();
Code: Select all
select * from test;
+----+
| c1 |
+----+
| 1 |
| 2 |
+----+
MySQL v5.0.32