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

CREATE TABLE / ALTER TABLE 中 auto_increment_cache_size 语法报错 #1967

Open
CodePlayer opened this issue May 13, 2024 · 2 comments
Open
Labels
type: bug Something isn't working

Comments

@CodePlayer
Copy link

CodePlayer commented May 13, 2024

Describe the bug
参考 定义自增列 + CREATE TABLE 语法 + ALTER TABLE 语法 等官方文档,定义如下表结构:

CREATE TABLE `t_test` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
   PRIMARY KEY (`id`)  
)  auto_increment_cache_size = 10000 DEFAULT CHARSET=utf8mb4 COMMENT='测试自增ID缓存';

得到如下报错:

1064 - You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'auto_increment_cache_size = 10000 DEFAULT CHARSET=utf8mb4 COMMENT='测试自增I' at line 4

Environment

  • OS Version: CentOS 7.9/8.2 64bit x86_64

  • OB Version: OceanBase 4.2.1-HP5 社区版、OceanBase 4.2.2-HF1 社区版(都不行)。

Additional context

-- ALTER TABLE 也报错
CREATE TABLE `t_test` auto_increment_cache_size = 10000;
-- 租户级别的全局变量设置倒是可以正常执行
SET GLOBAL auto_increment_cache_size = 10000;
@CodePlayer CodePlayer added the type: bug Something isn't working label May 13, 2024
@hnwyllmm
Copy link
Contributor

这是4.2.3的文档,我在423上测试成功:

obclient [test]> create table t(id bigint not null auto_increment) auto_increment_cache_size=100000;
Query OK, 0 rows affected (0.055 sec)

obclient [test]> select version();
+------------------------------+
| version()                    |
+------------------------------+
| 5.7.25-OceanBase_CE-v4.2.3.0 |
+------------------------------+
1 row in set (0.001 sec)

@CodePlayer
Copy link
Author

您好,只有 4.2.3 才新增支持的吗 ?这个特性会合并到 4.2.1 LTS 上面吗 ?

@CodePlayer CodePlayer changed the title [Bug]: CREATE TABLE / ALTER TABLE 中 auto_increment_cache_size 语法报错 CREATE TABLE / ALTER TABLE 中 auto_increment_cache_size 语法报错 May 14, 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

2 participants