Hybrid Query Cache messed up transaction settings
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Trafodion |
Fix Released
|
Critical
|
Howard Qin |
Bug Description
With HYBRID QUERY CACHE turned on, SET TRANSACTION READ ONLY ends up having no effect. As shown in the following example, the 2nd insert statement was expecting error 3141, but the insert went through even after the TRANSACTION was set to READ ONLY. This problem goes away once we turn the CQD HYBRID QUERY CACHE to ‘OFF’.
This is seen on the v0110_0830 build. It is a regression introduced sometime around the end of December.
-------
Here is the entire script to reproduce it:
drop schema mytest cascade;
create schema mytest;
set schema mytest;
create table t (a int);
insert into t values (1);
SET TRANSACTION READ ONLY;
insert into t values (2);
select * from t;
-------
Here is the execution output with the CQD HYBRID_QUERY_CACHE turned on (it’s on by default)
>>drop schema mytest cascade;
*** ERROR[1003] Schema TRAFODION.MYTEST does not exist.
--- SQL operation failed with errors.
>>create schema mytest;
--- SQL operation complete.
>>set schema mytest;
--- SQL operation complete.
>>create table t (a int);
--- SQL operation complete.
>>insert into t values (1);
--- 1 row(s) inserted.
>>SET TRANSACTION READ ONLY;
--- SQL operation complete.
>>insert into t values (2);
--- 1 row(s) inserted.
>>select * from t;
A
-----------
1
2
--- 2 row(s) selected.
-------
Here is the execution output with the CQD HYBRID_QUERY_CACHE turned off
>>cqd HYBRID_QUERY_CACHE 'OFF';
--- SQL operation complete.
>>drop schema mytest cascade;
--- SQL operation complete.
>>create schema mytest;
--- SQL operation complete.
>>set schema mytest;
--- SQL operation complete.
>>create table t (a int);
--- SQL operation complete.
>>insert into t values (1);
--- 1 row(s) inserted.
>>SET TRANSACTION READ ONLY;
--- SQL operation complete.
>>insert into t values (2);
*** ERROR[3141] The transaction access mode cannot be READ ONLY for an INSERT, UPDATE, DELETE, or DDL statement.
*** ERROR[8822] The statement was not prepared.
>>select * from t;
A
-----------
1
--- 1 row(s) selected.
summary: |
- HYBRID QUERY CACHE messed up transaction settings + Hybrid Query Cache messed up transaction settings |
Changed in trafodion: | |
assignee: | nobody → Howard Qin (hao-qin) |
Changed in trafodion: | |
milestone: | r1.0 → r1.1 |
Changed in trafodion: | |
status: | New → In Progress |
Verified fix on qinhao_ hqc_utt_ 0124:
>>drop schema mytest cascade;
*** ERROR[1003] Schema TRAFODION.MYTEST does not exist.
--- SQL operation failed with errors.
>>create schema mytest;
--- SQL operation complete.
>>set schema mytest;
--- SQL operation complete.
>>create table t (a int);
--- SQL operation complete.
>>insert into t values (1);
--- 1 row(s) inserted.
>>SET TRANSACTION READ ONLY;
--- SQL operation complete.
>>insert into t values (2);
*** ERROR[3141] The transaction access mode cannot be READ ONLY for an INSERT, UPDATE, DELETE, or DDL statement.
*** ERROR[8822] The statement was not prepared.
>>select * from t;
A
-----------
1
--- 1 row(s) selected.
Also verified on pcec_hqc_utt:
>>drop schema mytest cascade;
--- SQL operation complete.
>>create schema mytest;
--- SQL operation complete.
>>set schema mytest;
--- SQL operation complete.
>>create table t (a int);
--- SQL operation complete.
>>insert into t values (1);
--- 1 row(s) inserted.
>>SET TRANSACTION READ ONLY;
--- SQL operation complete.
>>insert into t values (2);
*** ERROR[3141] The transaction access mode cannot be READ ONLY for an INSERT, UPDATE, DELETE, or DDL statement.
*** ERROR[8822] The statement was not prepared.
>>select * from t;
A
-----------
1
--- 1 row(s) selected.
>>exit;