-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR removes the 3node-tenant exclusion for test suites that worked without modification locally. Further, in the case of the enums and builtin_function suites, it moves a few tests into a different file so that the rest of the tests can be run in tenant mode. This was the result of an initial pass through all the test files marked !3node-tenant. There are likely more tests we can enable. Release note: None
- Loading branch information
1 parent
db2d016
commit 71118ee
Showing
10 changed files
with
169 additions
and
180 deletions.
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
150 changes: 150 additions & 0 deletions
150
pkg/sql/logictest/testdata/logic_test/builtin_function_notenant
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,150 @@ | ||
# LogicTest: !3node-tenant !fakedist-spec-planning | ||
|
||
subtest check_consistency | ||
|
||
# Sanity-check crdb_internal.check_consistency. | ||
|
||
statement error start key must be >= "\\x02" | ||
SELECT crdb_internal.check_consistency(true, '\x01', '\xffff') | ||
|
||
statement error end key must be < "\\xff\\xff" | ||
SELECT crdb_internal.check_consistency(true, '\x02', '\xffff00') | ||
|
||
statement error start key must be less than end key | ||
SELECT crdb_internal.check_consistency(true, '\x02', '\x02') | ||
|
||
statement error start key must be less than end key | ||
SELECT crdb_internal.check_consistency(true, '\x03', '\x02') | ||
|
||
query ITT | ||
SELECT range_id, status, regexp_replace(detail, '[0-9]+', '', 'g') FROM crdb_internal.check_consistency(true, '\x02', '\xffff') WHERE range_id = 1 | ||
---- | ||
1 RANGE_CONSISTENT stats: {ContainsEstimates: LastUpdateNanos: IntentAge: GCBytesAge: LiveBytes: LiveCount: KeyBytes: KeyCount: ValBytes: ValCount: IntentBytes: IntentCount: SeparatedIntentCount: SysBytes: SysCount: AbortSpanBytes:} | ||
|
||
# Without explicit keys, scans all ranges (we don't test this too precisely to | ||
# avoid flaking the test when the range count changes, just want to know that | ||
# we're touching multiple ranges). | ||
query B | ||
SELECT count(*) > 5 FROM crdb_internal.check_consistency(true, '', '') | ||
---- | ||
true | ||
|
||
# Query that should touch only a single range. | ||
query B | ||
SELECT count(*) = 1 FROM crdb_internal.check_consistency(true, '\x03', '\x0300') | ||
---- | ||
true | ||
|
||
# Ditto, but implicit start key \x02 | ||
query B | ||
SELECT count(*) = 1 FROM crdb_internal.check_consistency(true, '', '\x0200') | ||
---- | ||
true | ||
|
||
# Ditto, but implicit end key. | ||
query B | ||
SELECT count(*) = 1 FROM crdb_internal.check_consistency(true, '\xff', '') | ||
---- | ||
true | ||
|
||
# Test crdb_internal commands which execute as root, but | ||
# only checks for permissions afterwards. | ||
subtest crdb_internal_privileged_only | ||
|
||
user root | ||
|
||
statement ok | ||
CREATE DATABASE root_test; | ||
REVOKE CONNECT ON DATABASE root_test FROM public | ||
|
||
statement ok | ||
CREATE TABLE root_test.t(a int) | ||
|
||
statement ok | ||
ALTER DATABASE root_test CONFIGURE ZONE USING num_replicas = 5 | ||
|
||
query I | ||
SELECT crdb_internal.get_namespace_id(0, 'does_not_exist') | ||
---- | ||
NULL | ||
|
||
query I | ||
SELECT crdb_internal.get_namespace_id(0, 'root_test') | ||
---- | ||
53 | ||
|
||
query I | ||
SELECT crdb_internal.get_namespace_id(crdb_internal.get_namespace_id(0, 'root_test'), 't') | ||
---- | ||
54 | ||
|
||
query T | ||
SELECT crdb_internal.get_zone_config(-1)::string | ||
---- | ||
NULL | ||
|
||
query T | ||
SELECT crdb_internal.get_zone_config(crdb_internal.get_namespace_id(0, 'root_test'))::string | ||
---- | ||
\x2805500158017800 | ||
|
||
query T | ||
SELECT crdb_internal.get_zone_config(crdb_internal.get_namespace_id(crdb_internal.get_namespace_id(0, 'root_test'), 't'))::string | ||
---- | ||
NULL | ||
|
||
# switch users -- this one has no permissions so expect errors | ||
user testuser | ||
|
||
query I | ||
SELECT crdb_internal.get_namespace_id(0, 'does_not_exist') | ||
---- | ||
NULL | ||
|
||
query error insufficient privilege | ||
SELECT crdb_internal.get_namespace_id(0, 'root_test') | ||
|
||
query T | ||
SELECT crdb_internal.get_zone_config(-1)::string | ||
---- | ||
NULL | ||
|
||
query error insufficient privilege | ||
SELECT crdb_internal.get_zone_config(53)::string -- based on root query. having no permissions blocks us from this test rapidly changing though. | ||
|
||
# give testuser permissions on everything and retest | ||
user root | ||
|
||
statement ok | ||
GRANT ALL ON DATABASE root_test TO testuser | ||
|
||
statement ok | ||
GRANT ALL ON root_test.t TO testuser | ||
|
||
user testuser | ||
|
||
query I | ||
SELECT crdb_internal.get_namespace_id(0, 'root_test') | ||
---- | ||
53 | ||
|
||
query I | ||
SELECT crdb_internal.get_namespace_id(crdb_internal.get_namespace_id(0, 'root_test'), 't') | ||
---- | ||
54 | ||
|
||
query T | ||
SELECT crdb_internal.get_zone_config(crdb_internal.get_namespace_id(0, 'root_test'))::string | ||
---- | ||
\x2805500158017800 | ||
|
||
query T | ||
SELECT crdb_internal.get_zone_config(crdb_internal.get_namespace_id(crdb_internal.get_namespace_id(0, 'root_test'), 't'))::string | ||
---- | ||
NULL | ||
|
||
# reset state to default | ||
user root | ||
|
||
statement ok | ||
DROP DATABASE root_test CASCADE |
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
# LogicTest: !3node-tenant(50047) | ||
|
||
################### | ||
# CREATE STATISTICS | ||
################### | ||
|
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
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,15 @@ | ||
# Tenant tests disabled because of use of SPLIT AT and SCATTER. | ||
# LogicTest: !3node-tenant | ||
|
||
# Regression test for incorrectly serializing NULL expression type annotation in | ||
# a enum tuple. | ||
statement ok | ||
CREATE TYPE greeting58889 AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning'); | ||
CREATE TABLE t58889 AS SELECT enum_range('hello'::greeting58889)[g] as _enum FROM generate_series(1, 5) as g; | ||
ALTER TABLE t58889 SPLIT AT SELECT i FROM generate_series(1, 5) as g(i); | ||
ALTER TABLE t58889 SCATTER; | ||
|
||
query T | ||
SELECT _enum FROM t58889 WHERE _enum::greeting58889 IN (NULL, 'hi':::greeting58889); | ||
---- | ||
hi |
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
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
# LogicTest: !3node-tenant(49854) | ||
|
||
statement ok | ||
GRANT CREATE ON DATABASE test TO testuser | ||
|
||
|
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
Oops, something went wrong.