|
[nhibernate-issues] [NHJIRA] Created: (NH-2700)
SqlFunctionProjection does not honor parameter order
From: Andrei A. (JIRA) <nh...@gm...> - 2011-05-12 18:17:53
|
SqlFunctionProjection does not honor parameter order
----------------------------------------------------
Key: NH-2700
URL: http://216.121.112.228/browse/NH-2700
Project: NHibernate
Issue Type: Bug
Components: Core
Affects Versions: 3.2.0Alpha3, 3.2.0Alpha2, 3.2.0Alpha1, 3.1.0, 3.0.0.GA, 3.0.0.CR1, 3.0.0.Beta2, 3.0.0.Beta1, 3.0.0.Alpha3, 3.0.0.Alpha2, 3.0.0.Alpha1
Reporter: Andrei Alecu
Priority: Minor
If you define a function in a custom dialect that does not have the parameters in order and use SqlFunctionProjection, the generated sql is wrong, and does not honor parameter order.
For example:
RegisterFunction(
"AddDays",
new SQLFunctionTemplate(
NHibernateUtil.DateTime,
"dateadd(day,?2,?1)"
)
);
var proj = new SqlFunctionProjection("AddDays", NHibernateUtil.DateTime,
new IProjection[]
{
Projections.Property<ModelClass>(p=>p.Date1),
Projections.Property<ModelClass>(p=>p.Value1)
});
Generated SQL (buggy):
SELECT dateadd(day,this_.Date1,this_.Value1)
Expected SQL:
SELECT dateadd(day,this_.Value1,this_.Date1)
Using an HQL query honors parameter order properly
I will attach a failing unit test.
--
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
|
|
[nhibernate-issues] [NHJIRA] Updated: (NH-2700)
SqlFunctionProjection does not honor parameter order
From: Andrei A. (JIRA) <nh...@gm...> - 2011-05-12 18:20:56
|
[ http://216.121.112.228/browse/NH-2700?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrei Alecu updated NH-2700:
-----------------------------
Attachment: nh2700 failing test.patch
Failing test attached.
> SqlFunctionProjection does not honor parameter order
> ----------------------------------------------------
>
> Key: NH-2700
> URL: http://216.121.112.228/browse/NH-2700
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.0.0.Alpha1, 3.0.0.Alpha2, 3.0.0.Alpha3, 3.0.0.Beta1, 3.0.0.Beta2, 3.0.0.CR1, 3.0.0.GA, 3.1.0, 3.2.0Alpha1, 3.2.0Alpha2, 3.2.0Alpha3
> Reporter: Andrei Alecu
> Priority: Minor
> Attachments: nh2700 failing test.patch
>
>
> If you define a function in a custom dialect that does not have the parameters in order and use SqlFunctionProjection, the generated sql is wrong, and does not honor parameter order.
> For example:
> RegisterFunction(
> "AddDays",
> new SQLFunctionTemplate(
> NHibernateUtil.DateTime,
> "dateadd(day,?2,?1)"
>
> )
> );
> var proj = new SqlFunctionProjection("AddDays", NHibernateUtil.DateTime,
> new IProjection[]
> {
> Projections.Property<ModelClass>(p=>p.Date1),
> Projections.Property<ModelClass>(p=>p.Value1)
> });
> Generated SQL (buggy):
> SELECT dateadd(day,this_.Date1,this_.Value1)
> Expected SQL:
> SELECT dateadd(day,this_.Value1,this_.Date1)
> Using an HQL query honors parameter order properly
> I will attach a failing unit test.
--
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
|
|
[nhibernate-issues] [NHJIRA] Updated: (NH-2700)
SqlFunctionProjection does not honor parameter order
From: Fabio M. (JIRA) <nh...@gm...> - 2011-05-12 18:33:59
|
[ http://216.121.112.228/browse/NH-2700?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Fabio Maulo updated NH-2700:
----------------------------
Affects Version/s: (was: 3.2.0Alpha3)
(was: 3.2.0Alpha2)
(was: 3.2.0Alpha1)
(was: 3.0.0.GA)
(was: 3.0.0.CR1)
(was: 3.0.0.Beta2)
(was: 3.0.0.Beta1)
(was: 3.0.0.Alpha3)
(was: 3.0.0.Alpha2)
(was: 3.0.0.Alpha1)
> SqlFunctionProjection does not honor parameter order
> ----------------------------------------------------
>
> Key: NH-2700
> URL: http://216.121.112.228/browse/NH-2700
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.1.0
> Reporter: Andrei Alecu
> Priority: Minor
> Attachments: nh2700 failing test.patch
>
>
> If you define a function in a custom dialect that does not have the parameters in order and use SqlFunctionProjection, the generated sql is wrong, and does not honor parameter order.
> For example:
> RegisterFunction(
> "AddDays",
> new SQLFunctionTemplate(
> NHibernateUtil.DateTime,
> "dateadd(day,?2,?1)"
>
> )
> );
> var proj = new SqlFunctionProjection("AddDays", NHibernateUtil.DateTime,
> new IProjection[]
> {
> Projections.Property<ModelClass>(p=>p.Date1),
> Projections.Property<ModelClass>(p=>p.Value1)
> });
> Generated SQL (buggy):
> SELECT dateadd(day,this_.Date1,this_.Value1)
> Expected SQL:
> SELECT dateadd(day,this_.Value1,this_.Date1)
> Using an HQL query honors parameter order properly
> I will attach a failing unit test.
--
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-05-12 18:52:56
|
[ http://216.121.112.228/browse/NH-2700?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Patrick Earl reassigned NH-2700:
--------------------------------
Assignee: Patrick Earl
> SqlFunctionProjection does not honor parameter order
> ----------------------------------------------------
>
> Key: NH-2700
> URL: http://216.121.112.228/browse/NH-2700
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.1.0
> Reporter: Andrei Alecu
> Assignee: Patrick Earl
> Priority: Minor
> Attachments: nh2700 failing test.patch
>
>
> If you define a function in a custom dialect that does not have the parameters in order and use SqlFunctionProjection, the generated sql is wrong, and does not honor parameter order.
> For example:
> RegisterFunction(
> "AddDays",
> new SQLFunctionTemplate(
> NHibernateUtil.DateTime,
> "dateadd(day,?2,?1)"
>
> )
> );
> var proj = new SqlFunctionProjection("AddDays", NHibernateUtil.DateTime,
> new IProjection[]
> {
> Projections.Property<ModelClass>(p=>p.Date1),
> Projections.Property<ModelClass>(p=>p.Value1)
> });
> Generated SQL (buggy):
> SELECT dateadd(day,this_.Date1,this_.Value1)
> Expected SQL:
> SELECT dateadd(day,this_.Value1,this_.Date1)
> Using an HQL query honors parameter order properly
> I will attach a failing unit test.
--
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:27:41
|
[ http://216.121.112.228/browse/NH-2700?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Fabio Maulo resolved NH-2700.
-----------------------------
Resolution: Fixed
Fix Version/s: 3.2.0Beta2
Just be sure that you are not transformig a SqlString or a Parameter to a string.
> SqlFunctionProjection does not honor parameter order
> ----------------------------------------------------
>
> Key: NH-2700
> URL: http://216.121.112.228/browse/NH-2700
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.1.0
> Reporter: Andrei Alecu
> Assignee: Patrick Earl
> Priority: Minor
> Fix For: 3.2.0Beta2
>
> Attachments: nh2700 failing test.patch
>
>
> If you define a function in a custom dialect that does not have the parameters in order and use SqlFunctionProjection, the generated sql is wrong, and does not honor parameter order.
> For example:
> RegisterFunction(
> "AddDays",
> new SQLFunctionTemplate(
> NHibernateUtil.DateTime,
> "dateadd(day,?2,?1)"
>
> )
> );
> var proj = new SqlFunctionProjection("AddDays", NHibernateUtil.DateTime,
> new IProjection[]
> {
> Projections.Property<ModelClass>(p=>p.Date1),
> Projections.Property<ModelClass>(p=>p.Value1)
> });
> Generated SQL (buggy):
> SELECT dateadd(day,this_.Date1,this_.Value1)
> Expected SQL:
> SELECT dateadd(day,this_.Value1,this_.Date1)
> Using an HQL query honors parameter order properly
> I will attach a failing unit test.
--
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:29:41
|
[ http://216.121.112.228/browse/NH-2700?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Fabio Maulo reopened NH-2700:
-----------------------------
Ups!!!
Sorry, it is not fixed for Criteria
> SqlFunctionProjection does not honor parameter order
> ----------------------------------------------------
>
> Key: NH-2700
> URL: http://216.121.112.228/browse/NH-2700
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.1.0
> Reporter: Andrei Alecu
> Assignee: Patrick Earl
> Priority: Minor
> Fix For: 3.2.0Beta2
>
> Attachments: nh2700 failing test.patch
>
>
> If you define a function in a custom dialect that does not have the parameters in order and use SqlFunctionProjection, the generated sql is wrong, and does not honor parameter order.
> For example:
> RegisterFunction(
> "AddDays",
> new SQLFunctionTemplate(
> NHibernateUtil.DateTime,
> "dateadd(day,?2,?1)"
>
> )
> );
> var proj = new SqlFunctionProjection("AddDays", NHibernateUtil.DateTime,
> new IProjection[]
> {
> Projections.Property<ModelClass>(p=>p.Date1),
> Projections.Property<ModelClass>(p=>p.Value1)
> });
> Generated SQL (buggy):
> SELECT dateadd(day,this_.Date1,this_.Value1)
> Expected SQL:
> SELECT dateadd(day,this_.Value1,this_.Date1)
> Using an HQL query honors parameter order properly
> I will attach a failing unit test.
--
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
|
|
[nhibernate-issues] [NHJIRA] Updated: (NH-2700)
SqlFunctionProjection does not honor parameter order
From: Fabio M. (JIRA) <nh...@gm...> - 2011-05-31 12:20:53
|
[ http://216.121.112.228/browse/NH-2700?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Fabio Maulo updated NH-2700:
----------------------------
Fix Version/s: (was: 3.2.0Beta2)
> SqlFunctionProjection does not honor parameter order
> ----------------------------------------------------
>
> Key: NH-2700
> URL: http://216.121.112.228/browse/NH-2700
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.1.0
> Reporter: Andrei Alecu
> Assignee: Patrick Earl
> Priority: Minor
> Attachments: nh2700 failing test.patch
>
>
> If you define a function in a custom dialect that does not have the parameters in order and use SqlFunctionProjection, the generated sql is wrong, and does not honor parameter order.
> For example:
> RegisterFunction(
> "AddDays",
> new SQLFunctionTemplate(
> NHibernateUtil.DateTime,
> "dateadd(day,?2,?1)"
>
> )
> );
> var proj = new SqlFunctionProjection("AddDays", NHibernateUtil.DateTime,
> new IProjection[]
> {
> Projections.Property<ModelClass>(p=>p.Date1),
> Projections.Property<ModelClass>(p=>p.Value1)
> });
> Generated SQL (buggy):
> SELECT dateadd(day,this_.Date1,this_.Value1)
> Expected SQL:
> SELECT dateadd(day,this_.Value1,this_.Date1)
> Using an HQL query honors parameter order properly
> I will attach a failing unit test.
--
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-05-31 16:05:50
|
[ http://216.121.112.228/browse/NH-2700?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Patrick Earl reassigned NH-2700:
--------------------------------
Assignee: (was: Patrick Earl)
> SqlFunctionProjection does not honor parameter order
> ----------------------------------------------------
>
> Key: NH-2700
> URL: http://216.121.112.228/browse/NH-2700
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.1.0
> Reporter: Andrei Alecu
> Priority: Minor
> Attachments: nh2700 failing test.patch
>
>
> If you define a function in a custom dialect that does not have the parameters in order and use SqlFunctionProjection, the generated sql is wrong, and does not honor parameter order.
> For example:
> RegisterFunction(
> "AddDays",
> new SQLFunctionTemplate(
> NHibernateUtil.DateTime,
> "dateadd(day,?2,?1)"
>
> )
> );
> var proj = new SqlFunctionProjection("AddDays", NHibernateUtil.DateTime,
> new IProjection[]
> {
> Projections.Property<ModelClass>(p=>p.Date1),
> Projections.Property<ModelClass>(p=>p.Value1)
> });
> Generated SQL (buggy):
> SELECT dateadd(day,this_.Date1,this_.Value1)
> Expected SQL:
> SELECT dateadd(day,this_.Value1,this_.Date1)
> Using an HQL query honors parameter order properly
> I will attach a failing unit test.
--
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-06-19 21:07:08
|
[ http://216.121.112.228/browse/NH-2700?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Fabio Maulo resolved NH-2700.
-----------------------------
Resolution: Fixed
Fix Version/s: 3.2.0Beta2
Fixed with the whole refactoring of parameters management.
> SqlFunctionProjection does not honor parameter order
> ----------------------------------------------------
>
> Key: NH-2700
> URL: http://216.121.112.228/browse/NH-2700
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.1.0
> Reporter: Andrei Alecu
> Priority: Minor
> Fix For: 3.2.0Beta2
>
> Attachments: nh2700 failing test.patch
>
>
> If you define a function in a custom dialect that does not have the parameters in order and use SqlFunctionProjection, the generated sql is wrong, and does not honor parameter order.
> For example:
> RegisterFunction(
> "AddDays",
> new SQLFunctionTemplate(
> NHibernateUtil.DateTime,
> "dateadd(day,?2,?1)"
>
> )
> );
> var proj = new SqlFunctionProjection("AddDays", NHibernateUtil.DateTime,
> new IProjection[]
> {
> Projections.Property<ModelClass>(p=>p.Date1),
> Projections.Property<ModelClass>(p=>p.Value1)
> });
> Generated SQL (buggy):
> SELECT dateadd(day,this_.Date1,this_.Value1)
> Expected SQL:
> SELECT dateadd(day,this_.Value1,this_.Date1)
> Using an HQL query honors parameter order properly
> I will attach a failing unit test.
--
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
|