Skip to content

Commit

Permalink
fix: support double quoted column name in CREATE INDEX (#6907)
Browse files Browse the repository at this point in the history
As titled. A quick fix for #6901.


Approved-By: BowenXiao1999

Co-Authored-By: Patrick Huang <[email protected]>
  • Loading branch information
hzxa21 authored Dec 15, 2022
1 parent 87279ad commit d2dfad3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
20 changes: 19 additions & 1 deletion e2e_test/ddl/index.slt
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,22 @@ statement ok
drop materialized view v;

statement ok
drop table t1;
drop table t1;

statement ok
create table t2 (v1 int, "v2" int);

statement ok
create index index_on_quoted_column on t2("v1", v2);

statement ok
create index index_on_quoted_column2 on t2(v1, "v2");

statement ok
drop index index_on_quoted_column;

statement ok
drop index index_on_quoted_column2;

statement ok
drop table t2;
2 changes: 1 addition & 1 deletion src/frontend/src/handler/create_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub(crate) fn gen_create_index_plan(
.collect::<HashMap<_, _>>();

let to_column_indices = |ident: &Ident| {
let x = ident.to_string();
let x = ident.real_value();
table_desc_map
.get(&x)
.cloned()
Expand Down

0 comments on commit d2dfad3

Please sign in to comment.