diff --git a/lib/src/sql/statements/define.rs b/lib/src/sql/statements/define.rs index 93d149aa..00447641 100644 --- a/lib/src/sql/statements/define.rs +++ b/lib/src/sql/statements/define.rs @@ -695,14 +695,7 @@ pub enum DefineTableOption { } fn table_opts(i: &str) -> IResult<&str, DefineTableOption> { - alt(( - table_drop, - table_view, - table_schemaless, - table_schemafull, - table_schemaful, - table_permissions, - ))(i) + alt((table_drop, table_view, table_schemaless, table_schemafull, table_permissions))(i) } fn table_drop(i: &str) -> IResult<&str, DefineTableOption> { @@ -725,13 +718,7 @@ fn table_schemaless(i: &str) -> IResult<&str, DefineTableOption> { fn table_schemafull(i: &str) -> IResult<&str, DefineTableOption> { let (i, _) = shouldbespace(i)?; - let (i, _) = tag_no_case("SCHEMAFULL")(i)?; - Ok((i, DefineTableOption::Schemafull)) -} - -fn table_schemaful(i: &str) -> IResult<&str, DefineTableOption> { - let (i, _) = shouldbespace(i)?; - let (i, _) = tag_no_case("SCHEMAFUL")(i)?; + let (i, _) = alt((tag_no_case("SCHEMAFULL"), tag_no_case("SCHEMAFUL")))(i)?; Ok((i, DefineTableOption::Schemafull)) } diff --git a/lib/tests/define.rs b/lib/tests/define.rs index bbeb0a0b..a1171813 100644 --- a/lib/tests/define.rs +++ b/lib/tests/define.rs @@ -116,13 +116,17 @@ async fn define_statement_table_schemaless() -> Result<(), Error> { #[tokio::test] async fn define_statement_table_schemafull() -> Result<(), Error> { let sql = " + DEFINE TABLE test SCHEMAFUL; DEFINE TABLE test SCHEMAFULL; INFO FOR DB; "; let dbs = Datastore::new("memory").await?; let ses = Session::for_kv().with_ns("test").with_db("test"); let res = &mut dbs.execute(&sql, &ses, None, false).await?; - assert_eq!(res.len(), 2); + assert_eq!(res.len(), 3); + // + let tmp = res.remove(0).result; + assert!(tmp.is_ok()); // let tmp = res.remove(0).result; assert!(tmp.is_ok());