Subject RE: [firebird-support] Left join and computed columns
Author Rick Debay
Correct. There is no row, but we are getting data in the non-existing
row.
So how do I file a bug report on this?

-----Original Message-----
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Michael Ludwig
Sent: Tuesday, June 19, 2012 5:22 PM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] Left join and computed columns

Rick Debay schrieb am 19.06.2012 um 15:58 (-0400):
> Since TEST_TABLE is empty, the results should be NULL.
> Changing the query to 'SELECT *' return the one row in RDB$DATABASE,
> and the column TEST_TABLE.ID is NULL and the column
> TEST_TABLE.COMPUTED_COL is "FAILED".
> If TEST_TABLE is empty, how can anything result from a join?

Ah. You're expecting one row (because of the LEFT JOIN), but in that
row, which happens to have only one column, you're expecting all fields
from the right table to be NULL because there is no matching row for the
JOIN condition. And the COMPUTED column is sort of overriding the NULL.
Did I paraphrase your thoughts correctly?

I have no idea what's the correct behaviour here. -- Michael

> > CREATE TABLE TEST_TABLE
> > (
> > ID INTEGER,
> > COMPUTED_COL VARCHAR(6) COMPUTED BY ('FAILED') );
> >
> > SELECT t.COMPUTED_COL
> > FROM RDB$DATABASE r
> > LEFT JOIN TEST_TABLE t
> > ON r.RDB$RELATION_ID = t.ID
> >
> > COMPUTED_COL
> > ------------
> > FAILED


------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Resources item on the
main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links




Disclaimer: This message (including attachments) is confidential and may be privileged. If you have received it by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorized use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change. RxStrategies, Inc. shall not be liable for the improper or incomplete transmission of the information contained in this communication or for any delay in its receipt or damage to your system. RxStrategies, Inc. does not guarantee that the integrity of this communication has been maintained nor that this communication is free from viruses, interceptions or interference.