1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-10577 sql_mode=ORACLE: %TYPE in variable declarations

This commit is contained in:
Alexander Barkov
2016-12-06 09:05:52 +04:00
parent cd1afe0aac
commit 46d076d67a
30 changed files with 2713 additions and 112 deletions

View File

@ -80,3 +80,21 @@ NULL NULL 2
NULL 1 1
1 1 0
DROP TABLE t1;
#
# MDEV-10577 sql_mode=ORACLE: %TYPE in variable declarations
#
CREATE TABLE t1 (a INT, b INT, total INT);
CREATE TRIGGER tr1 BEFORE INSERT ON t1
FOR EACH ROW
DECLARE
va t1.a%TYPE:= :NEW.a;
vb t1.b%TYPE:= :NEW.b;
BEGIN
:NEW.total:= va + vb;
END;
$$
INSERT INTO t1 (a,b) VALUES (10, 20);
SELECT * FROM t1;
a b total
10 20 30
DROP TABLE t1;