MDEV-15620 Crash when using "SET @@NEW.a=expr" inside a trigger
A simple patch fixing the problem in 5.5. Note, a full patch was previously fixed to 10.3.
This commit is contained in:
parent
ddc5c65333
commit
e8c2366bf8
@ -672,3 +672,10 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
|
|||||||
PREPARE stmt FROM 'CREATE TRIGGER tr AFTER DELETE ON t1 FOR EACH ROW SET @a = 1\\';
|
PREPARE stmt FROM 'CREATE TRIGGER tr AFTER DELETE ON t1 FOR EACH ROW SET @a = 1\\';
|
||||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '\' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '\' at line 1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# MDEV-15620 Crash when using "SET @@NEW.a=expr" inside a trigger
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (a INT);
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET @@NEW.a=0;
|
||||||
|
ERROR HY000: Unknown system variable 'NEW'
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -780,3 +780,12 @@ CREATE TRIGGER tr AFTER DELETE ON t1 FOR EACH ROW SET @a = 1\;
|
|||||||
--error ER_PARSE_ERROR
|
--error ER_PARSE_ERROR
|
||||||
PREPARE stmt FROM 'CREATE TRIGGER tr AFTER DELETE ON t1 FOR EACH ROW SET @a = 1\\';
|
PREPARE stmt FROM 'CREATE TRIGGER tr AFTER DELETE ON t1 FOR EACH ROW SET @a = 1\\';
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-15620 Crash when using "SET @@NEW.a=expr" inside a trigger
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (a INT);
|
||||||
|
--error ER_UNKNOWN_SYSTEM_VARIABLE
|
||||||
|
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET @@NEW.a=0;
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -13567,6 +13567,11 @@ option_value:
|
|||||||
| '@' '@' opt_var_ident_type internal_variable_name equal set_expr_or_default
|
| '@' '@' opt_var_ident_type internal_variable_name equal set_expr_or_default
|
||||||
{
|
{
|
||||||
struct sys_var_with_base tmp= $4;
|
struct sys_var_with_base tmp= $4;
|
||||||
|
if (tmp.var == trg_new_row_fake_var)
|
||||||
|
{
|
||||||
|
my_error(ER_UNKNOWN_SYSTEM_VARIABLE, MYF(0), "NEW");
|
||||||
|
MYSQL_YYABORT;
|
||||||
|
}
|
||||||
/* Lookup if necessary: must be a system variable. */
|
/* Lookup if necessary: must be a system variable. */
|
||||||
if (tmp.var == NULL)
|
if (tmp.var == NULL)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user