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

RIGHT() fails with multibyte text blobs > 1024 chars [CORE3228] #1283

Closed
firebird-issue-importer opened this issue Nov 11, 2010 · 6 comments
Closed

Comments

@firebird-issue-importer

Submitted by: @paulvink

Is related to QA282

This code, calling RIGHT() on a 1024-char UTF8 blob:

with q \(s\) as \(
    select
        cast\(
            cast\('AAA' as char\(1021\)\) \|\| 'ZZZ' 
        as blob sub\_type text character set utf8
    \)
    from rdb$database
\)
select right\(s, 3\) from q

returns 'ZZZ' (OK)

If I make it a 1025-char blob:

with q \(s\) as \(
    select
        cast\(
            cast\('AAA' as char\(1022\)\) \|\| 'ZZZ' 
        as blob sub\_type text character set utf8
    \)
    from rdb$database
\)
select right\(s, 3\) from q

the result is

335544321
arithmetic exception, numeric overflow, or string truncation
Cannot transliterate character between character sets

With CHAR type UTF8 strings, this error doesn't happen.

With single-byte charsets, RIGHT() works correctly with text blobs of any size (also > 32K).

LEFT() does not have this bug, and functions correctly with multi-byte charset text blobs of any size.

Commits: 877b408 33c0372 ca35503

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 11, 2010

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 25, 2010

Modified by: @dyemanov

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

resolution: Fixed [ 1 ]

Fix Version: 2.1.4 [ 10361 ]

Fix Version: 2.5.1 [ 10333 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 23, 2011

Modified by: @pcisar

Link: This issue is related to QA282 [ QA282 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 3, 2011

Commented by: @pmakowski

Q/A test made

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 3, 2011

Modified by: @pmakowski

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 16, 2015

Modified by: @pavel-zotov

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

QA Status: Done successfully

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