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

Database file grow too when execute operations with blob type variables in SPs. [CORE4109] #4437

Closed
firebird-automations opened this issue May 30, 2013 · 8 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Martin A. Lara V. (mlara)

Relate to CORE3953
Relate to CORE3951
Duplicates CORE3951

Attachments:
blob_case_sp.sql

Do the folllowing:

1. Create a database. Product of this step we obtain a database of 2464 KB.

2. Create the next SP:

CREATE PROCEDURE "BLOB_Case_SP"

AS

DECLARE VARIABLE i INTEGER;
DECLARE VARIABLE fmemo BLOB SUB_TYPE TEXT SEGMENT SIZE 80;

BEGIN

fmemo = '';

i = 1;
WHILE (i < 1280) DO BEGIN

fmemo = fmemo \|\| '1\*2\*3\*4\*5\*6\*7\*8\*';

i = i \+ 1;

END

END

// Obs. We use a blob type variable, sub_type text. Then we built a string using successive concatenations (eg. 1280) always adding a string of length 16.

3. Execute the SP:

EXECUTE "BLOB_Case_SP";

Results:

We obtain the next error message: "unknow ISC error 0." and the database size increased to 11472 KB.

Now, if we replace in the SP the line:

fmemo = fmemo \|\| '1\*2\*3\*4\*5\*6\*7\*8\*';

by this lines:

fmemo = fmemo \|\| '1\*';
fmemo = fmemo \|\| '2\*';
fmemo = fmemo \|\| '3\*';
fmemo = fmemo \|\| '4\*';
fmemo = fmemo \|\| '5\*';
fmemo = fmemo \|\| '6\*';
fmemo = fmemo \|\| '7\*';
fmemo = fmemo \|\| '8\*';

and we do it all from scratch, we obtain the same error message and a database file of 74384 KB!

@firebird-automations
Copy link
Collaborator Author

Commented by: Martin A. Lara V. (mlara)

If the 'fmemo' variable is varchar(32765) type, no problem. The problem is with blob type.

@firebird-automations
Copy link
Collaborator Author

Modified by: Sean Leyne (seanleyne)

Link: This issue relate to CORE3953 [ CORE3953 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: Sean Leyne (seanleyne)

Link: This issue relate to CORE3951 [ CORE3951 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: Martin A. Lara V. (mlara)

Attachment: blob_case_sp.sql [ 12322 ]

description: Do the folllowing:

1. Create a database. Product of this step we obtain a database of 2464 KB.

2. Create the next SP:

CREATE PROCEDURE "BLOB_Case_SP"

AS

DECLARE VARIABLE i INTEGER;
DECLARE VARIABLE fmemo BLOB SUB_TYPE TEXT SEGMENT SIZE 80;

BEGIN

fmemo = '';

i = 1;
WHILE (i < 1280) DO BEGIN

fmemo = fmemo \|\| '1\*2\*3\*4\*5\*6\*7\*8\*';

i = i \+ 1;

END

END

// Obs. We use a blob type variable, sub_type text. Then we built a string using successive concatenations (eg. 1280) always adding a string of length 16.

3. Execute the SP:

EXECUTE BLOB_CASE_SP;

Results:

We obtain the next error message: "unknow ISC error 0." and the database size increased to 11472 KB.

Now, if we replace in the SP the line:

fmemo = fmemo \|\| '1\*2\*3\*4\*5\*6\*7\*8\*';

by this lines:

fmemo = fmemo \|\| '1\*';
fmemo = fmemo \|\| '2\*';
fmemo = fmemo \|\| '3\*';
fmemo = fmemo \|\| '4\*';
fmemo = fmemo \|\| '5\*';
fmemo = fmemo \|\| '6\*';
fmemo = fmemo \|\| '7\*';
fmemo = fmemo \|\| '8\*';

and we do it all from scratch, we obtain the same error message and a database file of 74384 KB!

=>

Do the folllowing:

1. Create a database. Product of this step we obtain a database of 2464 KB.

2. Create the next SP:

CREATE PROCEDURE "BLOB_Case_SP"

AS

DECLARE VARIABLE i INTEGER;
DECLARE VARIABLE fmemo BLOB SUB_TYPE TEXT SEGMENT SIZE 80;

BEGIN

fmemo = '';

i = 1;
WHILE (i < 1280) DO BEGIN

fmemo = fmemo \|\| '1\*2\*3\*4\*5\*6\*7\*8\*';

i = i \+ 1;

END

END

// Obs. We use a blob type variable, sub_type text. Then we built a string using successive concatenations (eg. 1280) always adding a string of length 16.

3. Execute the SP:

EXECUTE "BLOB_Case_SP";

Results:

We obtain the next error message: "unknow ISC error 0." and the database size increased to 11472 KB.

Now, if we replace in the SP the line:

fmemo = fmemo \|\| '1\*2\*3\*4\*5\*6\*7\*8\*';

by this lines:

fmemo = fmemo \|\| '1\*';
fmemo = fmemo \|\| '2\*';
fmemo = fmemo \|\| '3\*';
fmemo = fmemo \|\| '4\*';
fmemo = fmemo \|\| '5\*';
fmemo = fmemo \|\| '6\*';
fmemo = fmemo \|\| '7\*';
fmemo = fmemo \|\| '8\*';

and we do it all from scratch, we obtain the same error message and a database file of 74384 KB!

environment: Windows XP SP3/Vista/7/8 32 | 64 bits, Firebird 2.1.518497, IBExpert 20130220 => Windows XP SP3/Vista/7/8 32 | 64 bits, Firebird 2.1.5.18497, IBExpert 20130220

@firebird-automations
Copy link
Collaborator Author

Modified by: Sean Leyne (seanleyne)

Link: This issue duplicates CORE3951 [ CORE3951 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: Sean Leyne (seanleyne)

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

resolution: Duplicate [ 3 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

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

1 participant