Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YSQL][SQLsmith] ERROR: Illegal state: Transaction for catalog table write operation 'sql_features' not found #11221

Open
def- opened this issue Jan 26, 2022 · 0 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug kind/failing-test Tests and testing infra priority/medium Medium priority issue qa_automation Bugs identified via itest-system, LST, Stress automation or causing automation failures

Comments

@def-
Copy link
Contributor

def- commented Jan 26, 2022

Jira Link: DB-967

Description

Happens in updates, might be a duplicate of #10087, also found with SQLsmith. Similar issue was #9645 previously, but that's been closed already.

CREATE TABLE mvtest_t (id int NOT NULL PRIMARY KEY, type text NOT NULL, amt numeric NOT NULL);
INSERT INTO mvtest_t VALUES
  (1, 'x', 2),
  (2, 'x', 3),
  (3, 'y', 5),
  (4, 'y', 7),
  (5, 'z', 11);
CREATE VIEW mvtest_tv AS SELECT type, sum(amt) AS totamt FROM mvtest_t GROUP BY type;
CREATE TABLE mvtest_boxes (id serial primary key, b box);
INSERT INTO mvtest_boxes (b) VALUES
  ('(32,32),(31,31)'),
  ('(2.0000004,2.0000004),(1,1)'),
  ('(1.9999996,1.9999996),(1,1)');

update information_schema.sql_features set 
  feature_name = case when (select utc_offset from pg_catalog.pg_timezone_abbrevs limit 1 offset 5)
         >= (select write_lag from pg_catalog.pg_stat_replication limit 1 offset 56)
         then information_schema.sql_features.sub_feature_name else information_schema.sql_features.sub_feature_name end
    , 
  sub_feature_id = (select feature_id from information_schema.sql_parts limit 1 offset 1)
    , 
  sub_feature_name = case when case when cast(null as lseg) @ (select b from public.mvtest_boxes limit 1 offset 6)
             then (select totamt from public.mvtest_tv limit 1 offset 5)
           else (select totamt from public.mvtest_tv limit 1 offset 5)
           end
         >= case when case when ((select b from public.mvtest_boxes limit 1 offset 2)
                   |>> cast(null as box)) 
              and (false) then cast(null as tsvector) else cast(null as tsvector) end
             @@@ cast(null as tsquery) then (select pg_catalog.var_pop(amopstrategy) from pg_catalog.pg_amop)
           else (select pg_catalog.var_pop(amopstrategy) from pg_catalog.pg_amop)
           end
         then information_schema.sql_features.feature_id else information_schema.sql_features.feature_id end
    , 
  is_verified_by = information_schema.sql_features.feature_name, 
  comments = information_schema.sql_features.feature_id
returning 
  information_schema.sql_features.feature_name as c0, 
  information_schema.sql_features.feature_name as c1, 
  information_schema.sql_features.feature_name as c2, 
  (select mapseqno from pg_catalog.pg_ts_config_map limit 1 offset 2)
     as c3, 
  information_schema.sql_features.is_supported as c4, 
  information_schema.sql_features.comments as c5, 
  information_schema.sql_features.is_verified_by as c6;

Fails with:

ERROR:  Illegal state: Transaction for catalog table write operation 'sql_features' not found

If this is expected, I guess the error message should at least be adapted not to say "Illegal state", which sounds like a bug.

@def- def- added area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug labels Jan 26, 2022
@def- def- changed the title [YSQL] ERROR: Illegal state: Transaction for catalog table write operation 'sql_features' not found [YSQL][SQLsmith] ERROR: Illegal state: Transaction for catalog table write operation 'sql_features' not found Feb 3, 2022
@yugabyte-ci yugabyte-ci added the priority/medium Medium priority issue label Jun 8, 2022
@kripasreenivasan kripasreenivasan added the qa_automation Bugs identified via itest-system, LST, Stress automation or causing automation failures label Sep 13, 2022
@yugabyte-ci yugabyte-ci added the kind/failing-test Tests and testing infra label Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug kind/failing-test Tests and testing infra priority/medium Medium priority issue qa_automation Bugs identified via itest-system, LST, Stress automation or causing automation failures
Projects
None yet
Development

No branches or pull requests

4 participants