From fa944c3b07894d68496136c5164cf180ed3a2e7c Mon Sep 17 00:00:00 2001 From: lijieac Date: Wed, 20 Nov 2024 09:31:21 +0800 Subject: [PATCH 1/2] docs (template): add templates for PR and Issue --- .gitee/ISSUE_TEMPLATE.en.md | 21 +++++++++++++++++++++ .gitee/ISSUE_TEMPLATE.zh-CN.md | 21 +++++++++++++++++++++ .gitee/PULL_REQUEST_TEMPLATE.en.md | 22 ++++++++++++++++++++++ .gitee/PULL_REQUEST_TEMPLATE.zh-CN.md | 21 +++++++++++++++++++++ 4 files changed, 85 insertions(+) create mode 100644 .gitee/ISSUE_TEMPLATE.en.md create mode 100644 .gitee/ISSUE_TEMPLATE.zh-CN.md create mode 100644 .gitee/PULL_REQUEST_TEMPLATE.en.md create mode 100644 .gitee/PULL_REQUEST_TEMPLATE.zh-CN.md diff --git a/.gitee/ISSUE_TEMPLATE.en.md b/.gitee/ISSUE_TEMPLATE.en.md new file mode 100644 index 0000000..4ad4df5 --- /dev/null +++ b/.gitee/ISSUE_TEMPLATE.en.md @@ -0,0 +1,21 @@ +**Is this a BUG REPORT or FEATURE REQUEST?**: + +> Uncomment only one, leave it on its own line: +> +> - bug +> +> - feature + + +**What happened**: + +**What you expected to happen**: + +**How to reproduce it (as minimally and precisely as possible)**: + +**Anything else we need to know?**: + +**Environment**: +- Version: +- OS (e.g. from /etc/os-release): +- Others: diff --git a/.gitee/ISSUE_TEMPLATE.zh-CN.md b/.gitee/ISSUE_TEMPLATE.zh-CN.md new file mode 100644 index 0000000..bdb6543 --- /dev/null +++ b/.gitee/ISSUE_TEMPLATE.zh-CN.md @@ -0,0 +1,21 @@ +**这是一个bug还是新特性?**: + +> 以下两者二选一,请保留一项: +> +> - bug +> +> - 特性 + + +**发生结果**: + +**期望结果**: + +**如何重现(尽量详细)**: + +**补充说明?**: + +**环境情况**: +- 软件版本: +- 操作系统版本 (e.g. from /etc/os-release): +- 其它: diff --git a/.gitee/PULL_REQUEST_TEMPLATE.en.md b/.gitee/PULL_REQUEST_TEMPLATE.en.md new file mode 100644 index 0000000..211cb09 --- /dev/null +++ b/.gitee/PULL_REQUEST_TEMPLATE.en.md @@ -0,0 +1,22 @@ + + +**[Background]** +Describe the background of this PR (why we need it). + +**[Root Cause]** +Analyze the root cause of the problem or requirement(optional). + +**[Changes Made]** +Describe the solution for this PR. + +**[Test Result]** +Developer self validation results. diff --git a/.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md b/.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md new file mode 100644 index 0000000..b16b119 --- /dev/null +++ b/.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md @@ -0,0 +1,21 @@ + + +**[Background]** +描述该PR的修改背景。 + +**[Root Cause]** +根因分析。 + +**[Changes Made]** +描述该PR的修改方案。 + +**[Test Result]** +开发人员自验证结果。 \ No newline at end of file -- Gitee From 159542088a9459123ebd4769e1990512b2534c4c Mon Sep 17 00:00:00 2001 From: lishengdi Date: Mon, 18 Nov 2024 17:44:16 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=88=9B=E5=BB=BAIF=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E7=B4=A2=E5=BC=95=E6=97=B6,=E6=B7=BB=E5=8A=A0=E7=A9=BA?= =?UTF-8?q?=E6=8C=87=E9=92=88=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mysql-test/suite/ctc/r/ctc_ddl_func_index.result | 4 ++++ mysql-test/suite/ctc/t/ctc_ddl_func_index.test | 6 ++++++ storage/ctc/ctc_ddl_util.cc | 3 +++ 3 files changed, 13 insertions(+) diff --git a/mysql-test/suite/ctc/r/ctc_ddl_func_index.result b/mysql-test/suite/ctc/r/ctc_ddl_func_index.result index 5c55174..d8e34ff 100644 --- a/mysql-test/suite/ctc/r/ctc_ddl_func_index.result +++ b/mysql-test/suite/ctc/r/ctc_ddl_func_index.result @@ -95,4 +95,8 @@ create table t5 (c1 int, c2 int, c3 varchar(10), index func_idx_1 ((abs(c1)))); drop table t5; create table t5 (c1 int, c2 int, c3 varchar(10), index func_idx_1 ((c1 + c2))); ERROR HY000: Cantian does not support function indexes with multiple columns of arguments. +create table t6 (c1 int, c2 int); +create index index_func_idx_1 on t6 ((if(c1 = 1, 1, 3))); +ERROR HY000: Function if is not indexable +drop table t6; drop database db1; diff --git a/mysql-test/suite/ctc/t/ctc_ddl_func_index.test b/mysql-test/suite/ctc/t/ctc_ddl_func_index.test index 0dedf2e..879c0c2 100644 --- a/mysql-test/suite/ctc/t/ctc_ddl_func_index.test +++ b/mysql-test/suite/ctc/t/ctc_ddl_func_index.test @@ -51,5 +51,11 @@ drop table t5; --error ER_DISALLOWED_OPERATION create table t5 (c1 int, c2 int, c3 varchar(10), index func_idx_1 ((c1 + c2))); +# 创建包含条件表达式函数索引异常场景 +create table t6 (c1 int, c2 int); +--error ER_DISALLOWED_OPERATION +create index index_func_idx_1 on t6 ((if(c1 = 1, 1, 3))); + +drop table t6; drop database db1; diff --git a/storage/ctc/ctc_ddl_util.cc b/storage/ctc/ctc_ddl_util.cc index 37e0a3d..df91e4d 100644 --- a/storage/ctc/ctc_ddl_util.cc +++ b/storage/ctc/ctc_ddl_util.cc @@ -89,6 +89,9 @@ bool check_data_file_name(const char *data_file_name) { } Field *ctc_get_field_by_name(TABLE *form, const char *name) { + if (name == nullptr) { + return nullptr; + } for (uint32_t i = 0; i < form->s->fields; i++) { if (strcasecmp(form->field[i]->field_name, name) == 0) { return form->field[i]; -- Gitee