Grails JIRA

  • Log In Access more options
    • Online Help
    • GreenHopper Help
    • Agile Answers
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Agile
Grails
  • Grails
  • GRAILS-8206

totalCount is broken

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 2.0-RC1
  • Fix Version/s: 2.0-RC2
  • Component/s: Persistence
  • Labels:
    • gorm
  • Environment:
    Win 7

Description

totalCount property to get the number of entries after applying a criteria query is broken.
For example, having

        def authorList = Author.createCriteria().list(max: params.max, offset: params.offset){
            ilike('name', '%a%')
        }

authorList.totalCount always returns the total number of Author records and not only those with 'a' symbol in 'name' field.

Issue Links

is related to

Improvement - An improvement or enhancement to an existing feature or task. GRAILS-2672 Return PagedResultList in case list* methods are provided with max and offset param

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.
relates to

Bug - A problem which impairs or prevents the functions of the product. GRAILS-8365 totalCount creates additional order by statement

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
  • Git Commits
Hide
Permalink
Fat Zopilot added a comment - 02/Nov/11 7:22 AM

Same issue here. The criteria is just omitted in the SQL query that is generated when totalCount is invoked/accessed.
In 1.3.7. there was an additional limit (at least in the query where I stumbled upon this issue) which is missing as well.
Win 7, Postgres 9.0, postgresql-9.1-901.jdbc4, JDK 6.0.29 (all 64-bit)

Show
Fat Zopilot added a comment - 02/Nov/11 7:22 AM Same issue here. The criteria is just omitted in the SQL query that is generated when totalCount is invoked/accessed. In 1.3.7. there was an additional limit (at least in the query where I stumbled upon this issue) which is missing as well. Win 7, Postgres 9.0, postgresql-9.1-901.jdbc4, JDK 6.0.29 (all 64-bit)
Hide
Permalink
Jeff Brown added a comment - 02/Nov/11 7:29 AM

Fat and Leonid,

We will get this straight for RC2. Thanks for the help.

Show
Jeff Brown added a comment - 02/Nov/11 7:29 AM Fat and Leonid, We will get this straight for RC2. Thanks for the help.
Hide
Permalink
Fat Zopilot added a comment - 22/Nov/11 6:19 PM

2.0.0.BUILD-SNAPSHOT: Now there is an additional "order by lower" in the generated select count query if there is a "sort 'property'" in the domain class' mapping section. Suggest to reopen.

Show
Fat Zopilot added a comment - 22/Nov/11 6:19 PM 2.0.0.BUILD-SNAPSHOT: Now there is an additional "order by lower" in the generated select count query if there is a "sort 'property'" in the domain class' mapping section. Suggest to reopen.
Hide
Permalink
Jeff Brown added a comment - 22/Nov/11 6:42 PM

Fat,

Please raise a separate JIRA with relevant details and we will see about getting that straightened out.

Thanks for the help.

Show
Jeff Brown added a comment - 22/Nov/11 6:42 PM Fat, Please raise a separate JIRA with relevant details and we will see about getting that straightened out. Thanks for the help.

People

  • Assignee:
    Jeff Brown
    Reporter:
    Leonid Vysochyn
Vote (4)
Watch (6)

Dates

  • Created:
    24/Oct/11 3:45 AM
    Updated:
    24/Nov/11 6:17 AM
    Resolved:
    07/Nov/11 6:55 AM

Agile

  • View on Board
  • Atlassian JIRA (v5.2.1#813-sha1:277a546)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Grails project. Try JIRA - bug tracking software for your team.