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: SP "Domain" and "Type Of" based variables referring BLOB with sub_type < 0 no longer work [CORE4623] #4938

Closed
firebird-automations opened this issue Nov 24, 2014 · 7 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Sascha Michel (datiscum1)

SP variables ( Blob subt_ype < 0 ) as domain or table column reference will show an error. The same works fine in FB2.5

Undefined name.
CREATE OR ALTER PROCEDURE ATest failed.
Dynamic SQL Error.
SQL error code = -204.
Data type unknown.
Invalid use of CHARACTER SET or COLLATE.

CREATE DOMAIN "BinaryBlob_ZIP-FIle" AS
BLOB SUB_TYPE -200 SEGMENT SIZE 32000;

CREATE TABLE "ATestTable" (
"BlobContent" "BinaryBlob_ZIP-FIle"
);

SET TERM ^ ;

CREATE OR ALTER procedure "ATest" (
"InputBlob1" blob sub_type -200 segment size 32000, <---- This works
"InputBlob2" type of column "ATestTable"."BlobContent", <--- Not work in FB3 but in 2.5
"InputBlob3" "BinaryBlob_ZIP-FIle") <--- Not work in FB3 but in 2.5
as
begin
end^

SET TERM ; ^

A Variable from that type in a trigger will work in FB3
e.g.

CREATE OR ALTER TRIGGER "ATestTable_BI0" FOR "ATestTable"
ACTIVE BEFORE INSERT POSITION 0
AS
declare variable "BinaryBlob_ZIP-FIle" integer;
begin
end
^

/*
Undefined name.
CREATE OR ALTER PROCEDURE ATest failed.
Dynamic SQL Error.
SQL error code = -204.
Data type unknown.
Invalid use of CHARACTER SET or COLLATE.
*/

Commits: 2ba057c FirebirdSQL/fbt-repository@7054727

====== Test Details ======

NB: according to http://firebirdfaq.org/faq165/ user applications should only use subtypes 0 and 1.
Test implemented with negative numbers after discuss with dimitr, starting letter: 20-apr-2015 16:00.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

Michal,

Please clarify, it seems that there are several issues outlined/inter-mixed.

1- Does this work for both v2.5 and v3.0

CREATE DOMAIN "BinaryBlob_ZIP-FIle" AS BLOB SUB_TYPE -200 SEGMENT SIZE 32000;
CREATE TABLE "ATestTable" ( "BlobContent" "BinaryBlob_ZIP-FIle");

2- Does this work for both v2.5 and v3.0

CREATE OR ALTER procedure "ATest" ( "InputBlob1" blob sub_type -200 segment size 32000);

3- Does this work for both v2.5 and v3.0

CREATE OR ALTER procedure "ATest" ( "InputBlob2" type of column "ATestTable"."BlobContent");

4- Does this work for both v2.5 and v3.0

CREATE OR ALTER procedure "ATest" ( "InputBlob3" "BinaryBlob_ZIP-FIle");

5- Does this work for both v2.5 and v3.0

CREATE OR ALTER TRIGGER "ATestTable_BI0" FOR "ATestTable" ACTIVE BEFORE INSERT POSITION 0 AS
declare variable "BinaryBlob_ZIP-FIle" integer;
begin
end

  \{Do you realize that "BinaryBlob\_ZIP\-FIle" is not being used as a domain/data type?\}

@firebird-automations
Copy link
Collaborator Author

Commented by: Sascha Michel (datiscum1)

1- Does this work for both v2.5 and v3.0
Work on FB2 and FB3

CREATE DOMAIN "BinaryBlob_ZIP-FIle" AS BLOB SUB_TYPE -200 SEGMENT SIZE 32000;
CREATE TABLE "ATestTable" ( "BlobContent" "BinaryBlob_ZIP-FIle");

2- Does this work for both v2.5 and v3.0
Work on FB2 and FB3

CREATE OR ALTER procedure "ATest" ( "InputBlob1" blob sub_type -200 segment size 32000);

3- Does this work for both v2.5 and v3.0
Work on FB2 and don't work on FB3

CREATE OR ALTER procedure "ATest" ( "InputBlob2" type of column "ATestTable"."BlobContent");

4- Does this work for both v2.5 and v3.0
Work on FB2 and don't work on FB3

CREATE OR ALTER procedure "ATest" ( "InputBlob3" "BinaryBlob_ZIP-FIle");

5- Does this work for both v2.5 and v3.0
Work on FB2 and don't work on FB3

CREATE OR ALTER TRIGGER "ATestTable_BI0" FOR "ATestTable" ACTIVE BEFORE INSERT POSITION 0 AS
declare variable "Test" "BinaryBlob_ZIP-FIle" ;
begin
end

{Do you realize that "BinaryBlob_ZIP-FIle" is not being used as a domain/data type?}
No, was my fault. Tested again - thanks

@firebird-automations
Copy link
Collaborator Author

Modified by: Sean Leyne (seanleyne)

summary: Stored procedure variables with blob sub_type < 0 => Regression: SP "Domain" and "Type Of" based variables referring BLOB with sub_type < 0 no longer work

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

Fix Version: 3.0 Beta 2 [ 10586 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Version: 3.0 Beta 1 [ 10332 ]

Version: 3.0 Beta 2 [ 10586 ] =>

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: Done successfully

Test Details: NB: according to http://firebirdfaq.org/faq165/ user applications should only use subtypes 0 and 1.
Test implemented with negative numbers after discuss with dimitr, starting letter: 20-apr-2015 16:00.

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