This commit is contained in:
Alexander Tokmakov 2021-05-31 21:28:36 +03:00
parent 5692db736c
commit 02d966dcc9
4 changed files with 13 additions and 13 deletions

View File

@ -14,7 +14,7 @@ class FunctionTransactionID : public IFunction
public:
static constexpr auto name = "transactionID";
static FunctionPtr create(ContextPtr context)
static FunctionPtr create(ContextConstPtr context)
{
return std::make_shared<FunctionTransactionID>(context->getCurrentTransaction());
}

View File

@ -34,6 +34,7 @@ ln -sf $SRC_PATH/config.d/logging_no_rotate.xml $DEST_SERVER_PATH/config.d/
ln -sf $SRC_PATH/config.d/tcp_with_proxy.xml $DEST_SERVER_PATH/config.d/
ln -sf $SRC_PATH/config.d/top_level_domains_lists.xml $DEST_SERVER_PATH/config.d/
ln -sf $SRC_PATH/config.d/top_level_domains_path.xml $DEST_SERVER_PATH/config.d/
ln -sf $SRC_PATH/config.d/transactions.xml $DEST_SERVER_PATH/config.d/
ln -sf $SRC_PATH/users.d/log_queries.xml $DEST_SERVER_PATH/users.d/
ln -sf $SRC_PATH/users.d/readonly.xml $DEST_SERVER_PATH/users.d/
ln -sf $SRC_PATH/users.d/access_management.xml $DEST_SERVER_PATH/users.d/
@ -46,7 +47,6 @@ ln -sf $SRC_PATH/strings_dictionary.xml $DEST_SERVER_PATH/
ln -sf $SRC_PATH/decimals_dictionary.xml $DEST_SERVER_PATH/
ln -sf $SRC_PATH/executable_dictionary.xml $DEST_SERVER_PATH/
ln -sf $SRC_PATH/executable_pool_dictionary.xml $DEST_SERVER_PATH/
ln -sf $SRC_PATH/transactions.xml $DEST_SERVER_PATH/
ln -sf $SRC_PATH/top_level_domains $DEST_SERVER_PATH/

View File

@ -4,8 +4,8 @@ drop table if exists mt2;
create table mt1 (n Int64) engine=MergeTree order by n;
create table mt2 (n Int64) engine=MergeTree order by n;
commit; -- { serverError 585 }
rollback; -- { serverError 585 }
commit; -- { serverError 586 }
rollback; -- { serverError 586 }
begin transaction;
insert into mt1 values (1);
@ -21,7 +21,7 @@ rollback;
begin transaction;
select 'no nested', arraySort(groupArray(n)) from (select n from mt1 union all select * from mt2);
begin transaction; -- { serverError 585 }
begin transaction; -- { serverError 586 }
rollback;
begin transaction;
@ -31,8 +31,8 @@ select 'on exception before start', arraySort(groupArray(n)) from (select n from
-- rollback on exception before start
select functionThatDoesNotExist(); -- { serverError 46 }
-- cannot commit after exception
commit; -- { serverError 585 }
begin transaction; -- { serverError 585 }
commit; -- { serverError 586 }
begin transaction; -- { serverError 586 }
rollback;
begin transaction;
@ -42,10 +42,10 @@ select 'on exception while processing', arraySort(groupArray(n)) from (select n
-- rollback on exception while processing
select throwIf(100 < number) from numbers(1000); -- { serverError 395 }
-- cannot commit after exception
commit; -- { serverError 585 }
insert into mt1 values (5); -- { serverError 585 }
insert into mt2 values (50); -- { serverError 585 }
select 1; -- { serverError 585 }
commit; -- { serverError 586 }
insert into mt1 values (5); -- { serverError 586 }
insert into mt2 values (50); -- { serverError 586 }
select 1; -- { serverError 586 }
rollback;
begin transaction;
@ -54,8 +54,8 @@ insert into mt2 values (60);
select 'on session close', arraySort(groupArray(n)) from (select n from mt1 union all select * from mt2);
-- trigger reconnection by error on client, check rollback on session close
insert into mt1 values ([1]); -- { clientError 43 }
commit; -- { serverError 585 }
rollback; -- { serverError 585 }
commit; -- { serverError 586 }
rollback; -- { serverError 586 }
begin transaction;
insert into mt1 values (7);