Skip to content

Commit

Permalink
Merge #74774
Browse files Browse the repository at this point in the history
74774: sql: support default `default_table_access_method` var value r=rafiss a=otan

Release note (sql change): Support the `default_table_access_method`
session variable, which only takes in `heap` (same as PG).

Co-authored-by: Oliver Tan <otan@cockroachlabs.com>
  • Loading branch information
craig[bot] and otan committed Jan 20, 2022
2 parents 506412f + 0cbc387 commit fb72381
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/sql/logictest/testdata/logic_test/information_schema
Expand Up @@ -4632,6 +4632,7 @@ database test
datestyle ISO, MDY
datestyle_enabled off
default_int_size 8
default_table_access_method heap
default_tablespace ·
default_transaction_isolation serializable
default_transaction_priority normal
Expand Down
3 changes: 3 additions & 0 deletions pkg/sql/logictest/testdata/logic_test/pg_catalog
Expand Up @@ -4039,6 +4039,7 @@ database test NULL
datestyle ISO, MDY NULL NULL NULL string
datestyle_enabled off NULL NULL NULL string
default_int_size 8 NULL NULL NULL string
default_table_access_method heap NULL NULL NULL string
default_tablespace · NULL NULL NULL string
default_transaction_isolation serializable NULL NULL NULL string
default_transaction_priority normal NULL NULL NULL string
Expand Down Expand Up @@ -4150,6 +4151,7 @@ database test NULL
datestyle ISO, MDY NULL user NULL ISO, MDY ISO, MDY
datestyle_enabled off NULL user NULL off off
default_int_size 8 NULL user NULL 8 8
default_table_access_method heap NULL user NULL heap heap
default_tablespace · NULL user NULL · ·
default_transaction_isolation serializable NULL user NULL default default
default_transaction_priority normal NULL user NULL normal normal
Expand Down Expand Up @@ -4256,6 +4258,7 @@ database NULL NULL NULL
datestyle NULL NULL NULL NULL NULL
datestyle_enabled NULL NULL NULL NULL NULL
default_int_size NULL NULL NULL NULL NULL
default_table_access_method NULL NULL NULL NULL NULL
default_tablespace NULL NULL NULL NULL NULL
default_transaction_isolation NULL NULL NULL NULL NULL
default_transaction_priority NULL NULL NULL NULL NULL
Expand Down
18 changes: 18 additions & 0 deletions pkg/sql/logictest/testdata/logic_test/set
Expand Up @@ -530,6 +530,24 @@ SET standard_conforming_strings='true'
statement ok
SET standard_conforming_strings='on'

subtest default_table_access_method_test

query T
SHOW default_table_access_method
----
heap

statement ok
SET default_table_access_method = 'heap'

query T
SHOW default_table_access_method
----
heap

statement error invalid value for parameter "default_table_access_method": "not-heap"
SET default_table_access_method = 'not-heap'

subtest default_with_oids_test

query T
Expand Down
1 change: 1 addition & 0 deletions pkg/sql/logictest/testdata/logic_test/show_source
Expand Up @@ -37,6 +37,7 @@ database test
datestyle ISO, MDY
datestyle_enabled off
default_int_size 8
default_table_access_method heap
default_tablespace ·
default_transaction_isolation serializable
default_transaction_priority normal
Expand Down
3 changes: 3 additions & 0 deletions pkg/sql/vars.go
Expand Up @@ -1033,6 +1033,9 @@ var varGen = map[string]sessionVar{
},
},

// See https://www.postgresql.org/docs/12/runtime-config-client.html.
`default_table_access_method`: makeCompatStringVar(`default_table_access_method`, `heap`),

// See https://www.postgresql.org/docs/13/runtime-config-compatible.html
// CockroachDB only supports safe_encoding for now. If `client_encoding` is updated to
// allow encodings other than UTF8, then the default value of `backslash_quote` should
Expand Down

0 comments on commit fb72381

Please sign in to comment.