mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-03 20:02:54 +00:00
refactor: use "USE" keyword (#785)
Co-authored-by: luofucong <luofucong@greptime.com>
This commit is contained in:
@@ -17,7 +17,7 @@ use std::time::Instant;
|
||||
|
||||
use async_trait::async_trait;
|
||||
use common_query::Output;
|
||||
use common_telemetry::{debug, error};
|
||||
use common_telemetry::{error, trace};
|
||||
use opensrv_mysql::{
|
||||
AsyncMysqlShim, ErrorKind, InitWriter, ParamParser, QueryResultWriter, StatementMetaWriter,
|
||||
};
|
||||
@@ -74,7 +74,7 @@ impl MysqlInstanceShim {
|
||||
}
|
||||
|
||||
async fn do_query(&self, query: &str) -> Vec<Result<Output>> {
|
||||
debug!("Start executing query: '{}'", query);
|
||||
trace!("Start executing query: '{}'", query);
|
||||
let start = Instant::now();
|
||||
|
||||
// TODO(LFC): Find a better way to deal with these special federated queries:
|
||||
@@ -89,7 +89,7 @@ impl MysqlInstanceShim {
|
||||
.await
|
||||
};
|
||||
|
||||
debug!(
|
||||
trace!(
|
||||
"Finished executing query: '{}', total time costs in microseconds: {}",
|
||||
query,
|
||||
start.elapsed().as_micros()
|
||||
|
||||
@@ -102,8 +102,7 @@ impl<'a> ParserContext<'a> {
|
||||
|
||||
Keyword::DROP => self.parse_drop(),
|
||||
|
||||
// TODO(LFC): Use "Keyword::USE" when we can upgrade to newer version of crate sqlparser.
|
||||
Keyword::NoKeyword if w.value.to_lowercase() == "use" => {
|
||||
Keyword::USE => {
|
||||
self.parser.next_token();
|
||||
|
||||
let database_name =
|
||||
|
||||
Reference in New Issue
Block a user