[Amarok] Fix the VA node being shown in the case where the

Maximilian Kossick maximilian.kossick at googlemail.com
Wed Sep 23 17:29:04 CEST 2009


On Wed, Sep 23, 2009 at 5:06 PM, Jeff Mitchell <mitchell at kde.org> wrote:
> 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.

tracks should not be even in the query, but fixing that should best be
done after 2.2.

For now adding a temporary hack in SqlQueryMaker::handleAlbums() which
drops the result row if the queryMode is OnlyCompilations and the
single result row does not make sense is a lot less awful than that
commit, and provides exactly the same result.

> I will try to figure out how to do that using QueryMaker and the queries
> that are being put in.
>
> --Jeff
>
>


More information about the Amarok-devel mailing list