[MDEV-33186] 1241 error on procedure call Created: 2024-01-05  Updated: 2024-01-08

Status: Confirmed
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.4, 10.5, 10.6, 10.11, 11.0, 11.1, 11.2, 11.3, 11.1.2
Fix Version/s: 10.4, 10.5, 10.6, 10.11, 11.0, 11.1, 11.2, 11.3

Type: Bug Priority: Major
Reporter: Tadas BalaiĊĦis Assignee: Alexander Barkov
Resolution: Unresolved Votes: 0
Labels: oracle
Environment:

Win64


Attachments: File 1241 error reduced.sql    

 Description   

Procedure call gives 1241 error in sql_mode=oracle:

/* SQL Error (1241): Operand should contain 2 column(s) */

Reproducing script attached. This is related with cursor having arguments and defined row type.



 Comments   
Comment by Alice Sherepa [ 2024-01-08 ]

Thanks! I repeated as described on 10.4-11.3:

set sql_mode='oracle';
delimiter //;
 
CREATE PROCEDURE sp1 AS
CURSOR n3 is SELECT 1;
CURSOR c3 (t1 int, t2 int, t3 int) is SELECT 5;
d int := 10;
o1 row(id INT);
u1 row(id INT);
g2 row(a int, b int, c int, d int ); 
BEGIN
END;
//
 
--error 1241
CALL sp1//

set sql_mode='oracle';
CREATE PROCEDURE sp1 AS
CURSOR n3 is SELECT 1;
CURSOR c3 (t1 int, t2 int, t3 int) is SELECT 5;
d int := 10;
o1 row(id INT);
u1 row(id INT);
g2 row(a int, b int, c int, d int ); 
BEGIN
END;
//
CALL sp1//
ERROR 21000: Operand should contain 4 column(s)
 
CREATE or replace PROCEDURE sp1 AS
CURSOR n3 is SELECT 1;
CURSOR c3 (t1 int, t2 int, t3 int) is SELECT 5;
o1 row(id INT);
u1 row(id INT);
g2 row(a int, b int, c int, d int ); 
BEGIN
END;
//
CALL sp1//
 
CREATE or replace PROCEDURE sp1 AS
CURSOR n3 is SELECT 1;
CURSOR c3 (t1 int, t2 int, t3 int) is SELECT 5;
d1 int := 10;
d2 int := 10;
o1 row(id INT);
u1 row(id INT);
g2 row(a int, b int, c int, d int ); 
BEGIN
END;
//
CALL sp1//
 
mysqltest: At line 47: query 'CALL sp1' failed: 1241: Operand should contain 1 column(s)

Generated at Thu Feb 08 10:37:01 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.