[Amarok] Fix the VA node being shown in the case where the
Jeff Mitchell
mitchell at kde.org
Wed Sep 23 17:06:35 CEST 2009
Maximilian Kossick wrote:
> How about fixing it properly instead of resulting to ugly hacks in
> widely separated components? E.g. by analysing the query that will be
> generated in the specific use case, figuring out why the result set
> returns a row at all
It returns a row because (according to the explanation I was given when
I asked this last night when trying to work out a fix) "when doing LEFT
JOINs records from the first table with no matching records from the
second will be on rows with all NULL fields for the fields for the
second table". All of the fields being queried are from the second table:
SELECT DISTINCT albums.name, albums.id, albums.artist FROM tracks LEFT
JOIN albums ON tracks.album = albums.id WHERE 1 AND albums.artist IS NULL
On the test database I was given, this results in:
+------+------+--------+
| name | id | artist |
+------+------+--------+
| NULL | NULL | NULL |
+------+------+--------+
1 row in set (0.01 sec)
I asked a tester to try switching some tags, although I now realize
(after much more queries tracking down stuff for this email) that the
data set I gave him was not right. I gave him a set of albums where the
name is empty; what I should have given him was a set of tracks where
the album id is empty.
> and then fixing that issue in SqlQueryMaker
I know fuckall about QueryMaker in general, much less SqlQueryMaker, and
wanted to get a fix in for 2.2 final.
That being said:
Switching the order of the tables -- having the first table be albums
instead of tracks -- should probably fix the issue, according to the
information I was given above.
I will try to figure out how to do that using QueryMaker and the queries
that are being put in.
--Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: OpenPGP digital signature
Url : http://mail.kde.org/pipermail/amarok-devel/attachments/20090923/2625c1e1/attachment.sig
More information about the Amarok-devel
mailing list