This is an automated email from the ASF dual-hosted git repository.
borinquenkid pushed a commit to branch fix/gorm-numeric-column-dialect-precision
in repository https://gitbox.apache.org/repos/asf/grails-core.git
The following commit(s) were added to
refs/heads/fix/gorm-numeric-column-dialect-precision by this push:
new b711dd5bcc test: address review feedback on numeric precision fix
b711dd5bcc is described below
commit b711dd5bcca641326433dcad79518f42897bcd68
Author: Walter Duque de Estrada <[email protected]>
AuthorDate: Mon Jul 20 23:41:20 2026 -0500
test: address review feedback on numeric precision fix
- Lock in that min/max constraints don't leak into Float/Double
precision, per review request on #16026 to cover that scenario
explicitly rather than only the no-constraint case.
- Drop the redundant container.start() guard in
GormNumericTypeColumnIntegrationSpec: @Testcontainers already starts
every @Shared container for the whole spec regardless of the where:
row, so the guard never does anything.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
---
.../GormNumericTypeColumnIntegrationSpec.groovy | 3 ---
.../NumericColumnConstraintsBinderSpec.groovy | 17 +++++++++++++++++
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git
a/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/GormNumericTypeColumnIntegrationSpec.groovy
b/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/GormNumericTypeColumnIntegrationSpec.groovy
index ad881233d5..32f38a807a 100644
---
a/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/GormNumericTypeColumnIntegrationSpec.groovy
+++
b/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/GormNumericTypeColumnIntegrationSpec.groovy
@@ -49,9 +49,6 @@ class GormNumericTypeColumnIntegrationSpec extends
HibernateGormDatastoreSpec {
void "a Float/Double/BigDecimal property with no explicit precision
produces creatable DDL on #db"() {
given:
- if (!container.isRunning()) {
- container.start()
- }
// Ensure a completely fresh datastore per dialect, as in
RLikeHibernate7Spec.
manager.destroy()
manager.grailsConfig = [
diff --git
a/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/NumericColumnConstraintsBinderSpec.groovy
b/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/NumericColumnConstraintsBinderSpec.groovy
index 7585bd84f5..0d940f7d6f 100644
---
a/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/NumericColumnConstraintsBinderSpec.groovy
+++
b/grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/cfg/domainbinding/NumericColumnConstraintsBinderSpec.groovy
@@ -117,6 +117,23 @@ class NumericColumnConstraintsBinderSpec extends
Specification {
column.precision == null
}
+ def "should leave Float/Double precision unset even when min/max
constraints are present"() {
+ given:
+ def cc = new ColumnConfig()
+ def pc = new PropertyConfig()
+ pc.min = -100
+ pc.max = 1000
+
+ when:
+ binder.bindNumericColumnConstraints(column, cc, pc, propertyType)
+
+ then: 'min/max only drives decimal precision - it must not leak into
float/double precision'
+ column.precision == null
+
+ where:
+ propertyType << [Float, Double]
+ }
+
def "should still honor an explicit column-config precision for
Float/Double"() {
given:
def cc = new ColumnConfig()