Regression in 3.0: compiler requires aliasing of table in UPDATE ... RETURNING statement when include RDB$DB_KEY in fields list -------------------------------------------------------------------------------------------------------------------------------
Key: CORE-4540 URL: http://tracker.firebirdsql.org/browse/CORE-4540 Project: Firebird Core Issue Type: Bug Reporter: Pavel Zotov SQL> show version; ISQL Version: LI-T3.0.0.31309 Firebird 3.0 Alpha 2 Server version: Firebird/Linux/AMD/Intel/x64 (access method), version "LI-T3.0.0.31309 Firebird 3.0 Alpha 2" Firebird/Linux/AMD/Intel/x64 (remote server), version "LI-T3.0.0.31309 Firebird 3.0 Alpha 2/tcp (oel64)/P13" Firebird/Linux/AMD/Intel/x64 (remote interface), version "LI-T3.0.0.31309 Firebird 3.0 Alpha 2/tcp (oel64)/P13" on disk structure version 12.0 The following code compiles OK in LI-V6.3.3.26790 but faults in LI-T3.0.0.31309: SQL> recreate table t(id int primary key, x int, y int, z int, constraint t_unq_x_x unique(x,y)); commit; SQL> set term ^; SQL> create or alter procedure p (a_x int, a_y int, a_z int) returns(id int, dbkey char(8) character set octets, new_z int) CON> as CON> begin CON> update t set z = z + :a_z where x = :a_x and y = :a_y CON> returning id, z, CON> rdb$db_key -- <<<< NB: no table alias was specified before 'rdb$db_key' name CON> into id, new_z, dbkey; CON> suspend; CON> end CON> ^ set term ;^ Statement failed, SQLSTATE = 42702 unsuccessful metadata update -CREATE OR ALTER PROCEDURE P failed -Dynamic SQL Error -SQL error code = -204 -Ambiguous field name between table T and table T and table T No such error in 3.0 when add table alias to 'rdb$db_key' column, i.e.: returning id, z, t.rdb$db_key into id, new_z, dbkey; -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://tracker.firebirdsql.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira ------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/ Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel