Issue Details (XML | Word | Printable)

Key: CORE-5367
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Adriano dos Santos Fernandes
Reporter: Mark Rotteveel
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Regression: (boolean) parameters as search condition no longer allowed

Created: 03/Oct/16 06:04 PM   Updated: 04/Oct/16 07:49 PM
Component/s: Engine
Affects Version/s: 3.0.1
Fix Version/s: 3.0.2, 4.0 Alpha 1

QA Status: Done successfully


 Description  « Hide
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>

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.