forked from babelfish-for-postgresql/babelfish_extensions
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable Shared Catcache Invalidation Messages for Temp Tables (babelf…
…ish-for-postgresql#2770) * Empty * empty * empty * Resolve merge diff with relcache changes Signed-off-by: Tim Chang <[email protected]> * Clean up unnecessary code, added comments Signed-off-by: Tim Chang <[email protected]> * Add some tests for local cache inval Signed-off-by: Tim Chang <[email protected]> * Added alter table and drop function Signed-off-by: Tim Chang <[email protected]> * Move SIMessageIsForTempTable to hook Signed-off-by: Tim Chang <[email protected]> * Revert "Move SIMessageIsForTempTable to hook" This reverts commit c79ac5a. --------- Signed-off-by: Tim Chang <[email protected]>
- Loading branch information
1 parent
175fbd1
commit 0e32726
Showing
7 changed files
with
131 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
|
||
-- Catalog entries for temp tables are not visible from places like `pg_class` or `information_schema.tables` | ||
-- So the best way to check whether the cache entries have been updated locally properly is to just ensure that | ||
-- it's visible in typical use. | ||
-- pg_class, pg_type, pg_attribute | ||
CREATE TABLE #t1(a int) | ||
go | ||
|
||
insert into #t1 values (1) | ||
go | ||
~~ROW COUNT: 1~~ | ||
|
||
|
||
select * from #t1 | ||
go | ||
~~START~~ | ||
int | ||
1 | ||
~~END~~ | ||
|
||
|
||
drop table #t1 | ||
go | ||
|
||
select * from #t1 | ||
go | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: relation "#t1" does not exist)~~ | ||
|
||
|
||
|
||
-- constraint, depend, index, sequence, attrdefault | ||
create table #t2(a int identity primary key, b int default 0) | ||
go | ||
|
||
alter table #t2 add c int | ||
go | ||
|
||
ALTER TABLE #t2 ALTER COLUMN a bigint | ||
go | ||
|
||
alter table #t2 alter column b bigint | ||
go | ||
|
||
insert into #t2(c) values (2) | ||
go | ||
~~ROW COUNT: 1~~ | ||
|
||
|
||
insert into #t2(c) values (4) | ||
go | ||
~~ROW COUNT: 1~~ | ||
|
||
|
||
insert into #t2(b, c) values (3, 2) | ||
go | ||
~~ROW COUNT: 1~~ | ||
|
||
|
||
select * from #t2 | ||
go | ||
~~START~~ | ||
bigint#!#bigint#!#int | ||
1#!#0#!#2 | ||
2#!#0#!#4 | ||
3#!#3#!#2 | ||
~~END~~ | ||
|
||
|
||
drop table #t2 | ||
go | ||
|
||
select * from #t2 | ||
go | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: relation "#t2" does not exist)~~ | ||
|
Empty file.
Empty file.
51 changes: 51 additions & 0 deletions
51
test/JDBC/input/temp_tables/temp_catalog_inval-vu-verify.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
-- Catalog entries for temp tables are not visible from places like `pg_class` or `information_schema.tables` | ||
-- So the best way to check whether the cache entries have been updated locally properly is to just ensure that | ||
-- it's visible in typical use. | ||
|
||
-- pg_class, pg_type, pg_attribute | ||
CREATE TABLE #t1(a int) | ||
go | ||
|
||
insert into #t1 values (1) | ||
go | ||
|
||
select * from #t1 | ||
go | ||
|
||
drop table #t1 | ||
go | ||
|
||
select * from #t1 | ||
go | ||
|
||
-- constraint, depend, index, sequence, attrdefault | ||
|
||
create table #t2(a int identity primary key, b int default 0) | ||
go | ||
|
||
alter table #t2 add c int | ||
go | ||
|
||
ALTER TABLE #t2 ALTER COLUMN a bigint | ||
go | ||
|
||
alter table #t2 alter column b bigint | ||
go | ||
|
||
insert into #t2(c) values (2) | ||
go | ||
|
||
insert into #t2(c) values (4) | ||
go | ||
|
||
insert into #t2(b, c) values (3, 2) | ||
go | ||
|
||
select * from #t2 | ||
go | ||
|
||
drop table #t2 | ||
go | ||
|
||
select * from #t2 | ||
go |