FirebirdSQL / firebird

Firebird server, client and tools
https://firebirdsql.org
1.26k stars 217 forks source link

Server shouldn't allow ambiguity if the whole row is selected through * [CORE1464] #1881

Open firebird-automations opened 17 years ago

firebird-automations commented 17 years ago

Submitted by: Kuznetsov Eugene (eugene)

In 3-d dialect

select rdb$database.rdb$relation_id from rdb$database,rdb$database

returns

Undefined name. Dynamic SQL Error. SQL error code = -204. Ambiguous field name between table RDB$DATABASE and table RDB$DATABASE . RDB$RELATION_ID.

But

select rdb$database.* from rdb$database,rdb$database

select rdb$database.* from rdb$database left join rdb$database on 0 = 1 (returns empty dataset)

select rdb$database.* from rdb$database right join rdb$database on 0 = 1 (returns one row)

works.

For two last queries the results may be unsuspected by user.

Best regards, Eugene

firebird-automations commented 16 years ago
Modified by: @pcisar Workflow: jira \[ 13061 \] =\> Firebird \[ 15541 \]