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

Insert "n" length unicode string to a column with data type "varchar(n)" cause data too long error. #51852

Open
kchenzhi opened this issue Oct 12, 2024 · 0 comments
Labels
type/bug Something isn't working

Comments

@kchenzhi
Copy link
Contributor

Steps to reproduce the behavior (Required)

  1. CREATE TABLE varchar_test(name varchar(5))
  2. INSERT INTO varchar_test values('一二三四五')

Expected behavior (Required)

Insert operation successed.

Real behavior (Required)

Error: String '一二三四五'(length=15) is too long. The max length of 'name' is 5

StarRocks version (Required)

3.3.4-56bcf6f

This operation execute normally in Mysql or PG.
These database document describe that columns with datatype varchar(n) can store strings up to n characters (not bytes) in length. https://www.postgresql.org/docs/current/datatype-character.html

When I query the metadata of table varchar_test in starrocks, it shows similar information:
image
But the real behavior is different.

By the way, this issue also affect MVs load data from external JDBC catalog.
When datas with unicode characters too long, the data will ignore by the loading task.

@kchenzhi kchenzhi added the type/bug Something isn't working label Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant