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-automations opened this issue Dec 23, 2019 · 11 comments

Comments

@firebird-automations
Copy link
Collaborator

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-automations
Copy link
Collaborator Author

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

Fix Version: 4.0 Beta 2 [ 10888 ]

@firebird-automations
Copy link
Collaborator Author

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-automations
Copy link
Collaborator Author

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-automations
Copy link
Collaborator Author

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-automations
Copy link
Collaborator Author

Modified by: @asfernandes

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

resolution: Fixed [ 1 ] =>

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Pavel, please test this build https://github.com/FirebirdSQL/firebird/suites/377696814/artifacts/874695

@firebird-automations
Copy link
Collaborator Author

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-automations
Copy link
Collaborator Author

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Collaborator Author

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-automations
Copy link
Collaborator Author

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