[MDEV-13273] Confusion between table alias and ROW type variable Created: 2017-07-07 Updated: 2017-07-07 Resolved: 2017-07-07 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Parser, Stored routines |
| Affects Version/s: | 10.3 |
| Fix Version/s: | 10.3.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | regression | ||
| Description |
|
This script:
works fine in 10.2. It treats a.c2 as a reference to the column a.c2, which is in fact t1.c2. Starting from bb-10.2-ext and 10.3, the same script fails to create the procedure with this error:
|
| Comments |
| Comment by Alexander Barkov [ 2017-07-07 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Oracle treats a.c2 as the table column reference if a non-RECORD variable a exists:
Oracle treats a.c2 as a RECORD variable field, if the RECORD variable a exists:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2017-07-07 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
PostgreSQL interprets a.c1 as a table column, if a is a scalar variable:
PostgreSQL returns an error, complaining that a.c1 is ambiguous, if a is a ROWTYPE variable:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2017-07-07 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Pushed to bb-10.2-ext |