[MDEV-23178] Qualified asterisk not supported in INSERT .. RETURNING Created: 2020-07-15  Updated: 2021-07-22  Resolved: 2021-07-22

Status: Closed
Project: MariaDB Server
Component/s: Data Manipulation - Insert
Affects Version/s: 10.5.4
Fix Version/s: 10.5.12

Type: Bug Priority: Major
Reporter: Lukas Eder Assignee: Rucha Deodhar
Resolution: Fixed Votes: 0
Labels: None
Environment:

Docker



 Description   

The following script shows how to reproduce the issue:

create table t (i int primary key auto_increment, j int);
 
-- These work
insert into t (j) values (1) returning *;
insert into t (j) values (1) returning t.i, t.j;
 
-- This doesn't work
insert into t (j) values (1) returning t.*;

The last statement produces the following error message:

SQL-Fehler [1051] [42S02]: (conn:5) Unknown table 'test.t'

I don't see a reason from the documentation why this syntax wouldn't be allowed, given that:

1. Unqualified asterisks are possible as per the first statement
2. Qualified column references are possible as per the second statement
3. The manual refers to select_expr being expected, without any further restrictions: https://mariadb.com/kb/en/insertreturning/



 Comments   
Comment by Elena Stepanova [ 2020-08-04 ]

Thanks for the report. I also see no reason why it shouldn't work.
It works in PostgreSQL.

Comment by Rucha Deodhar [ 2020-10-23 ]

serg
patch:
https://github.com/MariaDB/server/commit/f51967872944d372c48fc795d1c3127c5f4d36f4

Generated at Thu Feb 08 09:20:26 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.