Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: (boolean) parameters as search condition no longer allowed [CORE5367] #5640

Closed
firebird-issue-importer opened this issue Oct 3, 2016 · 3 comments

Comments

@firebird-issue-importer
Copy link

@firebird-issue-importer firebird-issue-importer commented Oct 3, 2016

Submitted by: @mrotteveel

In Jaybird I have a test (org.firebirdsql.jdbc.TestBooleanSupport) for
the Firebird 3 boolean support that is now broken with 3.0.1 (for
testSelect_ConditionOnly_null, testSelect_ConditionOnly_true and
testSelect_ConditionOnly_false.

The test uses the table:
CREATE TABLE withboolean ( id INTEGER, bool BOOLEAN )

and prepares a statement:
SELECT id, bool FROM withboolean WHERE ?

this now fails with the error:
Dynamic SQL Error; SQL error code = -104; Invalid usage of boolean
expression [SQLState:22000, ISC error code:335545023]

This worked fine in earlier 3.0 versions, at least since the 11th of
August 2013 when I created these tests.

A boolean parameter like this is allowed according to the SQL standard:

<where clause> ::=
WHERE <search condition>

<search condition> ::=
<boolean value expression>

<boolean value expression> ::=
<boolean term>
| ...

<boolean term> ::=
<boolean factor>
| ...

<boolean factor> ::=
[ NOT ] <boolean test>

<boolean test> ::=
<boolean primary> [ IS [ NOT ] <truth value> ]

<boolean primary> ::=
...
| <boolean predicand>

<boolean predicand> ::=
...
| <nonparenthesized value expression primary>

<nonparenthesized value expression primary> ::=
<unsigned value specification>
| ...

<unsigned value specification> ::=
...
| <general value specification>

<general value specification> ::=
...
| <dynamic parameter specification>
| ...

<dynamic parameter specification> ::=
<question mark>

Commits: a7ecf53 8a4b7e3

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Oct 4, 2016

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 4.0 Alpha 1 [ 10731 ]

Fix Version: 3.0.2 [ 10785 ]

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Oct 4, 2016

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Done successfully

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Oct 4, 2016

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants