diff --git a/src/adapter/src/command.rs b/src/adapter/src/command.rs index f40f24cacc62a..2ce44cf7dfcfc 100644 --- a/src/adapter/src/command.rs +++ b/src/adapter/src/command.rs @@ -260,8 +260,6 @@ pub enum ExecuteResponse { AlteredRole, /// The system configuration was altered. AlteredSystemConfiguration, - /// The query was canceled. - Canceled, /// The requested cursor was closed. ClosedCursor, /// The provided comment was created. @@ -447,7 +445,6 @@ impl TryInto for ExecuteResponseKind { ExecuteResponseKind::AlteredSystemConfiguration => { Ok(ExecuteResponse::AlteredSystemConfiguration) } - ExecuteResponseKind::Canceled => Ok(ExecuteResponse::Canceled), ExecuteResponseKind::ClosedCursor => Ok(ExecuteResponse::ClosedCursor), ExecuteResponseKind::Comment => Ok(ExecuteResponse::Comment), ExecuteResponseKind::Copied => Err(()), @@ -511,7 +508,6 @@ impl ExecuteResponse { AlteredIndexLogicalCompaction => Some("ALTER INDEX".into()), AlteredRole => Some("ALTER ROLE".into()), AlteredSystemConfiguration => Some("ALTER SYSTEM".into()), - Canceled => None, ClosedCursor => Some("CLOSE CURSOR".into()), Comment => Some("COMMENT".into()), Copied(n) => Some(format!("COPY {}", n)), diff --git a/src/adapter/src/coord/sequencer.rs b/src/adapter/src/coord/sequencer.rs index 5c6ace0b5e26b..9cbefc3f8593c 100644 --- a/src/adapter/src/coord/sequencer.rs +++ b/src/adapter/src/coord/sequencer.rs @@ -41,7 +41,7 @@ use crate::error::AdapterError; use crate::notice::AdapterNotice; use crate::session::{EndTransactionAction, Session, TransactionOps, TransactionStatus, WriteOp}; use crate::util::ClientTransmitter; -use crate::{ExecuteContext, ExecuteResponseKind}; +use crate::ExecuteContext; // DO NOT make this visible in any way, i.e. do not add any version of // `pub` to this mod. The inner `sequence_X` methods are hidden in this @@ -74,8 +74,7 @@ impl Coordinator { ) -> LocalBoxFuture<'_, ()> { async move { event!(Level::TRACE, plan = format!("{:?}", plan)); - let mut responses = ExecuteResponse::generated_from(PlanKind::from(&plan)); - responses.push(ExecuteResponseKind::Canceled); + let responses = ExecuteResponse::generated_from(PlanKind::from(&plan)); ctx.tx_mut().set_allowed(responses); // Scope the borrow of the Catalog because we need to mutate the Coordinator state below. diff --git a/src/adapter/src/coord/sequencer/inner.rs b/src/adapter/src/coord/sequencer/inner.rs index 6a66c6d092620..6740b43b326af 100644 --- a/src/adapter/src/coord/sequencer/inner.rs +++ b/src/adapter/src/coord/sequencer/inner.rs @@ -2503,10 +2503,6 @@ impl Coordinator { } } ExecuteResponse::SendingRowsImmediate { rows } => make_diffs(rows), - resp @ ExecuteResponse::Canceled => { - ctx.retire(Ok(resp)); - return; - } resp => Err(AdapterError::Unstructured(anyhow!( "unexpected peek response: {resp:?}" ))), diff --git a/src/adapter/src/statement_logging.rs b/src/adapter/src/statement_logging.rs index eb0708d78343f..7cecc7fd26749 100644 --- a/src/adapter/src/statement_logging.rs +++ b/src/adapter/src/statement_logging.rs @@ -180,7 +180,6 @@ impl From<&ExecuteResponse> for StatementEndedExecutionReason { execution_strategy: Some(StatementExecutionStrategy::Constant), } } - ExecuteResponse::Canceled => StatementEndedExecutionReason::Canceled, ExecuteResponse::AlteredDefaultPrivileges | ExecuteResponse::AlteredObject(_) diff --git a/src/environmentd/src/http/sql.rs b/src/environmentd/src/http/sql.rs index c7253fdd87fa6..ec0671ec27c91 100644 --- a/src/environmentd/src/http/sql.rs +++ b/src/environmentd/src/http/sql.rs @@ -1124,7 +1124,6 @@ async fn execute_stmt( let tag = res.tag(); Ok(match res { - ExecuteResponse::Canceled => SqlResult::err(client, AdapterError::Canceled).into(), ExecuteResponse::CreatedConnection { .. } | ExecuteResponse::CreatedDatabase { .. } | ExecuteResponse::CreatedSchema { .. } diff --git a/src/pgwire/src/protocol.rs b/src/pgwire/src/protocol.rs index b56cf6ead7ed6..f6a3e02b64094 100644 --- a/src/pgwire/src/protocol.rs +++ b/src/pgwire/src/protocol.rs @@ -1412,14 +1412,6 @@ where } let r = match response { - ExecuteResponse::Canceled => { - return self - .error(ErrorResponse::error( - SqlState::QUERY_CANCELED, - "canceling statement due to user request", - )) - .await; - } ExecuteResponse::ClosedCursor => { self.complete_portal(&portal_name); command_complete!()