Changes between Initial Version and Version 5 of Ticket #11459


Ignore:
Timestamp:
Jun 7, 2012, 7:08:59 AM (12 years ago)
Author:
Aymeric Augustin
Comment:

Fixed formatting (please use preview).

EDIT: sorry, I saw you reposted a properly formatted report afterwards!

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11459

    • Property Status newreopened
    • Property Cc Jamey Sharp j added
    • Property Component UncategorizedDatabase layer (models, ORM)
    • Property Easy pickings unset
    • Property SeverityNormal
    • Property TypeBug
    • Property UI/UX unset
    • Property Version 1.01.3
  • Ticket #11459 – Description

    initial v5  
    11Here is the error message:
     2{{{
    23(1054, "Unknown column 'beyondStore_artist.name' in 'where clause'")
     4}}}
    35
    46This is the invalid sql that calling count() is generating that causes the above error message:
     7{{{
    58SELECT COUNT(*) FROM `sss_song` WHERE (match(sss_song.title) against('hits')) or (match(sss_artist.name, sss_artist.description) against('hits')) or (match(sss_album.title, sss_album.description) against('hits'))
     9}}}
    610
    711Here is the code that generates the QuerySet:
     12{{{
    813songs = models.Song.objects.select_related('album__genre__genre__id', 'artist__name').extra(where = [where_clause])
    914t = songs.count() # sql error is caused by this call to count()
     15}}}
    1016
    1117I know that the query to get the actual data works just fine. It is only the COUNT that is not working. The work around was to get the count manually (by writing an sql statement that gets the count, and executing the statement 'manually' using connection.cursor().execute(sql)).
Back to Top