mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Fix of incorrect merge of test case
This commit is contained in:

parent
4265501c9f
commit
88e1468754
@ -241,116 +241,6 @@ SELECT f1(), f2();
|
||||
f1() f2()
|
||||
123 0
|
||||
On master: Check to see that data was inserted correctly
|
||||
CREATE FUNCTION test.square() RETURNS INTEGER DETERMINISTIC RETURN (@var * @var);
|
||||
SET @var = 1;
|
||||
INSERT INTO t1 VALUES (square());
|
||||
SET @var = 2;
|
||||
INSERT INTO t1 VALUES (square());
|
||||
SET @var = 3;
|
||||
INSERT INTO t1 VALUES (square());
|
||||
SET @var = 4;
|
||||
INSERT INTO t1 VALUES (square());
|
||||
SET @var = 5;
|
||||
INSERT INTO t1 VALUES (square());
|
||||
On master: Retrieve the values from the table
|
||||
SELECT * FROM t1;
|
||||
i
|
||||
1
|
||||
4
|
||||
9
|
||||
16
|
||||
25
|
||||
On slave: Retrieve the values from the table and verify they are the same as on master
|
||||
SELECT * FROM t1;
|
||||
i
|
||||
1
|
||||
4
|
||||
9
|
||||
16
|
||||
25
|
||||
DROP TABLE t1;
|
||||
DROP FUNCTION test.square;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP FUNCTION IF EXISTS f1;
|
||||
DROP FUNCTION IF EXISTS f2;
|
||||
CREATE TABLE t1(a int);
|
||||
CREATE FUNCTION f1() returns int deterministic
|
||||
BEGIN
|
||||
return @a;
|
||||
END |
|
||||
CREATE FUNCTION f2() returns int deterministic
|
||||
BEGIN
|
||||
IF (@b > 0) then
|
||||
SET @c = (@a + @b);
|
||||
else
|
||||
SET @c = (@a - 1);
|
||||
END if;
|
||||
return @c;
|
||||
END |
|
||||
SET @a=500;
|
||||
INSERT INTO t1 values(f1());
|
||||
SET @b = 125;
|
||||
SET @c = 1;
|
||||
INSERT INTO t1 values(f2());
|
||||
On master: Retrieve the values from the table
|
||||
SELECT * from t1;
|
||||
a
|
||||
500
|
||||
625
|
||||
On slave: Check the tables for correct data and it matches master
|
||||
SELECT * from t1;
|
||||
a
|
||||
500
|
||||
625
|
||||
DROP TABLE t1;
|
||||
DROP FUNCTION f1;
|
||||
DROP FUNCTION f2;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t2;
|
||||
CREATE TABLE t1 (i int);
|
||||
CREATE TABLE t2 (k int);
|
||||
CREATE trigger t1_bi before INSERT on t1 for each row
|
||||
BEGIN
|
||||
INSERT INTO t2 values (@a);
|
||||
SET @a:=42;
|
||||
INSERT INTO t2 values (@a);
|
||||
END |
|
||||
SET @a:=100;
|
||||
INSERT INTO t1 values (5);
|
||||
On master: Check to see that data was inserted correctly in both tables
|
||||
SELECT * from t1;
|
||||
i
|
||||
5
|
||||
SELECT * from t2;
|
||||
k
|
||||
100
|
||||
42
|
||||
On slave: Check the tables for correct data and it matches master
|
||||
SELECT * from t1;
|
||||
i
|
||||
5
|
||||
SELECT * from t2;
|
||||
k
|
||||
100
|
||||
42
|
||||
End of 5.0 tests.
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP FUNCTION IF EXISTS f1;
|
||||
DROP FUNCTION IF EXISTS f2;
|
||||
CREATE TABLE t1 (i INT);
|
||||
CREATE FUNCTION f1() RETURNS INT RETURN @a;
|
||||
CREATE FUNCTION f2() RETURNS INT
|
||||
BEGIN
|
||||
INSERT INTO t1 VALUES (10 + @a);
|
||||
RETURN 0;
|
||||
END|
|
||||
SET @a:=123;
|
||||
SELECT f1(), f2();
|
||||
f1() f2()
|
||||
123 0
|
||||
On master: Check to see that data was inserted correctly
|
||||
INSERT INTO t1 VALUES(f1());
|
||||
SELECT * FROM t1;
|
||||
i
|
||||
|
Reference in New Issue
Block a user