EnterpriseDB: The Enterprise Postgres Company Postgres Plus Forums: The PostgreSQL Open Source Database from EnterpriseDB
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 

BIT type literal parsing fail?  XML

Forum Index » GridSQL - Developers
Author Message
A_C_7

New member

Joined: 9 Jan 2010 21:50:02
Messages: 5
Offline

I'm trying to execute this rather simple SELECT statement:

SELECT a FROM "Category" t0 WHERE t0.a & b'101' = b'101' LIMIT 10

where "a" is a field type BIT, which according to GridSQL SQL Reference is supported.

I keep getting the following error:

[severe] java.sql.SQLException: ERROR: Cannot Determine The Expression For (EXPRESSION)("t0"."a" & b'101')
at com.edb.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2306)
at com.edb.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1931)
at com.edb.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:643)
at com.edb.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:476)
at com.edb.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:390)
at com.edb.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:340)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.edb.ds.common.PooledConnectionImpl$StatementHandler.invoke(PooledConnectionImpl.java:414)
at $Proxy1.execute(Unknown Source)

GridSQL build: 1.1b
Excerpt from console.log:

com.edb.gridsql.parser.core.ParseException: Cannot Determine The Expression For (EXPRESSION)("t0"."a" & b'101')
at com.edb.gridsql.parser.Parser.parse(Unknown Source)
at com.edb.gridsql.parser.Parser.parseStatement(Unknown Source)
at com.edb.gridsql.protocol.RequestAnalyzer.getExecutableRequest(Unknown Source)
at com.edb.gridsql.protocol.PgProtocolSession.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


Oddly enough, if left part of the expression explicitly casted, the statement goes through:

SELECT a FROM "Category" t0 WHERE t0.a::int & 5 = 5 LIMIT 10

Unfortunately this workaround wouldn't work for me, because BIT field length is 1000 in my case

Please advice.

Thank you,
Anton
Mason_S

Senior member

Joined: 1 Apr 2008 09:03:08
Messages: 380
Offline

This should be fixed with this commit:

http://forums.enterprisedb.com/posts/list/2168.page

[WWW]
A_C_7

New member

Joined: 9 Jan 2010 21:50:02
Messages: 5
Offline

We fixed it internally already, but thank you very much -- I'm sure other people will appreciate your efforts as well
Regards,
Anton
Mason_S

Senior member

Joined: 1 Apr 2008 09:03:08
Messages: 380
Offline

OK, thanks.

If you discover any other bugs and also fix them, please feel free to share your changes.

Thanks,

Mason
[WWW]
 
Forum Index » GridSQL - Developers
Go to:   
Powered by JForum 2.1.8 © JForum Team