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

sql: add support for extra session vars for pg compatibility #35116

Merged
merged 1 commit into from
Feb 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
238 changes: 125 additions & 113 deletions pkg/sql/logictest/testdata/logic_test/pg_catalog

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions pkg/sql/logictest/testdata/logic_test/set
Original file line number Diff line number Diff line change
Expand Up @@ -292,3 +292,15 @@ SET tracing.blah = 123

statement error invalid value for parameter "ssl_renegotiation_limit"
SET ssl_renegotiation_limit = 123

subtest regression_35109_flowable

statement ok
SET DATESTYLE = ISO;
SET INTERVALSTYLE = POSTGRES;
SET extra_float_digits TO 3;
SET synchronize_seqscans TO off;
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET row_security = off;
78 changes: 41 additions & 37 deletions pkg/sql/logictest/testdata/logic_test/show_source
Original file line number Diff line number Diff line change
Expand Up @@ -25,43 +25,47 @@ SELECT *
FROM [SHOW ALL]
WHERE variable != 'optimizer' AND variable != 'crdb_version'
----
variable value
application_name ·
bytea_output hex
client_encoding UTF8
client_min_messages notice
database test
datestyle ISO, MDY
default_int_size 8
default_transaction_isolation serializable
default_transaction_read_only off
distsql off
experimental_enable_zigzag_join off
experimental_force_split_at off
experimental_reorder_joins_limit 4
experimental_serial_normalization rowid
experimental_vectorize off
extra_float_digits 0
force_savepoint_restart off
integer_datetimes on
intervalstyle postgres
max_index_keys 32
node_id 1
results_buffer_size 16384
search_path public
server_encoding UTF8
server_version 9.5.0
server_version_num 90500
session_user root
sql_safe_updates off
standard_conforming_strings on
statement_timeout 0
timezone UTC
tracing off
transaction_isolation serializable
transaction_priority normal
transaction_read_only off
transaction_status NoTxn
variable value
application_name ·
bytea_output hex
client_encoding UTF8
client_min_messages notice
database test
datestyle ISO, MDY
default_int_size 8
default_transaction_isolation serializable
default_transaction_read_only off
distsql off
experimental_enable_zigzag_join off
experimental_force_split_at off
experimental_reorder_joins_limit 4
experimental_serial_normalization rowid
experimental_vectorize off
extra_float_digits 0
force_savepoint_restart off
idle_in_transaction_session_timeout 0
integer_datetimes on
intervalstyle postgres
lock_timeout 0
max_index_keys 32
node_id 1
results_buffer_size 16384
row_security off
search_path public
server_encoding UTF8
server_version 9.5.0
server_version_num 90500
session_user root
sql_safe_updates off
standard_conforming_strings on
statement_timeout 0
synchronize_seqscans on
timezone UTC
tracing off
transaction_isolation serializable
transaction_priority normal
transaction_read_only off
transaction_status NoTxn

query I colnames
SELECT * FROM [SHOW CLUSTER SETTING sql.defaults.distsql]
Expand Down
45 changes: 14 additions & 31 deletions pkg/sql/logictest/testdata/planner_test/explain
Original file line number Diff line number Diff line change
Expand Up @@ -140,34 +140,32 @@ split · ·
· row 0, expr 0 42

query TTT
EXPLAIN DROP TABLE foo
SELECT * FROM [EXPLAIN DROP TABLE foo] WHERE field != 'size'
----
drop table · ·

query TTT
EXPLAIN SHOW DATABASES
SELECT * FROM [EXPLAIN SHOW DATABASES] WHERE field != 'size'
----
distinct · ·
│ order key database_name
└── sort · ·
│ order +database_name
└── render · ·
└── values · ·
· size 4 columns, 20 rows

query TTT
EXPLAIN SHOW TABLES
SELECT * FROM [EXPLAIN SHOW TABLES] WHERE field != 'size'
----
sort · ·
│ order +table_schema,+table_name
└── render · ·
└── filter · ·
│ filter table_schema = 'public'
└── values · ·
· size 6 columns, 92 rows

query TTT
EXPLAIN SHOW TABLES WITH COMMENT
SELECT * FROM [EXPLAIN SHOW TABLES WITH COMMENT] WHERE field != 'size'
----
sort · ·
│ order +table_schema,+table_name
Expand All @@ -183,60 +181,53 @@ sort · ·
│ ├── filter · ·
│ │ │ filter table_schema = 'public'
│ │ └── values · ·
│ │ size 6 columns, 92 rows
│ └── values · ·
│ size 13 columns, 16 rows
└── scan · ·
· table comments@primary
· spans ALL

query TTT
EXPLAIN SHOW DATABASE
SELECT * FROM [EXPLAIN SHOW DATABASE] WHERE field != 'size'
----
render · ·
└── filter · ·
│ filter variable = 'database'
└── values · ·
· size 3 columns, 41 rows

query TTT
EXPLAIN SHOW TIME ZONE
SELECT * FROM [EXPLAIN SHOW TIME ZONE] WHERE field != 'size'
----
render · ·
└── filter · ·
│ filter variable = 'timezone'
└── values · ·
· size 3 columns, 41 rows

query TTT
EXPLAIN SHOW DEFAULT_TRANSACTION_ISOLATION
SELECT * FROM [EXPLAIN SHOW DEFAULT_TRANSACTION_ISOLATION] WHERE field != 'size'
----
render · ·
└── filter · ·
│ filter variable = 'default_transaction_isolation'
└── values · ·
· size 3 columns, 41 rows

query TTT
EXPLAIN SHOW TRANSACTION ISOLATION LEVEL
SELECT * FROM [EXPLAIN SHOW TRANSACTION ISOLATION LEVEL] WHERE field != 'size'
----
render · ·
└── filter · ·
│ filter variable = 'transaction_isolation'
└── values · ·
· size 3 columns, 41 rows

query TTT
EXPLAIN SHOW TRANSACTION PRIORITY
SELECT * FROM [EXPLAIN SHOW TRANSACTION PRIORITY] WHERE field != 'size'
----
render · ·
└── filter · ·
│ filter variable = 'transaction_priority'
└── values · ·
· size 3 columns, 41 rows

query TTT
EXPLAIN SHOW COLUMNS FROM foo
SELECT * FROM [EXPLAIN SHOW COLUMNS FROM foo] WHERE field != 'size'
----
sort · ·
│ order +ordinal_position
Expand All @@ -259,35 +250,31 @@ sort · ·
│ └── filter · ·
│ │ filter ((table_catalog = 'test') AND (table_schema = 'public')) AND (table_name = 'foo')
│ └── values · ·
│ size 23 columns, 962 rows
└── render · ·
└── filter · ·
│ filter ((table_catalog = 'test') AND (table_schema = 'public')) AND (table_name = 'foo')
└── values · ·
· size 13 columns, 3 rows

query TTT
EXPLAIN SHOW GRANTS ON foo
SELECT * FROM [EXPLAIN SHOW GRANTS ON foo] WHERE field != 'size'
----
sort · ·
│ order +database_name,+schema_name,+table_name,+grantee,+privilege_type
└── render · ·
└── filter · ·
│ filter (table_catalog, table_schema, table_name) IN (('test', 'public', 'foo'),)
└── values · ·
· size 8 columns, 600 rows

query TTT
EXPLAIN SHOW INDEX FROM foo
SELECT * FROM [EXPLAIN SHOW INDEX FROM foo] WHERE field != 'size'
----
render · ·
└── filter · ·
│ filter ((table_catalog = 'test') AND (table_schema = 'public')) AND (table_name = 'foo')
└── values · ·
· size 13 columns, 3 rows

query TTT
EXPLAIN SHOW CONSTRAINTS FROM foo
SELECT * FROM [EXPLAIN SHOW CONSTRAINTS FROM foo] WHERE field != 'size'
----
sort · ·
│ order +table_name,+constraint_name
Expand All @@ -298,15 +285,12 @@ sort · ·
├── filter · ·
│ │ filter relname = 'foo'
│ └── values · ·
│ size 27 columns, 94 rows
└── join · ·
│ type cross
├── filter · ·
│ │ filter nspname = 'public'
│ └── values · ·
│ size 4 columns, 4 rows
└── values · ·
· size 26 columns, 0 rows

query TTT
EXPLAIN SHOW USERS
Expand Down Expand Up @@ -334,14 +318,13 @@ CREATE TABLE t (
)

query TTT
EXPLAIN INSERT INTO t VALUES (1, 2)
SELECT * FROM [EXPLAIN INSERT INTO t VALUES (1, 2)] WHERE field != 'size'
----
count · ·
└── insert · ·
│ into t(k, v)
│ strategy inserter
└── values · ·
· size 2 columns, 1 row

query I
SELECT max(level) FROM [EXPLAIN (VERBOSE) INSERT INTO t VALUES (1, 2)]
Expand Down
Loading