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

Error with IF (subfunc()) when subfunc returns a boolean [CORE4234] #4558

Closed
firebird-issue-importer opened this issue Sep 22, 2013 · 4 comments

Comments

@firebird-issue-importer

Submitted by: @sim1984

Use CONNECT or CREATE DATABASE to specify a database
SQL> connect 'localhost/3051:horses' user 'sysdba' password 'masterkey';
Database: 'localhost/3051:horses', User: sysdba
SQL> set term ^;
SQL> execute block
CON> returns (c integer)
CON> as
CON> DECLARE VARIABLE b boolean;
CON> DECLARE function f1() returns boolean as
CON> begin
CON> return true;
CON> end
CON> begin
CON> c = 0;
CON> b = f1();
CON> --IF (f1()) THEN c = 1;
CON> IF (b) THEN c = 1;
CON> suspend;
CON> end^

       C

============
1

SQL> execute block
CON> returns (c integer)
CON> as
CON> DECLARE VARIABLE b boolean;
CON> DECLARE function f1() returns boolean as
CON> begin
CON> return true;
CON> end
CON> begin
CON> c = 0;
CON> b = f1();
CON> IF (f1()) THEN c = 1;
CON> --IF (b) THEN c = 1;
CON> suspend;
CON> end^
Statement failed, SQLSTATE = 22000
Dynamic SQL Error
-SQL error code = -104
-Invalid usage of boolean expression

Commits: 8738972 FirebirdSQL/fbt-repository@2a7039a

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Sep 22, 2013

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Sep 23, 2013

Modified by: @asfernandes

summary: run-time error if (f1()) if f1 returns a boolean => Error with IF (subfunc()) when subfunc returns a boolean

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Sep 23, 2013

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

Fix Version: 3.0 Alpha 2 [ 10560 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented May 29, 2015

Modified by: @pavel-zotov

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

QA Status: Done successfully

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

No branches or pull requests

2 participants