MaxScale/server/modules/routing/readwritesplit/test/test_implicit_commit6.sql

12 lines
289 B
PL/PgSQL

USE test;
DROP FUNCTION IF EXISTS hello;
SET autocommit=1;
BEGIN;
CREATE FUNCTION hello (s CHAR(20))
RETURNS CHAR(50) DETERMINISTIC
RETURN CONCAT('Hello, ',s,'!'); -- implicit COMMIT
SELECT (@@server_id) INTO @a;
SELECT @a; -- should read from slave
DROP FUNCTION IF EXISTS hello;
COMMIT;