|
From: Patrick E. (JIRA) <nh...@gm...> - 2010-08-31 05:22:45
|
Template functions fail with certain combinations of arguments.
---------------------------------------------------------------
Key: NH-2318
URL: http://216.121.112.228/browse/NH-2318
Project: NHibernate
Issue Type: Bug
Components: Core
Affects Versions: 3.0.0.Alpha2
Reporter: Patrick Earl
Some template functions such as TRIM() fail since they use repeated arguments in the template. Additionally, the LEADING and TRAILING trim emulation functions have their ltrim and rtrim reversed. Included is a unit test that demonstrates that failure.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Patrick E. (JIRA) <nh...@gm...> - 2010-08-31 05:36:44
|
[ http://216.121.112.228/browse/NH-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Patrick Earl updated NH-2318:
-----------------------------
Attachment: TrimFunctionsTest.patch
> Template functions fail with certain combinations of arguments.
> ---------------------------------------------------------------
>
> Key: NH-2318
> URL: http://216.121.112.228/browse/NH-2318
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.0.0.Alpha2
> Reporter: Patrick Earl
> Attachments: TrimFunctionsTest.patch
>
>
> Some template functions such as TRIM() fail since they use repeated arguments in the template. Additionally, the LEADING and TRAILING trim emulation functions have their ltrim and rtrim reversed. Included is a unit test that demonstrates that failure.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Patrick E. (JIRA) <nh...@gm...> - 2010-09-18 20:29:31
|
[ http://216.121.112.228/browse/NH-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=19826#action_19826 ]
Patrick Earl commented on NH-2318:
----------------------------------
I split the leading and trailing backwardness into a separate issue.
> Template functions fail with certain combinations of arguments.
> ---------------------------------------------------------------
>
> Key: NH-2318
> URL: http://216.121.112.228/browse/NH-2318
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.0.0.Alpha2
> Reporter: Patrick Earl
> Attachments: TrimFunctionsTest.patch
>
>
> Some template functions such as TRIM() fail since they use repeated arguments in the template. Additionally, the LEADING and TRAILING trim emulation functions have their ltrim and rtrim reversed. Included is a unit test that demonstrates that failure.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Patrick E. (JIRA) <nh...@gm...> - 2010-09-18 20:36:29
|
[ http://216.121.112.228/browse/NH-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Patrick Earl updated NH-2318:
-----------------------------
Attachment: SqlFunctionProjectionFix.patch
The SqlFunctionProjectionFix patch makes the Criteria API work properly with custom sql functions that rearrange, duplicate, or remove arguments in the function definition.
> Template functions fail with certain combinations of arguments.
> ---------------------------------------------------------------
>
> Key: NH-2318
> URL: http://216.121.112.228/browse/NH-2318
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.0.0.Alpha2
> Reporter: Patrick Earl
> Attachments: SqlFunctionProjectionFix.patch, TrimFunctionsTest.patch
>
>
> Some template functions such as TRIM() fail since they use repeated arguments in the template. Additionally, the LEADING and TRAILING trim emulation functions have their ltrim and rtrim reversed. Included is a unit test that demonstrates that failure.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Patrick E. (JIRA) <nh...@gm...> - 2010-09-21 19:28:42
|
[ http://216.121.112.228/browse/NH-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Patrick Earl updated NH-2318:
-----------------------------
Attachment: HqlParameterReordering.patch
> Template functions fail with certain combinations of arguments.
> ---------------------------------------------------------------
>
> Key: NH-2318
> URL: http://216.121.112.228/browse/NH-2318
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.0.0.Alpha2
> Reporter: Patrick Earl
> Attachments: HqlParameterReordering.patch, SqlFunctionProjectionFix.patch, TrimFunctionsTest.patch
>
>
> Some template functions such as TRIM() fail since they use repeated arguments in the template. Additionally, the LEADING and TRAILING trim emulation functions have their ltrim and rtrim reversed. Included is a unit test that demonstrates that failure.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Patrick E. (JIRA) <nh...@gm...> - 2010-09-21 19:32:49
|
[ http://216.121.112.228/browse/NH-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=19844#action_19844 ]
Patrick Earl commented on NH-2318:
----------------------------------
HqlParameterReordering fixes the issue for named parameters in HQL. Though it doesn't provide support for ordinal parameters, even having the fix in place for named parameters is a significant advantage. It will not only fix bugs in the current code but allow for far more flexibility in defining functions for HQL. The assumption that functions use the same number of arguments in the same order is quite limiting and has already been violated several times, causing bugs.
This particular block of code need not change for ordinal parameter support either. The changes for that would be at a different level.
> Template functions fail with certain combinations of arguments.
> ---------------------------------------------------------------
>
> Key: NH-2318
> URL: http://216.121.112.228/browse/NH-2318
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.0.0.Alpha2
> Reporter: Patrick Earl
> Attachments: HqlParameterReordering.patch, SqlFunctionProjectionFix.patch, TrimFunctionsTest.patch
>
>
> Some template functions such as TRIM() fail since they use repeated arguments in the template. Additionally, the LEADING and TRAILING trim emulation functions have their ltrim and rtrim reversed. Included is a unit test that demonstrates that failure.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Richard B. (JIRA) <nh...@gm...> - 2010-09-22 21:03:44
|
[ http://216.121.112.228/browse/NH-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Richard Brown reassigned NH-2318:
---------------------------------
Assignee: Richard Brown
> Template functions fail with certain combinations of arguments.
> ---------------------------------------------------------------
>
> Key: NH-2318
> URL: http://216.121.112.228/browse/NH-2318
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.0.0.Alpha2
> Reporter: Patrick Earl
> Assignee: Richard Brown
> Attachments: HqlParameterReordering.patch, SqlFunctionProjectionFix.patch, TrimFunctionsTest.patch
>
>
> Some template functions such as TRIM() fail since they use repeated arguments in the template. Additionally, the LEADING and TRAILING trim emulation functions have their ltrim and rtrim reversed. Included is a unit test that demonstrates that failure.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Patrick E. (JIRA) <nh...@gm...> - 2010-09-26 16:27:37
|
[ http://216.121.112.228/browse/NH-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=19930#action_19930 ]
Patrick Earl commented on NH-2318:
----------------------------------
I did more playing around with the ordinal parameters. It seemed like there was a lot of essentially duplicate code to deal with the two code paths of ordinal and named parameters. I had some thoughts around the parameter support:
1. There should be a pre-processing step that converts ordinal parameters into named parameters. Since we will potentially want to add / remove parameters later in the processing chain, this should also be the point at which the hql parameter lists are verified against the query contents.
2. All internal processing should be performed against these special named parameters.
3. For the purposes of internal processing, it should be possible to manipulate the parameter list (even adding new parameters) when doing things like ISQLFunction or Linq mapping. It shouldn't be a fixed list that's passed in from the top level that happens to get mapped to various positions in the query. Rather, it should start as a fixed list from the query and be modified by the processing chains.
4. If the database supports named parameters, just execute the query. If not, translate and duplicate the named parameters back into ordinal parameters before executing the query.
5. For things like ISQLFunction, it may be useful to add a "volatile" marker that indicates that the query cache should be bypassed. That way, if the function needs to do processing based on parameter values, it won't break because it was cached and run against different parameters. As an example, to implement NullSafeEquals(x, y), on MSSQL one needs to do something like "(x IS NULL OR y IS NULL) or (x IS NOT NULL AND y IS NOT NULL AND x = y)", but if y is null, you could simply convert it to x IS NULL, making the database query far more efficient, especially if x is a complicated expression.
I'd be happy to chat sometime if you're looking for a sounding board or some brainstorming. Let me know if you'd like help with anything.
> Template functions fail with certain combinations of arguments.
> ---------------------------------------------------------------
>
> Key: NH-2318
> URL: http://216.121.112.228/browse/NH-2318
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.0.0.Alpha2
> Reporter: Patrick Earl
> Assignee: Richard Brown
> Attachments: HqlParameterReordering.patch, SqlFunctionProjectionFix.patch, TrimFunctionsTest.patch
>
>
> Some template functions such as TRIM() fail since they use repeated arguments in the template. Additionally, the LEADING and TRAILING trim emulation functions have their ltrim and rtrim reversed. Included is a unit test that demonstrates that failure.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Patrick E. (JIRA) <nh...@gm...> - 2010-09-26 16:42:34
|
[ http://216.121.112.228/browse/NH-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Patrick Earl updated NH-2318:
-----------------------------
Attachment: TrimFunctionsTest2.patch
I've included a new test that also tests Linq and more combinations including nesting function calls. All the tests in there pass, except for the three at the bottom that have the ordinal parameters.
> Template functions fail with certain combinations of arguments.
> ---------------------------------------------------------------
>
> Key: NH-2318
> URL: http://216.121.112.228/browse/NH-2318
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.0.0.Alpha2
> Reporter: Patrick Earl
> Assignee: Richard Brown
> Attachments: HqlParameterReordering.patch, SqlFunctionProjectionFix.patch, TrimFunctionsTest.patch, TrimFunctionsTest2.patch
>
>
> Some template functions such as TRIM() fail since they use repeated arguments in the template. Additionally, the LEADING and TRAILING trim emulation functions have their ltrim and rtrim reversed. Included is a unit test that demonstrates that failure.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Patrick E. (JIRA) <nh...@gm...> - 2010-10-31 02:29:39
|
[ http://216.121.112.228/browse/NH-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Patrick Earl updated NH-2318:
-----------------------------
Attachment: ISqlFunctionParameterReordering.patch
ISqlFunctionParameterReordering.patch combines all previous changes and will apply cleanly against the current trunk. IMHO, this patch provides significant benefit as it provides a straight-forward path for the LINQ provider to delegate the handling of null-safe equality to the dialect. This would allow databases to use "<=>" and "IS NOT DISTINCT FROM" instead of the very long, and likely unperformant, "(A is null and B is null) or (A is not null and B is not null and A = B)".
> Template functions fail with certain combinations of arguments.
> ---------------------------------------------------------------
>
> Key: NH-2318
> URL: http://216.121.112.228/browse/NH-2318
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.0.0.Alpha2
> Reporter: Patrick Earl
> Assignee: Richard Brown
> Attachments: HqlParameterReordering.patch, ISqlFunctionParameterReordering.patch, SqlFunctionProjectionFix.patch, TrimFunctionsTest.patch, TrimFunctionsTest2.patch
>
>
> Some template functions such as TRIM() fail since they use repeated arguments in the template. Additionally, the LEADING and TRAILING trim emulation functions have their ltrim and rtrim reversed. Included is a unit test that demonstrates that failure.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Patrick E. (JIRA) <nh...@gm...> - 2011-01-29 19:41:13
|
[ http://216.121.112.228/browse/NH-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Patrick Earl reassigned NH-2318:
--------------------------------
Assignee: Patrick Earl (was: Richard Brown)
> Template functions fail with certain combinations of arguments.
> ---------------------------------------------------------------
>
> Key: NH-2318
> URL: http://216.121.112.228/browse/NH-2318
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.0.0.Alpha2
> Reporter: Patrick Earl
> Assignee: Patrick Earl
> Attachments: HqlParameterReordering.patch, ISqlFunctionParameterReordering.patch, SqlFunctionProjectionFix.patch, TrimFunctionsTest.patch, TrimFunctionsTest2.patch
>
>
> Some template functions such as TRIM() fail since they use repeated arguments in the template. Additionally, the LEADING and TRAILING trim emulation functions have their ltrim and rtrim reversed. Included is a unit test that demonstrates that failure.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Fabio M. (JIRA) <nh...@gm...> - 2011-05-30 17:25:45
|
[ http://216.121.112.228/browse/NH-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21226#action_21226 ]
Fabio Maulo commented on NH-2318:
---------------------------------
Fixed for HQL and LINQ in NH3.2.0Beta2
> Template functions fail with certain combinations of arguments.
> ---------------------------------------------------------------
>
> Key: NH-2318
> URL: http://216.121.112.228/browse/NH-2318
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.0.0.Alpha2
> Reporter: Patrick Earl
> Assignee: Patrick Earl
> Attachments: HqlParameterReordering.patch, ISqlFunctionParameterReordering.patch, SqlFunctionProjectionFix.patch, TrimFunctionsTest.patch, TrimFunctionsTest2.patch
>
>
> Some template functions such as TRIM() fail since they use repeated arguments in the template. Additionally, the LEADING and TRAILING trim emulation functions have their ltrim and rtrim reversed. Included is a unit test that demonstrates that failure.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Patrick E. (JIRA) <nh...@gm...> - 2011-06-06 16:23:05
|
[ http://216.121.112.228/browse/NH-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Patrick Earl resolved NH-2318.
------------------------------
Resolution: Fixed
Fix Version/s: 3.2.0Beta2
> Template functions fail with certain combinations of arguments.
> ---------------------------------------------------------------
>
> Key: NH-2318
> URL: http://216.121.112.228/browse/NH-2318
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.0.0.Alpha2
> Reporter: Patrick Earl
> Assignee: Patrick Earl
> Fix For: 3.2.0Beta2
>
> Attachments: HqlParameterReordering.patch, ISqlFunctionParameterReordering.patch, SqlFunctionProjectionFix.patch, TrimFunctionsTest.patch, TrimFunctionsTest2.patch
>
>
> Some template functions such as TRIM() fail since they use repeated arguments in the template. Additionally, the LEADING and TRAILING trim emulation functions have their ltrim and rtrim reversed. Included is a unit test that demonstrates that failure.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|