From 89baebbd2421745262e5af36b6e5230617319d19 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Thu, 28 Jul 2022 20:27:39 +0100 Subject: [PATCH] Fix DEFINE INDEX UNIQUE statement parsing --- lib/src/sql/statements/define.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/src/sql/statements/define.rs b/lib/src/sql/statements/define.rs index 5ce27096..54c1f5f9 100644 --- a/lib/src/sql/statements/define.rs +++ b/lib/src/sql/statements/define.rs @@ -1019,11 +1019,7 @@ fn index(i: &str) -> IResult<&str, DefineIndexStatement> { let (i, _) = alt((tag_no_case("COLUMNS"), tag_no_case("FIELDS")))(i)?; let (i, _) = shouldbespace(i)?; let (i, cols) = idiom::locals(i)?; - let (i, uniq) = opt(|i| { - shouldbespace(i)?; - tag_no_case("UNIQUE")(i)?; - Ok((i, true)) - })(i)?; + let (i, uniq) = opt(tuple((shouldbespace, tag_no_case("UNIQUE"))))(i)?; Ok(( i, DefineIndexStatement {