diff --git a/Cargo.lock b/Cargo.lock index 2cd740e2f31b2..c04eb80a412fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4386,7 +4386,7 @@ dependencies = [ "serde", "thiserror", "time", - "winnow 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winnow 0.6.9", ] [[package]] @@ -11483,7 +11483,7 @@ dependencies = [ "tracing", "tracing-subscriber", "walkdir", - "winnow 0.6.8 (git+https://github.com/TennyZhuang/winnow.git?rev=a6b1f04)", + "winnow 0.6.9", "workspace-hack", ] @@ -14595,7 +14595,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winnow 0.6.9", ] [[package]] @@ -16275,17 +16275,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" -dependencies = [ - "memchr", -] - -[[package]] -name = "winnow" -version = "0.6.8" -source = "git+https://github.com/TennyZhuang/winnow.git?rev=a6b1f04#a6b1f04cbe9b39d218da5a121e610144ebf961b0" +checksum = "86c949fede1d13936a99f14fafd3e76fd642b556dd2ce96287fbe2e0151bfac6" dependencies = [ "memchr", ] diff --git a/src/sqlparser/Cargo.toml b/src/sqlparser/Cargo.toml index d35e5a0ef7319..377b2e676d6a8 100644 --- a/src/sqlparser/Cargo.toml +++ b/src/sqlparser/Cargo.toml @@ -25,10 +25,14 @@ normal = ["workspace-hack"] itertools = { workspace = true } serde = { version = "1.0", features = ["derive"], optional = true } thiserror = "1.0.61" -tokio = { version = "0.2", package = "madsim-tokio" } +tokio = { version = "0.2", package = "madsim-tokio", features = [ + "rt", + "rt-multi-thread", + "macros", +] } tracing = "0.1" tracing-subscriber = "0.3" -winnow = { version = "0.6.8", git = "https://github.com/TennyZhuang/winnow.git", rev = "a6b1f04" } +winnow = "0.6.9" [target.'cfg(not(madsim))'.dependencies] workspace-hack = { path = "../workspace-hack" } diff --git a/src/sqlparser/src/parser_v2/data_type.rs b/src/sqlparser/src/parser_v2/data_type.rs index c275396413942..6121a3dff4036 100644 --- a/src/sqlparser/src/parser_v2/data_type.rs +++ b/src/sqlparser/src/parser_v2/data_type.rs @@ -147,10 +147,16 @@ fn data_type_stateful(input: &mut StatefulStream) -> PResult where S: TokenStream, { - repeat(0.., (Token::LBracket, cut_err(Token::RBracket))) - .fold1(data_type_stateful_inner, |mut acc, _| { - acc = DataType::Array(Box::new(acc)); - acc + ( + data_type_stateful_inner, + repeat(0.., (Token::LBracket, cut_err(Token::RBracket))), + ) + .map(|(mut dt, depth)| { + let depth: usize = depth; + for _ in 0..depth { + dt = DataType::Array(Box::new(dt)); + } + dt }) .parse_next(input) }