From 85b0ecae5f354772392aab4a1dbb2b4d201182e4 Mon Sep 17 00:00:00 2001 From: Toby Hede Date: Thu, 4 Jan 2024 19:18:00 +1100 Subject: [PATCH] Update sqlparser to 0.41 --- Cargo.lock | 10 +++++----- Cargo.toml | 9 ++++++--- src/query_router.rs | 7 ++++++- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 28f20a9d..6699ce61 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1510,9 +1510,9 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "sqlparser" -version = "0.34.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3706eefb17039056234df6b566b0014f303f867f2656108334a55b8096f59" +checksum = "5cc2c25a6c66789625ef164b4c7d2e548d627902280c13710d33da8222169964" dependencies = [ "log", "sqlparser_derive", @@ -1520,13 +1520,13 @@ dependencies = [ [[package]] name = "sqlparser_derive" -version = "0.1.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55fe75cb4a364c7f7ae06c7dbbc8d84bddd85d6cdf9975963c3935bc1991761e" +checksum = "01b2e185515564f15375f593fb966b5718bc624ba77fe49fa4616ad619690554" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.26", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index f451ffc5..f408ba4e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ serde_derive = "1" regex = "1" num_cpus = "1" once_cell = "1" -sqlparser = {version = "0.34", features = ["visitor"] } +sqlparser = { version = "0.41", features = ["visitor"] } log = "0.4" arc-swap = "1" parking_lot = "0.12.1" @@ -47,9 +47,12 @@ serde_json = "1" itertools = "0.10" clap = { version = "4.3.1", features = ["derive", "env"] } tracing = "0.1.37" -tracing-subscriber = { version = "0.3.17", features = ["json", "env-filter", "std"]} +tracing-subscriber = { version = "0.3.17", features = [ + "json", + "env-filter", + "std", +] } lru = "0.12.0" [target.'cfg(not(target_env = "msvc"))'.dependencies] jemallocator = "0.5.0" - diff --git a/src/query_router.rs b/src/query_router.rs index 541883f2..7acd6841 100644 --- a/src/query_router.rs +++ b/src/query_router.rs @@ -499,6 +499,7 @@ impl QueryRouter { table: _, on: _, returning: _, + ignore: _, } => { // Not supported in postgres. assert!(or.is_none()); @@ -506,7 +507,9 @@ impl QueryRouter { assert!(after_columns.is_empty()); Self::process_table(table_name, &mut table_names); - Self::process_query(source, &mut exprs, &mut table_names, &Some(columns)); + if let Some(source) = source { + Self::process_query(source, &mut exprs, &mut table_names, &Some(columns)); + } } Delete { tables, @@ -514,6 +517,8 @@ impl QueryRouter { using, selection, returning: _, + order_by: _, + limit: _, } => { if let Some(expr) = selection { exprs.push(expr.clone());