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

Latest builds of Firebird 4.0 cannot backup DB with generators which contains space in the names [CORE5855] #6115

Closed
firebird-automations opened this issue Jun 22, 2018 · 6 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: bazilio (bazilio77)

Attachments:
c5855x.sql.zip

1. Try to create following database from the script.

SET SQL DIALECT 3;

SET NAMES UTF8;

SET CLIENTLIB 'Firebird_4_0\fbclient.dll';

CREATE DATABASE 'D:\temp\test.fdb'
USER 'SYSDBA' PASSWORD 'masterkey'
PAGE_SIZE 4096
DEFAULT CHARACTER SET UTF8 COLLATION UTF8;

CREATE GENERATOR "NEW GENERATOR" START WITH 0 INCREMENT BY 1;
SET GENERATOR "NEW GENERATOR" TO 0;

2. Try to backup that databae. You wiil get error message
Invalid token.
SQL error state =42000
Dynamic SQL Error.
SQL error code = -104.
Token unknown - line 1, column 28.

Commits: 8d00312

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

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

resolution: Fixed [ 1 ]

Fix Version: 4.0 Beta 1 [ 10750 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

It is still possible to create sequence with name containing single space, bot in 3.x and 4.x:

shell del C:\MIX\firebird\QA\fbt-repo\tmp\c5855.fdb 2>nul;
create database 'localhost:C:\MIX\firebird\QA\fbt-repo\tmp\c5855.fdb';
set bail on;
set echo on;
create sequence " " start with 32;
commit;

Backup of this database on 4.0.0.1040 raises error (and IMO this is good):

gbak:writing filters
gbak:writing id generators
gbak: ERROR:Dynamic SQL Error
gbak: ERROR: SQL error code = -104
gbak: ERROR: Zero length identifiers are not allowed
gbak: ERROR: At line 1, column 24
gbak:Exiting before completion due to errors

But why it is allowed to create sequences with such strange names ?

Further, backup of this database on 3.0.4.33000 will finish SUCCESSFULLY(!) but initial value of sequence will be assigned to zero (i.e. not 32):
. . .
gbak:writing filters
gbak:writing id generators
gbak: writing generator value 0
gbak:writing exceptions
. . .
gbak:closing file, committing, and finishing. 512 bytes written

IMO, this is bug.

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

PS.
may be this is offtopic, but consider script from attached "c5855x.zip".

It is allowed to create sequences with any character from scope {1,2, ..., 32} - with exception of ascii_char(26).
Specifying of char(26) in *any* position of SQL script (even in comments) will terminate script as this character is considered like EOF.
But for what reason it is possible to use characters in double quotes from control ascii list ?

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

Attachment: c5855x.sql.zip [ 13280 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: No test => 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