Skip to content

Commit

Permalink
feat(frontend): support SET SESSION CHARACTERISTICS AS TRANSACTION (r…
Browse files Browse the repository at this point in the history
  • Loading branch information
wenym1 committed Mar 13, 2023
1 parent 79a3786 commit f36bf0b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/frontend/src/handler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ use std::task::{Context, Poll};

use futures::stream::{self, BoxStream};
use futures::{Stream, StreamExt};
use pgwire::pg_response::StatementType::{ABORT, BEGIN, COMMIT, ROLLBACK, START_TRANSACTION};
use pgwire::pg_response::StatementType::{
ABORT, BEGIN, COMMIT, ROLLBACK, SET_TRANSACTION, START_TRANSACTION,
};
use pgwire::pg_response::{PgResponse, RowSetResult};
use pgwire::pg_server::BoxedError;
use pgwire::types::{Format, Row};
Expand Down Expand Up @@ -410,6 +412,10 @@ pub async fn handle(
ROLLBACK,
"Ignored temporarily. See detail in issue#2541".to_string(),
)),
Statement::SetTransaction { .. } => Ok(PgResponse::empty_result_with_notice(
SET_TRANSACTION,
"Ignored temporarily. See detail in issue#2541".to_string(),
)),
_ => Err(
ErrorCode::NotImplemented(format!("Unhandled statement: {}", stmt), None.into()).into(),
),
Expand Down
1 change: 1 addition & 0 deletions src/utils/pgwire/src/pg_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ pub enum StatementType {
BEGIN,
COMMIT,
ROLLBACK,
SET_TRANSACTION,
}

impl std::fmt::Display for StatementType {
Expand Down

0 comments on commit f36bf0b

Please sign in to comment.