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

ISQL is adding an unnecessary COMMIT WORK statement to the extracted metadata script before starting the Stored functions headers/bodies statements [CORE6505] #6735

Open
firebird-automations opened this issue Mar 6, 2021 · 9 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @luronumen

Attachments:
DDL.SQL
DDL_PROCEDURE.SQL

ACTUAL RESULT
- ISQL is adding an unnecessary COMMIT WORK statement to the extracted metadata script before starting the Stored functions headers/bodies statements (lines 4 and 15 from DDL.SQL attached)

EXPECTEDT RESULT
- ISQL do not need to add an COMMIT WORK statement to the extracted metadata script before starting the Stored functions headers/bodies statements (lines 4 and 15 from DDL.SQL attached)

STEPS TO REPRODUCE THIS ISSUE:
1- Create a new database and than just create a simple function:
SET TERM ^ ;
CREATE OR ALTER FUNCTION M_BINTODEC (BIN_NUMBER VARCHAR(63) CHARACTER SET WIN1252)
RETURNS BIGINT
AS
BEGIN END^
SET TERM ; ^

2- Extract the Metadata script using the ISQL.exe and check all the instructions (see lines 4 and 15 from DDL.SQL attached)

@firebird-automations
Copy link
Collaborator Author

Modified by: @luronumen

Attachment: DDL.SQL [ 13554 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

priority: Major [ 3 ] => Minor [ 4 ]

issuetype: Bug [ 1 ] => Improvement [ 4 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @luronumen

This issue is also reproducible for Stored procedures headers/bodies statements (See lines 4 and 13 from DDL_PROCEDURE.SQL file attached).

@firebird-automations
Copy link
Collaborator Author

Modified by: @luronumen

Attachment: DDL_PROCEDURE.SQL [ 13557 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

One question - what harm in extra commits?

@firebird-automations
Copy link
Collaborator Author

Commented by: @luronumen

Hi Alexander

There is no harm in having an extra COMMIT, but there is also no reason for an extra COMMIT.
It was precisely because there was no reason for the existence of this extra commit, knowing that the fix is not something that requires so much work time, because of the very low risk of the side effect of the fix and knowing that the Firebird development team values quality. of DBMS that I decided to open this issue.

Best Regards,
Luciano

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

I didn't looked in details, but that extra commit may be due to things your script does not use (for example, computed expressions).

So it may not be a matter of just remove it, but conditionally put it only when necessary.

@firebird-automations
Copy link
Collaborator Author

Commented by: @luronumen

Hi Adriano,

Thank you very much for your quick response!

The best way to find out where this extra commit comes from is to inspect the ISQL.exe code.

As you can see in the issue description it is a very simple issue to be reproducible:
1- Create a database
2- Create a procedure or function
3- Extract the database metadata using isql.exe

I believe that this issue comes with the code for creating the procedures/functions metadata because when extracting the metadata from a database without structure, this issue is not reproducible.

Best Regards,
Luciano

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