diff --git a/cli/Cargo.toml b/cli/Cargo.toml index e73b9eeb0..8287a4e67 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -30,7 +30,7 @@ shlex = "1.1.0" sqlformat = "0.2.1" strum = "0.24" strum_macros = "0.24" -tokio = { version = "1.26", features = [ +tokio = { version = "1.28.1", features = [ "macros", "rt", "rt-multi-thread", diff --git a/driver/Cargo.toml b/driver/Cargo.toml index 37f68bc4f..ea5a53292 100644 --- a/driver/Cargo.toml +++ b/driver/Cargo.toml @@ -24,6 +24,7 @@ chrono = { version = "0.4.24", default-features = false, features = ["clock"] } databend-client = { version = "0.1.16", path = "../core" } dyn-clone = "1.0.11" http = "0.2.9" +percent-encoding = "2.2.0" serde = { version = "1.0.160", default-features = false, features = ["derive"] } serde_json = { version = "1.0.96", default-features = false, features = ["std"] } tokio = { version = "1.27.0", features = ["macros"] } diff --git a/driver/src/flight_sql.rs b/driver/src/flight_sql.rs index af6bf87c8..7e29b94d4 100644 --- a/driver/src/flight_sql.rs +++ b/driver/src/flight_sql.rs @@ -23,6 +23,7 @@ use arrow_flight::utils::flight_data_to_arrow_batch; use arrow_flight::{sql::client::FlightSqlServiceClient, FlightData}; use arrow_schema::SchemaRef as ArrowSchemaRef; use async_trait::async_trait; +use percent_encoding::percent_decode_str; use tokio::sync::Mutex; use tokio_stream::{Stream, StreamExt}; use tonic::transport::{Channel, ClientTlsConfig, Endpoint}; @@ -247,7 +248,9 @@ impl Args { None => format!("{}://{}:{}", scheme, host, port), }; args.user = u.username().to_string(); - args.password = u.password().unwrap_or_default().to_string(); + args.password = percent_decode_str(u.password().unwrap_or_default()) + .decode_utf8_lossy() + .to_string(); Ok(args) } } diff --git a/driver/src/value.rs b/driver/src/value.rs index fe700d651..5ed70990c 100644 --- a/driver/src/value.rs +++ b/driver/src/value.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use arrow::datatypes::i256; +use arrow::datatypes::{i256, ArrowNativeTypeOp}; use chrono::{Datelike, NaiveDate, NaiveDateTime}; use crate::{ @@ -28,10 +28,10 @@ const NULL_VALUE: &str = "NULL"; #[cfg(feature = "flight-sql")] use { arrow_array::{ - Array as ArrowArray, ArrowNativeTypeOp, BinaryArray, BooleanArray, Date32Array, - Decimal128Array, Decimal256Array, Float32Array, Float64Array, Int16Array, Int32Array, - Int64Array, Int8Array, LargeBinaryArray, LargeStringArray, StringArray, - TimestampMicrosecondArray, UInt16Array, UInt32Array, UInt64Array, UInt8Array, + Array as ArrowArray, BinaryArray, BooleanArray, Date32Array, Decimal128Array, + Decimal256Array, Float32Array, Float64Array, Int16Array, Int32Array, Int64Array, Int8Array, + LargeBinaryArray, LargeStringArray, StringArray, TimestampMicrosecondArray, UInt16Array, + UInt32Array, UInt64Array, UInt8Array, }, arrow_schema::{DataType as ArrowDataType, Field as ArrowField, TimeUnit}, std::sync::Arc,