[MDEV-16385] ROW SP variable is allowed in unexpected context Created: 2018-06-04  Updated: 2018-06-05  Resolved: 2018-06-05

Status: Closed
Project: MariaDB Server
Component/s: Stored routines
Affects Version/s: 10.3, 10.4
Fix Version/s: 10.3.8, 10.4.0

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
blocks MDEV-4912 Data type plugin API version 1 Closed
blocks MDEV-16388 Replace member Item::fixed to virtual... Closed

 Description   

This script produces no errors:

CREATE OR REPLACE TABLE t1 (a INT);
DELIMITER $$
BEGIN NOT ATOMIC
  DECLARE row ROW(a INT);
  SELECT * FROM t1 ORDER BY row;
END;
$$
DELIMITER ;

It should return an error.

The same problem is repeatable with HAVING:

CREATE OR REPLACE TABLE t1 (a INT);
DELIMITER $$
BEGIN NOT ATOMIC
  DECLARE row ROW(a INT);
  SELECT * FROM t1 HAVING row;
END;
$$
DELIMITER ;

The same problem is repeatable in LIKE..ESCAPE:

DELIMITER $$
BEGIN NOT ATOMIC
  DECLARE a ROW(a INT);
  SELECT 1 LIKE 2 ESCAPE a;
END;
$$
DELIMITER ;


Generated at Thu Feb 08 08:28:31 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.