Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.3.2
-
Fix Version/s: 1.3.3
-
Component/s: None
-
Labels:None
-
Testcase included:yes
Description
After upgrading to 1.3.2, the following style of executeQuery fails:
def numBooks = Book.executeQuery(
'select count(*) from Book where author = ? and dateCreated <= ?',
[a, new Date()])[0]
Expected positional parameter count: 2, actual parameters: [Fri Jun 18 11:35:17 NZST 2010] [select count(*) from Book where author = ? and dateCreated <= ?]; nested exception is org.hibernate.QueryException: Expected positional parameter count: 2, actual parameters: [Fri Jun 18 11:35:17 NZST 2010] [select count(*) from Book where author = ? and dateCreated <= ?]
I vaguely recall this form of executeQuery being deprecated? But latest user guide still has it as available.
Test application with failing test attached.
-
Hide
- posParam-bug-report-18062010.zip
- 17/Jun/10 6:40 PM
- 20 kB
- Lee Butts
-
- grails-app/conf/BootStrap.groovy 0.1 kB
- grails-app/conf/BuildConfig.groovy 1 kB
- grails-app/conf/Config.groovy 3 kB
- grails-app/conf/DataSource.groovy 0.8 kB
- grails-app/conf/UrlMappings.groovy 0.2 kB
- grails-app/conf/spring/resources.groovy 0.0 kB
- grails-app/domain/posparam/Author.groovy 0.1 kB
- grails-app/domain/posparam/Book.groovy 0.1 kB
- grails-app/i18n/messages.properties 3 kB
- grails-app/i18n/messages_da.properties 3 kB
- grails-app/i18n/messages_de.properties 4 kB
- grails-app/i18n/messages_es.properties 3 kB
- grails-app/i18n/messages_fr.properties 2 kB
- grails-app/i18n/messages_it.properties 2 kB
- grails-app/i18n/messages_ja.properties 2 kB
- grails-app/i18n/messages_nl.properties 3 kB
- grails-app/.../messages_pt_BR.properties 3 kB
- grails-app/.../messages_pt_PT.properties 3 kB
- grails-app/i18n/messages_ru.properties 4 kB
- grails-app/i18n/messages_th.properties 5 kB
- grails-app/.../messages_zh_CN.properties 2 kB
- grails-app/views/error.gsp 2 kB
- grails-app/views/index.gsp 4 kB
- grails-app/views/layouts/main.gsp 0.7 kB
- test/integration/.../ParamTests.groovy 0.4 kB
- application.properties 0.2 kB
http://github.com/grails/grails-core/commit/24302761b7d4a1f6861072baa0423db8b8cde609