Skip to content

Commit 60a1b79

Browse files
committed
fix
1 parent 52f55c3 commit 60a1b79

File tree

4 files changed

+14
-36
lines changed

4 files changed

+14
-36
lines changed

driver/src/conn.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,20 @@ pub trait Connection: DynClone + Send + Sync {
190190
))
191191
}
192192

193-
async fn begin(&self) -> Result<()>;
194-
async fn commit(&self) -> Result<()>;
195-
async fn rollback(&self) -> Result<()>;
193+
async fn begin(&self) -> Result<()> {
194+
let _ = self.exec("BEGIN").await;
195+
Ok(())
196+
}
197+
198+
async fn commit(&self) -> Result<()> {
199+
let _ = self.exec("COMMIT").await;
200+
Ok(())
201+
}
202+
203+
async fn rollback(&self) -> Result<()> {
204+
let _ = self.exec("ROLLBACK").await;
205+
Ok(())
206+
}
196207

197208
async fn get_files(&self, stage: &str, local_file: &str) -> Result<RowStatsIterator> {
198209
let mut total_count: usize = 0;

driver/src/flight_sql.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -143,21 +143,6 @@ impl Connection for FlightSQLConnection {
143143
"STREAM LOAD unavailable for FlightSQL".to_string(),
144144
))
145145
}
146-
147-
async fn begin(&self) -> Result<()> {
148-
self.exec("BEGIN").await.unwrap();
149-
Ok(())
150-
}
151-
152-
async fn commit(&self) -> Result<()> {
153-
self.exec("COMMIT").await.unwrap();
154-
Ok(())
155-
}
156-
157-
async fn rollback(&self) -> Result<()> {
158-
self.exec("ROLLBACK").await.unwrap();
159-
Ok(())
160-
}
161146
}
162147

163148
impl FlightSQLConnection {

driver/src/rest_api.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -187,21 +187,6 @@ impl Connection for RestAPIConnection {
187187
let stats = self.load_data(sql, reader, size, None, None).await?;
188188
Ok(stats)
189189
}
190-
191-
async fn begin(&self) -> Result<()> {
192-
self.exec("BEGIN").await.unwrap();
193-
Ok(())
194-
}
195-
196-
async fn commit(&self) -> Result<()> {
197-
self.exec("COMMIT").await.unwrap();
198-
Ok(())
199-
}
200-
201-
async fn rollback(&self) -> Result<()> {
202-
self.exec("ROLLBACK").await.unwrap();
203-
Ok(())
204-
}
205190
}
206191

207192
impl<'o> RestAPIConnection {

sql/src/value.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ impl Value {
138138
impl TryFrom<(&DataType, &str)> for Value {
139139
type Error = Error;
140140

141-
#[allow(deprecated)]
142141
fn try_from((t, v): (&DataType, &str)) -> Result<Self> {
143142
match t {
144143
DataType::Null => Ok(Self::Null),
@@ -522,7 +521,6 @@ impl_try_from_number_value!(f64);
522521

523522
impl TryFrom<Value> for NaiveDateTime {
524523
type Error = Error;
525-
#[allow(deprecated)]
526524
fn try_from(val: Value) -> Result<Self> {
527525
match val {
528526
Value::Timestamp(i) => {
@@ -618,7 +616,6 @@ impl std::fmt::Display for Value {
618616
}
619617

620618
// Compatible with Databend, inner values of nested types are quoted.
621-
#[allow(deprecated)]
622619
fn encode_value(f: &mut std::fmt::Formatter<'_>, val: &Value, raw: bool) -> std::fmt::Result {
623620
match val {
624621
Value::Null => write!(f, "NULL"),

0 commit comments

Comments
 (0)