diff --git a/nexus/peer-mysql/src/lib.rs b/nexus/peer-mysql/src/lib.rs index d57e83b932..0de23ca2e8 100644 --- a/nexus/peer-mysql/src/lib.rs +++ b/nexus/peer-mysql/src/lib.rs @@ -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 { @@ -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 = Expr::Value(Value::Number("0", false)); Ok(Some(self.query_schema(query.to_string()).await?)) } Statement::Declare { stmts } => { @@ -228,5 +229,5 @@ impl QueryExecutor for MySqlQueryExecutor { "only SELECT statements are supported in mysql".to_owned(), )))), } - } + } }