You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix writable rules on tables has relative matview.
Though rules are not well supported in GPDB, we have
to update matview data status if there were.
Some SQL will generate like INSERT into another table
which has relative matview.
Authored-by: Zhang Mingli avamingli@gmail.com
Copy file name to clipboardExpand all lines: src/test/regress/expected/matview_data.out
+55Lines changed: 55 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -347,6 +347,61 @@ select mvname, datastatus from gp_matview_aux where mvname in ('mv0','mv1', 'mv2
347
347
mv3 | e
348
348
(1 row)
349
349
350
+
--
351
+
-- test issue https://github.com/cloudberrydb/cloudberrydb/issues/582
352
+
-- test rules
353
+
begin;
354
+
create table t1_issue_582(i int, j int);
355
+
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'i' as the Cloudberry Database data distribution key for this table.
356
+
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
357
+
create table t2_issue_582(i int, j int);
358
+
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'i' as the Cloudberry Database data distribution key for this table.
359
+
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
360
+
create table t3_issue_582(i int, j int);
361
+
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'i' as the Cloudberry Database data distribution key for this table.
362
+
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
363
+
create materialized view mv_t2_issue_582 as select j from t2_issue_582 where i = 1;
364
+
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column(s) named 'j' as the Cloudberry Database data distribution key for this table.
365
+
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
366
+
create rule r1 as on insert TO t1_issue_582 do also insert into t2_issue_582 values(1,1);
367
+
select count(*) from t1_issue_582;
368
+
count
369
+
-------
370
+
0
371
+
(1 row)
372
+
373
+
select count(*) from t2_issue_582;
374
+
count
375
+
-------
376
+
0
377
+
(1 row)
378
+
379
+
select mvname, datastatus from gp_matview_aux where mvname = 'mv_t2_issue_582';
380
+
mvname | datastatus
381
+
-----------------+------------
382
+
mv_t2_issue_582 | u
383
+
(1 row)
384
+
385
+
insert into t1_issue_582 values(1,1);
386
+
select count(*) from t1_issue_582;
387
+
count
388
+
-------
389
+
1
390
+
(1 row)
391
+
392
+
select count(*) from t2_issue_582;
393
+
count
394
+
-------
395
+
1
396
+
(1 row)
397
+
398
+
select mvname, datastatus from gp_matview_aux where mvname = 'mv_t2_issue_582';
0 commit comments