Bug in ADO-Driver when querying with outer against NOT NULL-Fields
Posted in 2004
Hi there,
I have testet this bug with several OLEDB-Drivers (2.70 TC5 ' 2.81 TC3).
I have the following tables:
company (
compid SERIAL(1) NOT NULL,
compname CHAR(32) NOT NULL,
lastchange CHAR(20))
AND
dvoelkel.comp_loc (
compid INTEGER NOT NULL,
locid INTEGER NOT NULL,
lastchange CHAR(20))
When joining with:
SELECT company.untname, company.untid, comp_loc.locid
FROM company, outer comp_loc
WHERE company.untid = comp_loc.untid
I receive no rows or an error like 'a column which doesn't allow NULL's
can't be NULL'.
The following query works fine:
SELECT company.untname, company.untid, comp_loc.lastchange
FROM company, outer comp_loc
WHERE company.untid = comp_loc.untid
It seems, that the resultfields of the query are checked against the
field-properties the fields are selected from. So the first query
doesn't work, because 'locid' is set to NOT NULL. But it can be null in
the query. This is what I wan't the query for.
The second query retrieves the rows as needed, because the field
'lastchange' isn't set to NOT NULL. I have the same results when using
LEFT OUT JOIN instead of OUTER.
Can anyone confirm this? Does anyone has a solution or workaround for this?
Thanks in advance,
Daniel