Skip to content
Snippets Groups Projects
Commit 2ce1f572 authored by EmirVildanov's avatar EmirVildanov Committed by Maksim Kaitmazian
Browse files

feat: bump sbroad with mock param and transaction settings

parent 8d4effdc
No related branches found
No related tags found
1 merge request!1051feat: bump sbroad with mock params setting
Pipeline #43497 passed
......@@ -59,6 +59,7 @@ columns.
- New function [TRIM][sql_trim]
- New functions `TO_CHAR`, `TO_DATE`
- Allow `PRIMARY KEY` next to column declaration
- Support `SET ...` and `SET TRANSACTION ...` but they are ignored
[CREATE INDEX]: https://docs.picodata.io/picodata/24.4/reference/sql/create_index/
[DROP INDEX]: https://docs.picodata.io/picodata/24.4/reference/sql/drop_index/
......
Subproject commit c6c3b541b21ba08da3843396878f26e49fc65a2b
Subproject commit c508313e4b3f913e15736f0f36db037a63bae2a9
......@@ -50,10 +50,14 @@ pub enum CommandTag {
RevokeRole = 11,
#[default]
Select = 12,
SetParam = 20,
SetTransaction = 21,
Update = 13,
}
impl CommandTag {
/// Note: Should be in accordance with
/// `<https://github.com/postgres/postgres/blob/master/src/include/tcop/cmdtaglist.h>`
pub fn as_str(&self) -> &str {
match *self {
Self::AlterRole => "ALTER ROLE",
......@@ -82,6 +86,7 @@ impl CommandTag {
Self::DropProcedure => "DROP PROCEDURE",
Self::CallProcedure => "CALL",
Self::RenameRoutine => "RENAME ROUTINE",
Self::SetParam | Self::SetTransaction => "SET",
}
}
}
......@@ -102,6 +107,8 @@ impl From<CommandTag> for QueryType {
| CommandTag::CreateIndex
| CommandTag::RenameRoutine
| CommandTag::DropIndex
| CommandTag::SetParam
| CommandTag::SetTransaction
| CommandTag::DropProcedure => QueryType::Ddl,
CommandTag::Delete
| CommandTag::Insert
......@@ -142,6 +149,8 @@ impl TryFrom<&Node> for CommandTag {
Ddl::DropProc { .. } => Ok(CommandTag::DropProcedure),
Ddl::DropIndex { .. } => Ok(CommandTag::DropIndex),
Ddl::RenameRoutine { .. } => Ok(CommandTag::RenameRoutine),
Ddl::SetParam { .. } => Ok(CommandTag::SetParam),
Ddl::SetTransaction { .. } => Ok(CommandTag::SetTransaction),
},
Node::Relational(rel) => match rel {
Relational::Delete { .. } => Ok(CommandTag::Delete),
......
......@@ -18,7 +18,6 @@ use crate::util::{duration_from_secs_f64_clamped, effective_user_id};
use crate::{cas, unwrap_ok_or};
use opentelemetry::{baggage::BaggageExt, Context, KeyValue};
use sbroad::debug;
use sbroad::errors::{Action, Entity, SbroadError};
use sbroad::executor::engine::helpers::{decode_msgpack, normalize_name_for_space_api};
use sbroad::executor::protocol::{EncodedRequiredData, RequiredData};
......@@ -34,6 +33,7 @@ use sbroad::ir::tree::traversal::{PostOrderWithFilter, REL_CAPACITY};
use sbroad::ir::value::{LuaValue, Value};
use sbroad::ir::{Node as IrNode, Plan as IrPlan};
use sbroad::otm::{query_id, query_span};
use sbroad::{debug, warn};
use smol_str::{format_smolstr, SmolStr};
use tarantool::access_control::{box_access_check_ddl, SchemaObjectType as TntSchemaObjectType};
use tarantool::schema::function::func_next_reserved_id;
......@@ -850,6 +850,20 @@ fn reenterable_schema_change_request(
};
Params::RenameRoutine(params)
}
IrNode::Ddl(Ddl::SetParam { param_value, .. }) => {
warn!(
None,
&format!(
"Parameters setting is currently disabled. Skipping update for {}.",
param_value.param_name()
),
);
return Ok(ConsumerResult { row_count: 0 });
}
IrNode::Ddl(Ddl::SetTransaction { .. }) => {
warn!(None, "Transaction setting is currently disabled. Skipping.");
return Ok(ConsumerResult { row_count: 0 });
}
IrNode::Acl(Acl::DropUser { name, .. }) => {
// Nothing to check
Params::DropUser(name)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment