[jira] Created: (OPENJPA-1133) DBDictionary.getPlaceholderValueString returns 0 for boolean which fails in PostgreSQL database.

8 messages Options
Embed this post
Permalink
JIRA jira@apache.org

[jira] Created: (OPENJPA-1133) DBDictionary.getPlaceholderValueString returns 0 for boolean which fails in PostgreSQL database.

Reply Threaded More More options
Print post
Permalink
DBDictionary.getPlaceholderValueString returns 0 for boolean which fails in PostgreSQL database.
------------------------------------------------------------------------------------------------

                 Key: OPENJPA-1133
                 URL: https://issues.apache.org/jira/browse/OPENJPA-1133
             Project: OpenJPA
          Issue Type: Bug
          Components: query
    Affects Versions: 2.0.0
         Environment: openJPA trunk.
PostgreSQL 8.3
            Reporter: Ravi P Palacherla


When DBDictionary.getPlaceholderValueString is called with Types.BIT, it returns "0".
PostgreSQL actually requires that a boolean be set. It cannot handle a numeric argument.

Fix Description:
Overriden DBDictionary.getPlaceholderValueString() inside PostgresDictionary to process Types.BIT correctly.
Now, the method returns 'false' value when Types.BIT is passed as Column.type.

Test case:
I am unable to provide a test case.
The above bug is exposed from Kodo product which internally uses openJPA.
When a query is made on a subclass using kodo api.
Kodo generates an SQL ( with help of openJPA) that has UNION in it.

It generates a SQL similar to the following:

 SELECT 0  FROM public.typeofvessel t0 UNION ALL SELECT t0.guidance FROM public.typeofweapon t0
 
It got 0 from the openJPA DBDictionary.getPlaceholderValueString as the guidance data type is boolean.

The above SQL will throw an exception in postgreSQL db saying:
ERROR: UNION types integer and boolean cannot be matched.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

JIRA jira@apache.org

[jira] Updated: (OPENJPA-1133) DBDictionary.getPlaceholderValueString returns 0 for boolean which fails in PostgreSQL database.

Reply Threaded More More options
Print post
Permalink

     [ https://issues.apache.org/jira/browse/OPENJPA-1133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ravi P Palacherla updated OPENJPA-1133:
---------------------------------------

    Description:
When DBDictionary.getPlaceholderValueString is called with Types.BIT, it returns "0".
PostgreSQL actually requires that a boolean be set. It cannot handle a numeric argument.

Fix Description:
Overriden DBDictionary.getPlaceholderValueString() inside PostgresDictionary to process Types.BIT correctly.
Now, the method returns 'false' value when Types.BIT is passed as Column.type.

Test case:
I am unable to provide a test case.
The above bug is exposed from Kodo product which internally uses openJPA.
When a query is made on a subclass using kodo api.
Kodo generates an SQL ( with help of openJPA) that has UNION in it.

It generates a SQL similar to the following:

 SELECT 0  FROM public.classA t0 UNION ALL SELECT t0.guidance FROM public.classB t0
 
It got 0 from the openJPA DBDictionary.getPlaceholderValueString as the guidance data type is boolean.

The above SQL will throw an exception in postgreSQL db saying:
ERROR: UNION types integer and boolean cannot be matched.

  was:
When DBDictionary.getPlaceholderValueString is called with Types.BIT, it returns "0".
PostgreSQL actually requires that a boolean be set. It cannot handle a numeric argument.

Fix Description:
Overriden DBDictionary.getPlaceholderValueString() inside PostgresDictionary to process Types.BIT correctly.
Now, the method returns 'false' value when Types.BIT is passed as Column.type.

Test case:
I am unable to provide a test case.
The above bug is exposed from Kodo product which internally uses openJPA.
When a query is made on a subclass using kodo api.
Kodo generates an SQL ( with help of openJPA) that has UNION in it.

It generates a SQL similar to the following:

 SELECT 0  FROM public.typeofvessel t0 UNION ALL SELECT t0.guidance FROM public.typeofweapon t0
 
It got 0 from the openJPA DBDictionary.getPlaceholderValueString as the guidance data type is boolean.

The above SQL will throw an exception in postgreSQL db saying:
ERROR: UNION types integer and boolean cannot be matched.


> DBDictionary.getPlaceholderValueString returns 0 for boolean which fails in PostgreSQL database.
> ------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1133
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1133
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: query
>    Affects Versions: 2.0.0
>         Environment: openJPA trunk.
> PostgreSQL 8.3
>            Reporter: Ravi P Palacherla
>
> When DBDictionary.getPlaceholderValueString is called with Types.BIT, it returns "0".
> PostgreSQL actually requires that a boolean be set. It cannot handle a numeric argument.
> Fix Description:
> Overriden DBDictionary.getPlaceholderValueString() inside PostgresDictionary to process Types.BIT correctly.
> Now, the method returns 'false' value when Types.BIT is passed as Column.type.
> Test case:
> I am unable to provide a test case.
> The above bug is exposed from Kodo product which internally uses openJPA.
> When a query is made on a subclass using kodo api.
> Kodo generates an SQL ( with help of openJPA) that has UNION in it.
> It generates a SQL similar to the following:
>  SELECT 0  FROM public.classA t0 UNION ALL SELECT t0.guidance FROM public.classB t0
>  
> It got 0 from the openJPA DBDictionary.getPlaceholderValueString as the guidance data type is boolean.
> The above SQL will throw an exception in postgreSQL db saying:
> ERROR: UNION types integer and boolean cannot be matched.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

JIRA jira@apache.org

[jira] Assigned: (OPENJPA-1133) DBDictionary.getPlaceholderValueString returns 0 for boolean which fails in PostgreSQL database.

Reply Threaded More More options
Print post
Permalink
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/OPENJPA-1133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ravi P Palacherla reassigned OPENJPA-1133:
------------------------------------------

    Assignee: Ravi P Palacherla

> DBDictionary.getPlaceholderValueString returns 0 for boolean which fails in PostgreSQL database.
> ------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1133
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1133
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: query
>    Affects Versions: 2.0.0
>         Environment: openJPA trunk.
> PostgreSQL 8.3
>            Reporter: Ravi P Palacherla
>            Assignee: Ravi P Palacherla
>         Attachments: OPENJPA-1133_trunk.patch
>
>
> When DBDictionary.getPlaceholderValueString is called with Types.BIT, it returns "0".
> PostgreSQL actually requires that a boolean be set. It cannot handle a numeric argument.
> Fix Description:
> Overriden DBDictionary.getPlaceholderValueString() inside PostgresDictionary to process Types.BIT correctly.
> Now, the method returns 'false' value when Types.BIT is passed as Column.type.
> Test case:
> I am unable to provide a test case.
> The above bug is exposed from Kodo product which internally uses openJPA.
> When a query is made on a subclass using kodo api.
> Kodo generates an SQL ( with help of openJPA) that has UNION in it.
> It generates a SQL similar to the following:
>  SELECT 0  FROM public.classA t0 UNION ALL SELECT t0.guidance FROM public.classB t0
>  
> It got 0 from the openJPA DBDictionary.getPlaceholderValueString as the guidance data type is boolean.
> The above SQL will throw an exception in postgreSQL db saying:
> ERROR: UNION types integer and boolean cannot be matched.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

JIRA jira@apache.org

[jira] Updated: (OPENJPA-1133) DBDictionary.getPlaceholderValueString returns 0 for boolean which fails in PostgreSQL database.

Reply Threaded More More options
Print post
Permalink
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/OPENJPA-1133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ravi P Palacherla updated OPENJPA-1133:
---------------------------------------

    Description:
When DBDictionary.getPlaceholderValueString is called with Types.BIT, it returns "0".
PostgreSQL actually requires that a boolean be set. It cannot handle a numeric argument.

Fix Description:
Overriden DBDictionary.getPlaceholderValueString() inside PostgresDictionary to process Types.BIT correctly.
Now, the method returns 'false' value when Types.BIT is passed as Column.type.

Test case:
The above bug is exposed from Kodo product which internally uses openJPA.
When a query is made on a subclass using kodo api.
Kodo generates an SQL ( with help of openJPA) that has UNION in it.

It generates a SQL similar to the following:

 SELECT 0  FROM public.classA t0 UNION ALL SELECT t0.guidance FROM public.classB t0
 
It got 0 from the openJPA DBDictionary.getPlaceholderValueString as the guidance data type is boolean.

The above SQL will throw an exception in postgreSQL db saying:
ERROR: UNION types integer and boolean cannot be matched.

  was:
When DBDictionary.getPlaceholderValueString is called with Types.BIT, it returns "0".
PostgreSQL actually requires that a boolean be set. It cannot handle a numeric argument.

Fix Description:
Overriden DBDictionary.getPlaceholderValueString() inside PostgresDictionary to process Types.BIT correctly.
Now, the method returns 'false' value when Types.BIT is passed as Column.type.

Test case:
I am unable to provide a test case.
The above bug is exposed from Kodo product which internally uses openJPA.
When a query is made on a subclass using kodo api.
Kodo generates an SQL ( with help of openJPA) that has UNION in it.

It generates a SQL similar to the following:

 SELECT 0  FROM public.classA t0 UNION ALL SELECT t0.guidance FROM public.classB t0
 
It got 0 from the openJPA DBDictionary.getPlaceholderValueString as the guidance data type is boolean.

The above SQL will throw an exception in postgreSQL db saying:
ERROR: UNION types integer and boolean cannot be matched.

     Patch Info: [Patch Available]

> DBDictionary.getPlaceholderValueString returns 0 for boolean which fails in PostgreSQL database.
> ------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1133
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1133
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: query
>    Affects Versions: 2.0.0
>         Environment: openJPA trunk.
> PostgreSQL 8.3
>            Reporter: Ravi P Palacherla
>            Assignee: Ravi P Palacherla
>         Attachments: OPENJPA-1133_trunk.patch
>
>
> When DBDictionary.getPlaceholderValueString is called with Types.BIT, it returns "0".
> PostgreSQL actually requires that a boolean be set. It cannot handle a numeric argument.
> Fix Description:
> Overriden DBDictionary.getPlaceholderValueString() inside PostgresDictionary to process Types.BIT correctly.
> Now, the method returns 'false' value when Types.BIT is passed as Column.type.
> Test case:
> The above bug is exposed from Kodo product which internally uses openJPA.
> When a query is made on a subclass using kodo api.
> Kodo generates an SQL ( with help of openJPA) that has UNION in it.
> It generates a SQL similar to the following:
>  SELECT 0  FROM public.classA t0 UNION ALL SELECT t0.guidance FROM public.classB t0
>  
> It got 0 from the openJPA DBDictionary.getPlaceholderValueString as the guidance data type is boolean.
> The above SQL will throw an exception in postgreSQL db saying:
> ERROR: UNION types integer and boolean cannot be matched.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

JIRA jira@apache.org

[jira] Updated: (OPENJPA-1133) DBDictionary.getPlaceholderValueString returns 0 for boolean which fails in PostgreSQL database.

Reply Threaded More More options
Print post
Permalink
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/OPENJPA-1133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ravi P Palacherla updated OPENJPA-1133:
---------------------------------------

    Attachment: OPENJPA-1133_trunk.patch

Attached patch contains test case and fix on trunk.

> DBDictionary.getPlaceholderValueString returns 0 for boolean which fails in PostgreSQL database.
> ------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1133
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1133
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: query
>    Affects Versions: 2.0.0
>         Environment: openJPA trunk.
> PostgreSQL 8.3
>            Reporter: Ravi P Palacherla
>            Assignee: Ravi P Palacherla
>         Attachments: OPENJPA-1133_trunk.patch
>
>
> When DBDictionary.getPlaceholderValueString is called with Types.BIT, it returns "0".
> PostgreSQL actually requires that a boolean be set. It cannot handle a numeric argument.
> Fix Description:
> Overriden DBDictionary.getPlaceholderValueString() inside PostgresDictionary to process Types.BIT correctly.
> Now, the method returns 'false' value when Types.BIT is passed as Column.type.
> Test case:
> I am unable to provide a test case.
> The above bug is exposed from Kodo product which internally uses openJPA.
> When a query is made on a subclass using kodo api.
> Kodo generates an SQL ( with help of openJPA) that has UNION in it.
> It generates a SQL similar to the following:
>  SELECT 0  FROM public.classA t0 UNION ALL SELECT t0.guidance FROM public.classB t0
>  
> It got 0 from the openJPA DBDictionary.getPlaceholderValueString as the guidance data type is boolean.
> The above SQL will throw an exception in postgreSQL db saying:
> ERROR: UNION types integer and boolean cannot be matched.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

JIRA jira@apache.org

[jira] Commented: (OPENJPA-1133) DBDictionary.getPlaceholderValueString returns 0 for boolean which fails in PostgreSQL database.

Reply Threaded More More options
Print post
Permalink
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/OPENJPA-1133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12720104#action_12720104 ]

Ravi P Palacherla commented on OPENJPA-1133:
--------------------------------------------

Hi,

Can someone please commit these changes.

Thanks,
Ravi.

> DBDictionary.getPlaceholderValueString returns 0 for boolean which fails in PostgreSQL database.
> ------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1133
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1133
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: query
>    Affects Versions: 2.0.0
>         Environment: openJPA trunk.
> PostgreSQL 8.3
>            Reporter: Ravi P Palacherla
>            Assignee: Ravi P Palacherla
>         Attachments: OPENJPA-1133_trunk.patch
>
>
> When DBDictionary.getPlaceholderValueString is called with Types.BIT, it returns "0".
> PostgreSQL actually requires that a boolean be set. It cannot handle a numeric argument.
> Fix Description:
> Overriden DBDictionary.getPlaceholderValueString() inside PostgresDictionary to process Types.BIT correctly.
> Now, the method returns 'false' value when Types.BIT is passed as Column.type.
> Test case:
> The above bug is exposed from Kodo product which internally uses openJPA.
> When a query is made on a subclass using kodo api.
> Kodo generates an SQL ( with help of openJPA) that has UNION in it.
> It generates a SQL similar to the following:
>  SELECT 0  FROM public.classA t0 UNION ALL SELECT t0.guidance FROM public.classB t0
>  
> It got 0 from the openJPA DBDictionary.getPlaceholderValueString as the guidance data type is boolean.
> The above SQL will throw an exception in postgreSQL db saying:
> ERROR: UNION types integer and boolean cannot be matched.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

JIRA jira@apache.org

[jira] Resolved: (OPENJPA-1133) DBDictionary.getPlaceholderValueString returns 0 for boolean which fails in PostgreSQL database.

Reply Threaded More More options
Print post
Permalink
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/OPENJPA-1133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Dick resolved OPENJPA-1133.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.0
                   1.3.0

Thanks for the patch Ravi.

> DBDictionary.getPlaceholderValueString returns 0 for boolean which fails in PostgreSQL database.
> ------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1133
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1133
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: query
>    Affects Versions: 2.0.0
>         Environment: openJPA trunk.
> PostgreSQL 8.3
>            Reporter: Ravi P Palacherla
>            Assignee: Ravi P Palacherla
>             Fix For: 1.3.0, 2.0.0
>
>         Attachments: OPENJPA-1133_trunk.patch
>
>
> When DBDictionary.getPlaceholderValueString is called with Types.BIT, it returns "0".
> PostgreSQL actually requires that a boolean be set. It cannot handle a numeric argument.
> Fix Description:
> Overriden DBDictionary.getPlaceholderValueString() inside PostgresDictionary to process Types.BIT correctly.
> Now, the method returns 'false' value when Types.BIT is passed as Column.type.
> Test case:
> The above bug is exposed from Kodo product which internally uses openJPA.
> When a query is made on a subclass using kodo api.
> Kodo generates an SQL ( with help of openJPA) that has UNION in it.
> It generates a SQL similar to the following:
>  SELECT 0  FROM public.classA t0 UNION ALL SELECT t0.guidance FROM public.classB t0
>  
> It got 0 from the openJPA DBDictionary.getPlaceholderValueString as the guidance data type is boolean.
> The above SQL will throw an exception in postgreSQL db saying:
> ERROR: UNION types integer and boolean cannot be matched.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

JIRA jira@apache.org

[jira] Updated: (OPENJPA-1133) DBDictionary.getPlaceholderValueString returns 0 for boolean which fails in PostgreSQL database.

Reply Threaded More More options
Print post
Permalink
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/OPENJPA-1133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Ezzio updated OPENJPA-1133:
---------------------------------

    Fix Version/s: 1.1.1

From trunk, merged fix to 1.1.x branch at revs 802213 and 802214

> DBDictionary.getPlaceholderValueString returns 0 for boolean which fails in PostgreSQL database.
> ------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1133
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1133
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: query
>    Affects Versions: 2.0.0
>         Environment: openJPA trunk.
> PostgreSQL 8.3
>            Reporter: Ravi P Palacherla
>            Assignee: Ravi P Palacherla
>             Fix For: 1.1.1, 2.0.0-M3
>
>         Attachments: OPENJPA-1133_trunk.patch
>
>
> When DBDictionary.getPlaceholderValueString is called with Types.BIT, it returns "0".
> PostgreSQL actually requires that a boolean be set. It cannot handle a numeric argument.
> Fix Description:
> Overriden DBDictionary.getPlaceholderValueString() inside PostgresDictionary to process Types.BIT correctly.
> Now, the method returns 'false' value when Types.BIT is passed as Column.type.
> Test case:
> The above bug is exposed from Kodo product which internally uses openJPA.
> When a query is made on a subclass using kodo api.
> Kodo generates an SQL ( with help of openJPA) that has UNION in it.
> It generates a SQL similar to the following:
>  SELECT 0  FROM public.classA t0 UNION ALL SELECT t0.guidance FROM public.classB t0
>  
> It got 0 from the openJPA DBDictionary.getPlaceholderValueString as the guidance data type is boolean.
> The above SQL will throw an exception in postgreSQL db saying:
> ERROR: UNION types integer and boolean cannot be matched.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.