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

Result of boolean expression can not be concatenated with string literal [CORE5408] #5681

Closed
firebird-issue-importer opened this issue Nov 28, 2016 · 4 comments

Comments

@firebird-issue-importer

Submitted by: @pavel-zotov

SQL> select true || 'aaa' from rdb$database;

CONCATENATION

TRUEaaa

(OK, expected)

SQL> select (true = true)|| 'aaa' from rdb$database;
Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 1, column 21
-||

SQL> select (true is true)|| 'aaa' from rdb$database;
Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 1, column 22
-||

SQL> select 'aaa' || true from rdb$database;

CONCATENATION

aaaTRUE

(OK, expected; note that here order of boolean and string is changed comparing with sample #⁠1)

SQL> select 'aaa' || (true = true) from rdb$database;
Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 1, column 23
-=

SQL> select 'aaa' || (true is true) from rdb$database;
Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 1, column 23
-is

Commits: 5f6d20c 64fa7dc

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 12, 2016

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 13, 2016

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

Fix Version: 4.0 Alpha 1 [ 10731 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 15, 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 Dec 17, 2016

Commented by: @mrotteveel

From the perspective of the SQL standard, concatenation of types other than a string type would require an explicit cast, because the concatenation operator is only defined between strings (and between arrays).

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