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

[Bug]: alter table rowkey column to varchar(10000) is allowed #1965

Open
lyukun opened this issue May 13, 2024 · 0 comments
Open

[Bug]: alter table rowkey column to varchar(10000) is allowed #1965

lyukun opened this issue May 13, 2024 · 0 comments
Assignees
Labels
type: bug Something isn't working

Comments

@lyukun
Copy link

lyukun commented May 13, 2024

Describe the bug

alter a table columnn to varchar(10000) is allowed in current oceanbase, but that shouldn't be allowed because a varchar may counts for multi bytes and a varchar(10000) may exceed 16KB, which is the max rowkey length.
Environment

  • OS Version and CPU Arch(uname -a):
    Linux sqaobnoxdn011124009100.sa128 4.9.151-015.ali3000.alios7.x86_64 SMP Tue Mar 12 19:10:26 CST 2019 x86_64 x86_64 x86_64 GNU/Linux
  • OB Version(LD_LIBRARY_PATH=../lib:$LD_LIBRARY_PATH ./observer -V):
    4.3.0

Fast Reproduce Steps(Required)
SQL:
create table t1(c1 int, c2 varchar(1000), c3 int);
create index idx1 on t1(c2, c3);
alter table t1 modify column c3 varchar(10000);

Expected behavior

ERROR 42000: Specified key was too long

Actual Behavior

OK, 0 rows affected in xx seconds.

Additional context

@lyukun lyukun added the type: bug Something isn't working label May 13, 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