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

Command "ISQL -X" can not extract ROLE name when use multi-byte charset for connection (4.x only is affected) [CORE6211] #6456

Closed
firebird-issue-importer opened this issue Dec 23, 2019 · 11 comments

Comments

@firebird-issue-importer

Submitted by: @pavel-zotov

Steps to reproduce:
1) Create following script (correct path and name of test DB to your env.):

set bail on;
set names utf8;
shell del c:\temp\tmp4test.fdb 2>nul;
create database 'localhost:c:\temp\tmp4test.fdb' user 'SYSDBA' password 'masterkey'; -- default character set utf8;
create role fo;
commit;
set heading off;
select 'Completed.' from rdb$database;
show version;

2) Apply it:

C:\FBTESTING\qa\fbt-repo\tmp>C:\FB\40SS\isql -q -i test-role-utf8.sql

Completed.

ISQL Version: WI-T4.0.0.1694 Firebird 4.0 Beta 1
Server version:
Firebird/Windows/AMD/Intel/x64 (access method), version "WI-T4.0.0.1694 Firebird 4.0 Beta 1"
Firebird/Windows/AMD/Intel/x64 (remote server), version "WI-T4.0.0.1694 Firebird 4.0 Beta 1/tcp (Image-PC1)/P16"
Firebird/Windows/AMD/Intel/x64 (remote interface), version "WI-T4.0.0.1694 Firebird 4.0 Beta 1/tcp (Image-PC1)/P16"
on disk structure version 13.0

3) Try to extract metadata:

3.1) without specifying charset for connect:
C:\FB\40SS\isql -x localhost:c:\temp\tmp4test.fdb

Output:
---------
SET SQL DIALECT 3;
. . .
CREATE ROLE FO;

(i.e. all fine)

3.2) with specifying single-byte charset. I use win1251:
C:\FB\40SS\isql -x -ch win1251 localhost:c:\temp\tmp4test.fdb

Output: the same, all fine.
---------

3.3) with specifying UTF8:
C:\FB\40SS\isql -x -ch utf8 localhost:c:\temp\tmp4test.fdb

Output:
---------

SET SQL DIALECT 3;

/* CREATE DATABASE 'localhost:c:\temp\tmp4test.fdb' PAGE_SIZE 8192 DEFAULT CHARACTER SET NONE; */

COMMIT WORK;

/* Grant roles for this database */

/* Role: FO, Owner: SYSDBA */
CREATE ROLE FOStatement failed, SQLSTATE = 22001
arithmetic exception, numeric overflow, or string truncation
-string right truncation
-expected length 2, actual 8
;

No such error on WI-V3.0.5.33217.

PS.
Note: i intentionally did not use non-ascii role name (though when use it the error the same).

Commits: 57b0f8a 8a858aa

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 23, 2019

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 24, 2019

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

Fix Version: 4.0 Beta 2 [ 10888 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 25, 2019

Commented by: @pavel-zotov

Why this ticket is considered as "resolved" ? I still reproduce bug on WI-T4.0.0.1707 (scenario is the same).

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 26, 2019

Modified by: @pavel-zotov

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

QA Status: No test => Deferred

Test Details: Described problem still exists (checked on 4.0.0.1708).
Sent letter to Adriano, 26.12.2019 12:43. Waiting for reply.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 26, 2019

Commented by: @asfernandes

It's working in Linux build (built by myself). But Windows build downloaded it's not.

Maybe there is a difference between how builds are working in relation to internal gpre.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 26, 2019

Modified by: @asfernandes

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

resolution: Fixed [ 1 ] =>

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 29, 2019

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 30, 2019

Commented by: @pavel-zotov

Adriano, it works fine! I've checked both ascii-only and non-ascii name of roles, and used isql -x -ch utf8.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 30, 2019

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 31, 2019

Modified by: @pavel-zotov

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

QA Status: Deferred => Done successfully

Test Details: Described problem still exists (checked on 4.0.0.1708).
Sent letter to Adriano, 26.12.2019 12:43. Waiting for reply.

=>

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 31, 2019

Modified by: @pavel-zotov

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants