[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2234) 'mod' implementation in SQL Server dialect missing parenthesis

Yossi Tamari (JIRA) noreply at atlassian.com
Wed Nov 15 13:34:04 EST 2006


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2234?page=comments#action_25308 ] 

Yossi Tamari commented on HHH-2234:
-----------------------------------

Actually, both parameters should be in parenthesis.

> 'mod' implementation in SQL Server dialect missing parenthesis
> --------------------------------------------------------------
>
>          Key: HHH-2234
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2234
>      Project: Hibernate3
>         Type: Bug

>   Components: core
>     Versions: 3.2.0.ga
>  Environment: MS SQL Server
>     Reporter: Yossi Tamari
>     Priority: Minor

>
> Original Estimate: 1 minute
>         Remaining: 1 minute
>
> In the implementation of the 'mod' function in SQLServerDialect, if the first parameter is an expression, a precedence error could occur.
> For example mod(5+2, 3) is translated to 5 +2 % 3 which yield 7 instead of 1. to fix it add parenthesis around the first parameter always.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira




More information about the hibernate-issues mailing list