Skip to content

Commit

Permalink
mysql: limit 0 describe (#1670)
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex authored May 4, 2024
1 parent 1769b3d commit bdbdfca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nexus/peer-mysql/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use peer_cursor::{
};
use pgwire::error::{ErrorInfo, PgWireError, PgWireResult};
use pt::peerdb_peers::MySqlConfig;
use sqlparser::ast::{CloseCursor, Declare, FetchDirection, Statement};
use sqlparser::ast::{CloseCursor, Declare, Expr, FetchDirection, Statement, Value};
use stream::MyRecordStream;

pub struct MySqlQueryExecutor {
Expand Down Expand Up @@ -202,6 +202,7 @@ impl QueryExecutor for MySqlQueryExecutor {
Statement::Query(query) => {
let mut query = query.clone();
ast::rewrite_query(&self.peer_name, &mut query);
query.limit = Some(Expr::Value(Value::Number(String::from("0"), false)));
Ok(Some(self.query_schema(query.to_string()).await?))
}
Statement::Declare { stmts } => {
Expand Down

0 comments on commit bdbdfca

Please sign in to comment.