Created
June 11, 2021 19:11
-
-
Save carlsverre/0dcb088e96e08970e8e9802bb53bae79 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create database if not exists t; | |
create database if not exists t2; | |
use t; | |
create table if not exists x (id int); | |
delimiter // | |
create or replace procedure foo (i int) as | |
begin | |
start transaction; | |
insert into t.x values (i); | |
insert into x values (i); | |
commit; | |
end // | |
delimiter ; | |
use t2; | |
create table if not exists x (id int); | |
-- this will fail | |
use t2; | |
call t.foo (1); | |
-- this will succeed | |
use t; | |
call t.foo (1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment