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

Position function does not consider the collation for blob [CORE5695] #5961

Closed
firebird-automations opened this issue Jan 6, 2018 · 8 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Anatoliy Schegolskiy (atanas)

The following statement returns:
RES
-----------
0
1
But it should return 1 for both. I suppose the Position function does not taking into consideration the collation of blob variable.
Database: DEFAULT CHARACTER SET UTF8 COLLATION UNICODE_CI;
Connection charset: UTF8
Firebird: 3.0.2.32703 (x64)
Windows 10 Pro (x64)

execute block
returns (
RES integer)
as
declare variable BL blob sub_type 1 segment size 80 collate UNICODE_CI;
declare variable TXT varchar(255) collate UNICODE_CI;
begin
bl= 'abc';
txt = 'ABCD';
res = position(txt, bl);
suspend;
res = position ('abc','ABCD');
suspend;
end

Commits: 6cab501 0d8ee0e

@firebird-automations
Copy link
Collaborator Author

Modified by: Anatoliy Schegolskiy (atanas)

description: The following statement returns:
RES
-----------
0
1
But it sholud return 1 for both. I suppose the Position function does not taking in consideration the collation of blob variable.
Database: DEFAULT CHARACTER SET UTF8 COLLATION UNICODE_CI;
Connection charset: UTF8
Firebird: 3.0.2.32703
Windows 10 Pro (x64)

execute block
returns (
RES integer)
as
declare variable BL blob sub_type 1 segment size 80 collate UNICODE_CI;
declare variable TXT varchar(255) collate UNICODE_CI;
begin
bl= 'declare variable ID D_ID;declare variable TEST_FIELD D_INTEGER;';
txt = 'declare variable id d_id;';
res = position(txt, bl);
suspend;
res = position ('declare variable id d_id;','declare variable ID D_ID;declare variable TEST_FIELD D_INTEGER;');
suspend;
end

=>

The following statement returns:
RES
-----------
0
1
But it should return 1 for both. I suppose the Position function does not taking into consideration the collation of blob variable.
Database: DEFAULT CHARACTER SET UTF8 COLLATION UNICODE_CI;
Connection charset: UTF8
Firebird: 3.0.2.32703
Windows 10 Pro (x64)

execute block
returns (
RES integer)
as
declare variable BL blob sub_type 1 segment size 80 collate UNICODE_CI;
declare variable TXT varchar(255) collate UNICODE_CI;
begin
bl= 'declare variable ID D_ID;declare variable TEST_FIELD D_INTEGER;';
txt = 'declare variable id d_id;';
res = position(txt, bl);
suspend;
res = position ('declare variable id d_id;','declare variable ID D_ID;declare variable TEST_FIELD D_INTEGER;');
suspend;
end

@firebird-automations
Copy link
Collaborator Author

Modified by: Anatoliy Schegolskiy (atanas)

description: The following statement returns:
RES
-----------
0
1
But it should return 1 for both. I suppose the Position function does not taking into consideration the collation of blob variable.
Database: DEFAULT CHARACTER SET UTF8 COLLATION UNICODE_CI;
Connection charset: UTF8
Firebird: 3.0.2.32703
Windows 10 Pro (x64)

execute block
returns (
RES integer)
as
declare variable BL blob sub_type 1 segment size 80 collate UNICODE_CI;
declare variable TXT varchar(255) collate UNICODE_CI;
begin
bl= 'declare variable ID D_ID;declare variable TEST_FIELD D_INTEGER;';
txt = 'declare variable id d_id;';
res = position(txt, bl);
suspend;
res = position ('declare variable id d_id;','declare variable ID D_ID;declare variable TEST_FIELD D_INTEGER;');
suspend;
end

=>

The following statement returns:
RES
-----------
0
1
But it should return 1 for both. I suppose the Position function does not taking into consideration the collation of blob variable.
Database: DEFAULT CHARACTER SET UTF8 COLLATION UNICODE_CI;
Connection charset: UTF8
Firebird: 3.0.2.32703 (x64)
Windows 10 Pro (x64)

execute block
returns (
RES integer)
as
declare variable BL blob sub_type 1 segment size 80 collate UNICODE_CI;
declare variable TXT varchar(255) collate UNICODE_CI;
begin
bl= 'declare variable ID D_ID;declare variable TEST_FIELD D_INTEGER;';
txt = 'declare variable id d_id;';
res = position(txt, bl);
suspend;
res = position ('declare variable id d_id;','declare variable ID D_ID;declare variable TEST_FIELD D_INTEGER;');
suspend;
end

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Modified by: Anatoliy Schegolskiy (atanas)

description: The following statement returns:
RES
-----------
0
1
But it should return 1 for both. I suppose the Position function does not taking into consideration the collation of blob variable.
Database: DEFAULT CHARACTER SET UTF8 COLLATION UNICODE_CI;
Connection charset: UTF8
Firebird: 3.0.2.32703 (x64)
Windows 10 Pro (x64)

execute block
returns (
RES integer)
as
declare variable BL blob sub_type 1 segment size 80 collate UNICODE_CI;
declare variable TXT varchar(255) collate UNICODE_CI;
begin
bl= 'declare variable ID D_ID;declare variable TEST_FIELD D_INTEGER;';
txt = 'declare variable id d_id;';
res = position(txt, bl);
suspend;
res = position ('declare variable id d_id;','declare variable ID D_ID;declare variable TEST_FIELD D_INTEGER;');
suspend;
end

=>

The following statement returns:
RES
-----------
0
1
But it should return 1 for both. I suppose the Position function does not taking into consideration the collation of blob variable.
Database: DEFAULT CHARACTER SET UTF8 COLLATION UNICODE_CI;
Connection charset: UTF8
Firebird: 3.0.2.32703 (x64)
Windows 10 Pro (x64)

execute block
returns (
RES integer)
as
declare variable BL blob sub_type 1 segment size 80 collate UNICODE_CI;
declare variable TXT varchar(255) collate UNICODE_CI;
begin
bl= 'abc';
txt = 'ABCD';
res = position(txt, bl);
suspend;
res = position ('abc','ABCD');
suspend;
end

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

assignee: Adriano dos Santos Fernandes [ asfernandes ] => Vlad Khorsun [ hvlad ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

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

resolution: Fixed [ 1 ]

Fix Version: 3.0.3 [ 10810 ]

Fix Version: 4.0 Beta 1 [ 10750 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: No test => Done successfully

@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
Projects
None yet
Development

No branches or pull requests

2 participants