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
Parametrized execute statement fails [CORE3998] #4330
Comments
Modified by: Sergey (solitaire)description: When excecuting parametrized execute statement, Firebird returns data convertion error. For example: CREATE TABLE T ( ------------- execution of next query fails: => When excecuting parametrized execute statement, Firebird returns data convertion error. For example: ------------- Execution of the next query fails: execute statement (' Firebird returns error: |
Modified by: @hvladassignee: Vlad Khorsun [ hvlad ] |
Modified by: Sergey (solitaire)Version: 2.5.1 [ 10333 ] description: When excecuting parametrized execute statement, Firebird returns data convertion error. For example: ------------- Execution of the next query fails: execute statement (' Firebird returns error: => When excecuting parametrized execute statement, Firebird returns data convertion error. For example: ------------- Execution of the next query fails: execute statement (' Firebird returns error: -------------------- execute statement (' |
Commented by: @hvlad The bug is that in some cases parameters passed in wrong order by EXECUTE STATEMENT. |
Commented by: @hvlad It was fixed in trunk (v3) more than 3 years ago but was not backported into v2.5... |
Modified by: @hvladstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 2.5.3 [ 10461 ] |
Commented by: @hvlad v 2.5.0 also affected |
Modified by: @hvladVersion: 2.5.0 [ 10221 ] |
Commented by: Sergey (solitaire) I'm not sure, because if we fill table T like this: and then run the query: execute statement (' the record with ID = 1 and DIR = '2' will be updated correctly. |
Commented by: @hvlad Ok, if you want more exact diagnos: the wrong order in not when parameter values passed into prepared statement but when statement's message (in internal format) is converted into blr message. |
Commented by: Sergey (solitaire) Ok, now it is clear. Thank you. |
Modified by: @pmakowskistatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: Sergey (solitaire)
Is related to QA523
When excecuting parametrized execute statement, Firebird returns data convertion error.
For example:
CREATE TABLE T (
ID INTEGER NOT NULL,
DIR VARCHAR(100) DEFAULT '' NOT NULL,
NOTE VARCHAR(100) DEFAULT '' NOT NULL
);
commit;
INSERT INTO T (ID, DIR, NOTE) VALUES (1, 'a', 'b');
commit;
-------------
Execution of the next query fails:
execute block
as
declare variable DIR varchar(100);
declare variable NOTE varchar(100);
declare variable ID integer;
begin
ID = 1;
DIR = 'a';
NOTE = 'bbbb';
execute statement ('
update T set
NOTE = :NOTE
where
ID = :ID and DIR = :DIR
')
(
ID := :ID,
NOTE := :NOTE,
DIR := :DIR
);
end
Firebird returns error:
Overflow occurred during data type conversion.
conversion error from string "a".
--------------------
In this case, probably Firebird considers that parameter DIR must be of type Integer, because the next query works:
execute block
as
declare variable DIR varchar(100);
declare variable NOTE varchar(100);
declare variable ID integer;
begin
ID = 1;
DIR = '1';
NOTE = 'bbbb';
execute statement ('
update T set
NOTE = :NOTE
where
ID = :ID and DIR = :DIR
')
(
ID := :ID,
NOTE := :NOTE,
DIR := :DIR
);
end
Commits: 8433046 FirebirdSQL/fbt-repository@9bd98c8
The text was updated successfully, but these errors were encountered: