Closed cockroach-teamcity closed 2 years ago
I ran the above query in cockroach demo
and it returned successfully after 73 seconds. Although it didn't time out, this seems unacceptably long. This is pretty much all planning time, since running EXPLAIN took just as long. I was planning to look into avoiding out-of-control exploration this milestone anyway, so I'll take this one.
Here's the explain output:
info
-----------------------------------------------------------------------------------------------------------------------
distribution: local
vectorized: true
• render
│
└── • cross join
│
├── • values
│ size: 0 columns, 2 rows
│
└── • render
│
└── • hash join
│ equality: (col1_2, col1_7, col1_9) = (tableoid, col1_1, col1_2)
│
├── • scan
│ estimated row count: 1 (100% of the table; stats collected 7797 days ago)
│ table: table1@primary
│ spans: FULL SCAN
│
└── • lookup join
│ table: seed@seed__int8__float8__date_idx
│ equality: (_int8, col1_5, _date) = (_int8,_float8,_date)
│
└── • hash join
│ equality: (_float8) = (_float8)
│
├── • scan
│ missing stats
│ table: seed@seed__int8__float8__date_idx
│ spans: FULL SCAN
│
└── • lookup join
│ table: seed@seed__int8__float8__date_idx
│ equality: (_int8, col1_5, _date) = (_int8,_float8,_date)
│
└── • hash join
│ equality: (_float8) = (col1_5)
│
├── • scan
│ missing stats
│ table: seed@seed__int8__float8__date_idx
│ spans: FULL SCAN
│
└── • hash join
│ equality: (_float4, tableoid, _bool) = (col1_5, col1_9, col1_7)
│
├── • scan
│ missing stats
│ table: seed@primary
│ spans: FULL SCAN
│
└── • hash join
│ estimated row count: 1
│ equality: (col1_7) = (col1_1)
│
├── • scan
│ estimated row count: 1 (100% of the table; stats collected 7797 days ago)
│ table: table1@primary
│ spans: FULL SCAN
│
└── • scan
estimated row count: 1 (100% of the table; stats collected 7797 days ago)
table: table1@primary
spans: FULL SCAN
(65 rows)
Time: 73.718s total (execution 73.716s / network 0.001s)
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ d302ba88430dd2438a5edcee15edf18286f81485:
Random syntax error:
rsg_test.go:758: Crash detected: server panic: pq: internal error: ordering column group (86,107) contains non-equivalent columns (op sort)
Query:
SELECT
tab_113436._int8 AS col_275928, 'morning':::greeting AS col_275929, (-398418261):::INT8 AS col_275930
FROM
defaultdb.public.table1@[0] AS tab_113433,
defaultdb.public.table1 AS tab_113434
JOIN defaultdb.public.table1 AS tab_113435 ON (tab_113434.col1_3) = (tab_113435.col1_3),
defaultdb.public.seed@seed__int8__float8__date_idx AS tab_113436
WHERE
tab_113436._timestamp::TIMESTAMP
IN (
SELECT
'2003-05-24 07:10:14.00064':::TIMESTAMP::TIMESTAMP AS col_275927
FROM
defaultdb.public.table1@table1_col1_3_col1_11_col1_8_key AS tab_113437
CROSS JOIN defaultdb.public.seed AS tab_113438
JOIN defaultdb.public.seed AS tab_113439 ON
(tab_113438._int8) = (tab_113439._int8)
AND (tab_113438._date) = (tab_113439._date)
AND (tab_113438._float8) = (tab_113439._float8)
ORDER BY
tab_113438._float8
LIMIT
60:::INT8
)
ORDER BY
tab_113436.tableoid, tab_113436._float4 ASC;
Schema:
rsg_test.go:575: To reproduce, use schema:
rsg_test.go:577:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
CREATE TABLE table1 (col1_0 TIMESTAMPTZ NOT NULL, col1_1 GEOMETRY NULL, col1_2 DECIMAL, col1_3 FLOAT8 NOT NULL, col1_4 REGNAMESPACE, col1_5 BIT(8) NOT NULL, col1_6 GEOGRAPHY NULL, PRIMARY KEY (col1_3 DESC), col1_7 STRING NULL AS (lower(CAST(col1_6 AS STRING))) VIRTUAL, col1_8 DECIMAL AS (col1_2 + 3.550033052832808082:::DECIMAL) STORED, col1_9 FLOAT8 NOT NULL AS (col1_3 + 0.497998586285051:::FLOAT8) STORED, col1_10 STRING NOT NULL AS (lower(CAST(col1_5 AS STRING))) STORED, col1_11 STRING NULL AS (lower(CAST(col1_1 AS STRING))) STORED, col1_12 DECIMAL AS (col1_2 + 30.61209985902611578:::DECIMAL) VIRTUAL, UNIQUE (col1_12 DESC) STORING (col1_0, col1_1, col1_4, col1_6, col1_9, col1_11) WHERE ((((((((table1.col1_12 > (-1):::DECIMAL) OR (table1.col1_11 = e'\x00':::STRING)) AND (table1.col1_7 != '':::STRING)) OR (table1.col1_0 != '-4713-11-24 00:00:00+00:00':::TIMESTAMPTZ)) OR (table1.col1_2 < 1:::DECIMAL)) AND (table1.col1_3 != 1.7976931348623157e+308:::FLOAT8)) AND (table1.col1_10 > e'\'':::STRING)) AND (table1.col1_8 > 1:::DECIMAL)) OR (table1.col1_9 > 1.0:::FLOAT8), UNIQUE (col1_8 DESC), UNIQUE (col1_3 DESC, col1_11 DESC, col1_8 ASC), FAMILY (col1_3, col1_10, col1_11), FAMILY (col1_2), FAMILY (col1_9), FAMILY (col1_8), FAMILY (col1_6, col1_0), FAMILY (col1_5), FAMILY (col1_4), FAMILY (col1_1));
ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_buckets": [{"distinct_range": 0, "num_eq": 40000, "num_range": 0, "upper_bound": "-1.234E+401"}, {"distinct_range": 0, "num_eq": 1000000, "num_range": 30000, "upper_bound": "-1.593833161628708709E+37"}, {"distinct_range": 1880.944320486462, "num_eq": 100000, "num_range": 50000, "upper_bound": "-16290021464502.95524"}, {"distinct_range": 0, "num_eq": 0, "num_range": 90000000000, "upper_bound": "-7515370.294339942049"}, {"distinct_range": 0, "num_eq": 8511961180902637821, "num_range": 6639511280030620208, "upper_bound": "-19.00789536121382126"}, {"distinct_range": 6198993880038014000, "num_eq": 2361953163753166240, "num_range": 7011014969151530613, "upper_bound": "-0.210538495615389233"}], "histo_col_type": "DECIMAL", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "FLOAT8", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_buckets": [{"distinct_range": 0, "num_eq": 30, "num_range": 0, "upper_bound": "-6.5721726433648423E+31"}, {"distinct_range": 3332.473832685133, "num_eq": 6606630882253542330, "num_range": 4000, "upper_bound": "-4.25125393598237224E+31"}, {"distinct_range": 0, "num_eq": 4169877423974819578, "num_range": 700000, "upper_bound": "-1.568693296326996467E+25"}, {"distinct_range": 0, "num_eq": 6391808848030140558, "num_range": 0, "upper_bound": "-3850772350.02974916"}, {"distinct_range": 35.714710249632525, "num_eq": 4000, "num_range": 60, "upper_bound": "-365073132.0455555171"}, {"distinct_range": 0, "num_eq": 40000000, "num_range": 900000000, "upper_bound": "-0.5772396389686308703"}, {"distinct_range": 0, "num_eq": 7185296202474942042, "num_range": 500, "upper_bound": "0.583521811696482645"}, {"distinct_range": 0, "num_eq": 50000000000, "num_range": 6470701084940945867, "upper_bound": "649299.1089278752323"}, {"distinct_range": 10, "num_eq": 8448351309556226909, "num_range": 10, "upper_bound": "4.33863041625053782E+30"}], "histo_col_type": "DECIMAL", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}]':::JSONB;
CREATE TYPE rand_typ_0 AS ENUM ('wotsm', 'vpbqra', 'mv');
CREATE TYPE rand_typ_1 AS ENUM ('axiuk');
;
rsg_test.go:577:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
SELECT
g::INT2 AS _int2,
g::INT4 AS _int4,
g::INT8 AS _int8,
g::FLOAT4 AS _float4,
g::FLOAT8 AS _float8,
'2001-01-01'::DATE + g AS _date,
'2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
'2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
g * '1 day'::INTERVAL AS _interval,
g % 2 = 1 AS _bool,
g::DECIMAL AS _decimal,
g::STRING AS _string,
g::STRING::BYTES AS _bytes,
substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
'0.0.0.0'::INET + g AS _inet,
g::STRING::JSONB AS _jsonb,
enum_range('hello'::greeting)[g] as _enum
FROM
generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);
;
rsg_test.go:579:
rsg_test.go:580: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith389913818
--- FAIL: TestRandomSyntaxSQLSmith (301.26s)
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-queries @rafiss
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ 4da45c4e6b4ba223b832eb6a1f675addbc479f76:
Random syntax error:
rsg_test.go:758: Crash detected: server panic: pq: internal error: unsupported comparison: inet to timestamptz
Query:
SELECT
2973815690:::OID AS col_358145,
tab_171555._bool AS col_358146,
'baa26c92-f3ac-44c2-818a-b8d831484cc2':::UUID AS col_358147,
1815077610:::INT8 AS col_358148,
tab_171555._jsonb AS col_358149,
tab_171555._inet AS col_358150
FROM
defaultdb.public.seed@[0] AS tab_171555, defaultdb.public.table1@table1_col1_0_idx2 AS tab_171556
WHERE
tab_171555._timestamptz::TIMESTAMPTZ
IN (
SELECT
tab_171559._timestamptz::TIMESTAMPTZ AS col_358144
FROM
defaultdb.public.seed@[0] AS tab_171557,
(
VALUES
(tab_171555._string, '17:34:25.975905':::TIME, NULL),
(NULL, '17:14:42.185827':::TIME, 'ftpz':::rand_typ_0),
(e'\x13':::STRING, '14:21:06.19746':::TIME, 'ftpz':::rand_typ_0),
('9':::STRING, '15:37:06.116896':::TIME, 'ftpz':::rand_typ_0)
)
AS tab_171558 (col_358141, col_358142, col_358143)
JOIN defaultdb.public.seed@[0] AS tab_171559 ON (tab_171558.col_358141) = (tab_171559._string)
WHERE
inet_contains_or_equals(tab_171557._inet::INET, tab_171559._inet::INET)::BOOL
)
ORDER BY
tab_171555._decimal DESC
LIMIT
66:::INT8;
Schema:
rsg_test.go:575: To reproduce, use schema:
rsg_test.go:577:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
CREATE TABLE table1 (col1_0 FLOAT4 NOT NULL, PRIMARY KEY (col1_0), INDEX (col1_0 ASC) WHERE table1.col1_0 < 3.4028234663852886e+38:::FLOAT8, INDEX (col1_0 ASC) WHERE table1.col1_0 = 'NaN':::FLOAT8, INDEX (col1_0 DESC), INDEX (col1_0), INDEX (col1_0));
ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4283731778942957209, "histo_buckets": [{"distinct_range": 0, "num_eq": 10000000, "num_range": 0, "upper_bound": "-6.886928895255551e-05"}, {"distinct_range": 4000000000, "num_eq": 3333689417456556457, "num_range": 4000000000, "upper_bound": "0.0"}, {"distinct_range": 16311.737087740335, "num_eq": 2502599904030049360, "num_range": 50000, "upper_bound": "0.1145235151052475"}, {"distinct_range": 319500903969075700, "num_eq": 2754034447400989278, "num_range": 4326802992298550619, "upper_bound": "1.1152844429016113"}, {"distinct_range": 1000, "num_eq": 600000000, "num_range": 1000, "upper_bound": "+Inf"}], "histo_col_type": "FLOAT4", "name": "__auto__", "null_count": 0, "row_count": 5121945173902761046}]':::JSONB;
CREATE TYPE rand_typ_0 AS ENUM ('ftpz', 'rckql');
CREATE TYPE rand_typ_1 AS ENUM ('zuqo', 'hzx', 'tdm', 'vwxre');
;
rsg_test.go:577:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
SELECT
g::INT2 AS _int2,
g::INT4 AS _int4,
g::INT8 AS _int8,
g::FLOAT4 AS _float4,
g::FLOAT8 AS _float8,
'2001-01-01'::DATE + g AS _date,
'2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
'2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
g * '1 day'::INTERVAL AS _interval,
g % 2 = 1 AS _bool,
g::DECIMAL AS _decimal,
g::STRING AS _string,
g::STRING::BYTES AS _bytes,
substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
'0.0.0.0'::INET + g AS _inet,
g::STRING::JSONB AS _jsonb,
enum_range('hello'::greeting)[g] as _enum
FROM
generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);
;
rsg_test.go:579:
rsg_test.go:580: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith638472654
--- FAIL: TestRandomSyntaxSQLSmith (300.64s)
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-queries @rafiss
One of the errors above appears unrelated to the original timeout: internal error: ordering column group (86,107) contains non-equivalent columns (op sort)
. I've created https://github.com/cockroachdb/cockroach/issues/65038 to track separately.
Another error above appears unrelated to the original: internal error: unsupported comparison: inet to timestamptz
. I've created https://github.com/cockroachdb/cockroach/issues/65040 to track separately.
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ b706c913c07890d04d6bbec4d9d7cd8fea609b95:
Random syntax error:
rsg_test.go:758: Crash detected: server panic: pq: internal error: ordering column group (69,72) contains non-equivalent columns (op sort)
Query:
SELECT
tab_15335.col2_6 AS col_34990, tab_15335.col2_5 AS col_34991
FROM
defaultdb.public.table2@[0] AS tab_15335,
defaultdb.public.seed AS tab_15336
JOIN defaultdb.public.seed AS tab_15337 ON (tab_15336._jsonb) = (tab_15337._jsonb)
WHERE
tab_15337._jsonb::JSONB
IN (
SELECT
'{"K+yuY- 7*)": 0.4259132288587886, "foo": "foo", "m./MbfSmc(v5": {}}':::JSONB::JSONB AS col_34989
FROM
defaultdb.public.table3@table3_col3_1_key AS tab_15338
JOIN defaultdb.public.table1@table1_col1_3_col1_1_col1_2_col1_0_key AS tab_15339 ON
(tab_15338.tableoid) = (tab_15339.tableoid) AND (tab_15338.tableoid) = (tab_15339.col1_2)
LIMIT
36:::INT8
)
ORDER BY
tab_15335.col2_6 DESC;
Schema:
rsg_test.go:575: To reproduce, use schema:
rsg_test.go:577:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
CREATE TABLE table1 (col1_0 DATE NOT NULL, col1_1 TIMESTAMPTZ NOT NULL, col1_2 REGCLASS, col1_3 REGTYPE NOT NULL, PRIMARY KEY (col1_1, col1_3, col1_0 ASC), UNIQUE (col1_3, col1_1, col1_2, col1_0 ASC) WHERE (table1.col1_1 < '294276-12-31 23:59:59.999999+00:00':::TIMESTAMPTZ) OR (table1.col1_0 <= 'infinity':::DATE), INDEX (col1_2 DESC) WHERE (table1.col1_1 <= '-4713-11-24 00:00:00+00:00':::TIMESTAMPTZ) OR (table1.col1_0 != '-infinity':::DATE), INDEX (col1_3 DESC), UNIQUE (col1_1, col1_0) WHERE (table1.col1_1 <= '3000-01-01 00:00:00+00:00':::TIMESTAMPTZ) AND (table1.col1_0 != '4714-11-24 BC':::DATE), INDEX (col1_1 ASC, col1_0, col1_3 DESC) STORING (col1_2) WHERE (table1.col1_1 != '-4713-11-24 00:00:00+00:00':::TIMESTAMPTZ) OR (table1.col1_0 > '4714-11-24 BC':::DATE), INDEX (col1_0 DESC, col1_3, col1_1 DESC, col1_2 ASC) WHERE (table1.col1_1 != '0001-01-01 00:00:00+00:00':::TIMESTAMPTZ) AND (table1.col1_0 = '4714-11-24 BC':::DATE));
CREATE TABLE table2 (col1_1 TIMESTAMPTZ NOT NULL, col1_3 REGTYPE NOT NULL, col1_0 DATE NOT NULL, col2_3 INET NULL, col2_4 INT8 NOT NULL, col2_5 INT2 NOT NULL, col2_6 BOOL NOT NULL, col2_7 TIMESTAMPTZ NULL, PRIMARY KEY (col1_1, col1_3, col1_0 ASC, col2_6, col2_5 ASC), FAMILY (col1_1), FAMILY (col2_3), FAMILY (col2_6, col1_3), FAMILY (col2_4, col2_5, col1_0), FAMILY (col2_7)) INTERLEAVE IN PARENT table1 (col1_1, col1_3, col1_0);
CREATE TABLE table3 (col3_0 BIT(2) NOT NULL, col3_1 UUID NULL, col3_2 TIME NULL, col3_3 DATE, col3_4 BOOL NOT NULL, col3_5 GEOGRAPHY NOT NULL, col3_6 GEOGRAPHY NULL, col3_7 STRING NULL, col3_8 BOOL, col3_9 NAME NULL, col3_10 STRING NULL AS (lower(CAST(col3_2 AS STRING))) VIRTUAL, UNIQUE (col3_1 ASC) WHERE (table3.col3_9 = 'X':::STRING) AND (table3.col3_7 = '':::STRING), FAMILY (col3_6), FAMILY (col3_7), FAMILY (col3_4), FAMILY (col3_0), FAMILY (col3_2, col3_1), FAMILY (col3_5, col3_3, col3_8, col3_9));
ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 386326, "histo_buckets": [{"distinct_range": 0, "num_eq": 2408327683088214024, "num_range": 0, "upper_bound": "-2000-01-01 00:00:00+00:00"}, {"distinct_range": 0, "num_eq": 3518830263716402606, "num_range": 50000, "upper_bound": "0001-01-01 00:00:00+00:00"}, {"distinct_range": 54.30767199483436, "num_eq": 2415233614258979298, "num_range": 70, "upper_bound": "1972-06-06 20:57:55.00053+00:00"}, {"distinct_range": 3157843964260642300, "num_eq": 70000, "num_range": 6300877920011220329, "upper_bound": "1992-05-29 14:16:55.000323+00:00"}, {"distinct_range": 0, "num_eq": 4480119013305665636, "num_range": 0, "upper_bound": "294276-12-31 23:59:59.999999+00:00"}], "histo_col_type": "TIMESTAMPTZ", "name": "__auto__", "null_count": 0, "row_count": 1000000}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 910751, "histo_buckets": [{"distinct_range": 0, "num_eq": 10000000000, "num_range": 0, "upper_bound": "0"}, {"distinct_range": 0, "num_eq": 4663780897004554387, "num_range": 6000, "upper_bound": "1635632381"}], "histo_col_type": "REGCLASS", "name": "__auto__", "null_count": 156879, "row_count": 1000000}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 741972, "histo_buckets": [{"distinct_range": 0, "num_eq": 6866013477245888787, "num_range": 0, "upper_bound": "764780961"}, {"distinct_range": 584077.3227655145, "num_eq": 2577015643288310712, "num_range": 3000000, "upper_bound": "2116028993"}, {"distinct_range": 8907022353017312000, "num_eq": 1000000000, "num_range": 8907022353017312135, "upper_bound": "2207303910"}, {"distinct_range": 1895721686069397200, "num_eq": 4333518653185345318, "num_range": 7861601356617778137, "upper_bound": "3070962665"}, {"distinct_range": 3917356333250449400, "num_eq": 600, "num_range": 3917356333250449453, "upper_bound": "3901232490"}, {"distinct_range": 5760629620740565000, "num_eq": 0, "num_range": 6520415792035473882, "upper_bound": "4256842089"}], "histo_col_type": "REGTYPE", "name": "__auto__", "null_count": 0, "row_count": 1000000}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 349922, "histo_buckets": [{"distinct_range": 0, "num_eq": 900000000, "num_range": 0, "upper_bound": "1978-11-12"}], "histo_col_type": "DATE", "name": "__auto__", "null_count": 0, "row_count": 1000000}]':::JSONB;
ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 36067, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000000}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 712840, "histo_col_type": "", "name": "__auto__", "null_count": 427382, "row_count": 1000000}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 946751, "histo_buckets": [{"distinct_range": 0, "num_eq": 5187312064898021622, "num_range": 0, "upper_bound": "2005-07-27 06:12:59.000033+00:00"}], "histo_col_type": "TIMESTAMPTZ", "name": "__auto__", "null_count": 0, "row_count": 1000000}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 203407, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000000}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 641591, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000000}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 777622, "histo_col_type": "", "name": "__auto__", "null_count": 63504, "row_count": 1000000}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 234730, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000000}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 412999, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000000}]':::JSONB;
ALTER TABLE table3 INJECT STATISTICS '[{"columns": ["col3_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 284812506570259839, "histo_col_type": "", "name": "__auto__", "null_count": 5471801083085987113, "row_count": 7138300910641783044}, {"columns": ["col3_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5937883784669231200, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7138300910641783044}, {"columns": ["col3_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3184436468934660547, "histo_col_type": "", "name": "__auto__", "null_count": 3134742447902989688, "row_count": 7138300910641783044}, {"columns": ["col3_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3079452288185036527, "histo_col_type": "", "name": "__auto__", "null_count": 4468429143086453398, "row_count": 7138300910641783044}, {"columns": ["col3_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 155577871864356964, "histo_col_type": "", "name": "__auto__", "null_count": 3895008263212313750, "row_count": 7138300910641783044}, {"columns": ["col3_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2024345724942155095, "histo_col_type": "", "name": "__auto__", "null_count": 1906206622753491666, "row_count": 7138300910641783044}, {"columns": ["col3_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3808040611912420735, "histo_col_type": "", "name": "__auto__", "null_count": 2777657294656698946, "row_count": 7138300910641783044}, {"columns": ["col3_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6630873764983666938, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7138300910641783044}, {"columns": ["col3_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 421392402444803878, "histo_col_type": "", "name": "__auto__", "null_count": 5425588267499428803, "row_count": 7138300910641783044}, {"columns": ["col3_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 731560063904680798, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7138300910641783044}, {"columns": ["col3_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2385415535720528372, "histo_buckets": [{"distinct_range": 0, "num_eq": 3229791713676202072, "num_range": 0, "upper_bound": "1a5be8b5-d874-4217-9757-1c88644319f5"}, {"distinct_range": 0, "num_eq": 4781944803897326735, "num_range": 20000000, "upper_bound": "54893f78-adc6-484a-81c2-cb24cd2b13a2"}, {"distinct_range": 0, "num_eq": 1110788279351663519, "num_range": 0, "upper_bound": "7d8b4aaf-10c0-4903-a24e-d39f00f8e97b"}, {"distinct_range": 605190515694263900, "num_eq": 2539171849295302649, "num_range": 912856817800875448, "upper_bound": "814e690b-f519-456b-ab42-87640eeef00f"}, {"distinct_range": 0, "num_eq": 50000, "num_range": 400000, "upper_bound": "826ce431-0404-4b4f-94b8-0f8555c6d582"}, {"distinct_range": 1691773465775115800, "num_eq": 50000, "num_range": 1691773465775115656, "upper_bound": "9ecef23a-1f48-459a-a951-dbcfc0276f0f"}, {"distinct_range": 5456437835869986000, "num_eq": 7135614270255587006, "num_range": 7677874822162903310, "upper_bound": "c6455683-5ced-4851-8ab5-5bf3e084b2c0"}, {"distinct_range": 0, "num_eq": 70000000000, "num_range": 400, "upper_bound": "ffffffff-ffff-ffff-ffff-ffffffffffff"}], "histo_col_type": "UUID", "name": "__auto__", "null_count": 6207304703043229726, "row_count": 7138300910641783044}]':::JSONB;
CREATE TYPE rand_typ_0 AS ENUM ('g');
CREATE TYPE rand_typ_1 AS ENUM ('r', 'pdec', 'bt', 'g', 'osfaku');
;
rsg_test.go:577:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
SELECT
g::INT2 AS _int2,
g::INT4 AS _int4,
g::INT8 AS _int8,
g::FLOAT4 AS _float4,
g::FLOAT8 AS _float8,
'2001-01-01'::DATE + g AS _date,
'2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
'2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
g * '1 day'::INTERVAL AS _interval,
g % 2 = 1 AS _bool,
g::DECIMAL AS _decimal,
g::STRING AS _string,
g::STRING::BYTES AS _bytes,
substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
'0.0.0.0'::INET + g AS _inet,
g::STRING::JSONB AS _jsonb,
enum_range('hello'::greeting)[g] as _enum
FROM
generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);
;
rsg_test.go:579:
rsg_test.go:580: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith499313091
--- FAIL: TestRandomSyntaxSQLSmith (300.86s)
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-queries @rafiss
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ 25e26a5f0361fcfbf71cee86f963b93f806604d8:
Random syntax error:
rsg_test.go:758: Crash detected: server panic: statement exec timeout
Query:
WITH
with_86777 (col_521594)
AS (
SELECT
*
FROM
(VALUES (ARRAY['\x27':::BYTES,'\xf7e96891':::BYTES,'\x96ee':::BYTES]), (NULL))
AS tab_212885 (col_521594)
),
with_86779 (col_521597)
AS (
SELECT
*
FROM
(
VALUES
(()),
(()),
(()),
(
(
WITH
with_86778 (col_521595)
AS (
SELECT
*
FROM
(
VALUES
(NULL),
(
'01060000A0E61000000100000001030000800100000005000000C86F061A097439C04F73C649D78B44C0504444AF7FE8FE41A8CABE3AF0845D40D8F2F5DF6CB35340B410A349C9C8F1417082F9E2F7EF65C0BCED8C157CCF4B40D48004FB2D17E1412380BE04ED5665C0747165A247FB474098E8B611111AF941C86F061A097439C04F73C649D78B44C0504444AF7FE8FE41':::GEOGRAPHY
),
(
'01070000A0E61000000300000001010000A0E610000050AE96AE08764F40E18A69E61B2949C0A8DBEAAC521BF2C101040000A0E61000000200000001010000808C89067090C44CC02AFF03FDDCE73DC0704668041065F94101010000805E43258EBD805040909A0D05692A3F40E030FC8BA9ECDC4101030000A0E61000000100000005000000EC1C5294ED3C5FC04FA67BF01C5548C0A02DB79994BBB14190048FC4A0AF29401F98BE1EFA1152C0C090A2425251C941EC7594CBFAE960406CDE850843F650C0A86519A87DB3E1C198E87185E81D4A40E4365390B31F4540BBCA7C15675CFAC1EC1C5294ED3C5FC04FA67BF01C5548C0A02DB79994BBB141':::GEOGRAPHY
),
('0106000020E610000000000000':::GEOGRAPHY),
(
'01050000E0E61000000800000001020000C00400000037F776DF96DF56C0D80BA3BF2BD622C090EDE5437826C941D6FC783D1FE7F941D96422574DDD55C0DD217EA2BE3553C0D854FE637592EBC186293F378555FEC1982B12FEB3FB5E401CDCE8760BA54F40E80DB0B9070BD4415AA2E70D81D2E5C14A9784A720D852C0A0086954B5E23340F32DD42E724300C28E273C6231F5EBC101020000C003000000E82C5F7D98C15D40E888F01AFD1A2DC063E494EA0A31F0C18076DEDEF4BEA7C1ACEB38FE3BE8614044D07B122FC9504074087479A0AF01C248AE23F13E83FE41A8366CECD45535409C09811A01BF3C402EADAD5F9CE1F641CBEF0857FCE8FCC101020000C00400000088E53E32C0954DC0BF87CDA9D37D54C07A9EAE139C410042828BD40D7624F9412874A61323184D40122E98A41F113CC002AA12810416F3C146D4B382989FE1C14E23A24CCAED644062B5B2BCFF404EC0BE2A6160E6E3F4414024042E90FAA0C1B20D2C711DC16440B80F2673BB014F4051FBB1C9B04A01C2206DFB7DA4B9FEC101020000C002000000A851C04F1D495C40860DB8241A993EC070A12B9ED70AD841A00DA819210AB5C16E2676D7A85B6040D09B62B6C3F331C0713C98924BD0FDC1CCE61A4DDEDDDAC101020000C0060000007686818EBED164C07AF36ED6433652C0F75D5B0AA422FDC1404219598411FCC1F8E7393AC35C41C0508B1A85EFB44EC0B0A425F2CC6DD4C1B0ED36094936C7C1B87651974E693A40C1A1166E36EE4CC024E900FA9882E3C14037486A7C2AA641A08571E621165F40B2A584C6ADA851C0B056FFAA514BCC414E31F584B1020242CAF0B739AC1161407AB9B8A4EB734EC00B622805AE0802C2A3D288B8350EF7C13CB34FF445F35340D20B32679FB65540D099B357A6A1FC412BDFF3BA78C6F1C101020000C00200000090EC0CE9EFF06240D96124BD3C6154C018A0D302D62EE2C1E04BCB2CCE94F5C14CB1FD5267595B4031890F1D0DEB46C09E2C57AE43B50042406C273DA616024201020000C005000000A4E71E1507195E4090FB42B87FDF5240CCB53539F1F4F9413A81AB4FE271E0C174793BEAC7B94140807A9168B6FDFA3F9E62BE6FD025ECC158848D2CCDEBE04168834D5453D753C0949945DA590E4D4006412CD8D585FDC180C553D91B3EC1C1930977B9109064C01AF94C06BC0951409C391B5ACB62DAC1FCC9D9AC0E4F01C2C0250803598841C00824FB1A2F332AC0D82A53B6FC77E941C02662C7FDAEC54101020000C005000000768A54C353BF60409D8E53B6479148C0C22D12FE6147E8C1E025174E67D9BDC10408BA15624A5D404032D006900A32C0E0D84C3D1C4DEFC10E20BB646F1FF2C18CF89092074A584010AD4068289C44407875FCE2189FF341087DE2ADE4760042964A7440BE1D6140B06C258241E352402CB8AED5A51EFE41A6AC9DF14CACF2C1FC7E6FB9667D55409E183BF553CC54406310A2C8B85901C23C1FFC2F5791D5C1':::GEOGRAPHY
),
(NULL)
)
AS tab_212886 (col_521595)
)
SELECT
() AS col_521596
FROM
defaultdb.public.table1@table1_col1_0_col1_2_col1_7_key AS tab_212887
WHERE
(false OR (tab_212887.col1_2 NOT ILIKE tab_212887.col1_3))
ORDER BY
tab_212887.tableoid ASC,
tab_212887.col1_7 DESC,
tab_212887.col1_1,
tab_212887.col1_7 ASC,
tab_212887.crdb_internal_mvcc_timestamp ASC,
tab_212887.col1_4 ASC
LIMIT
1:::INT8
)
),
(()),
(())
)
AS tab_212888 (col_521597)
)
SELECT
tab_212897.col1_12 AS col_521603,
tab_212899.col2_17 AS col_521604,
tab_212897.col1_8 AS col_521605,
NULL AS col_521606,
3454990702:::OID AS col_521607,
tab_212899.crdb_internal_mvcc_timestamp AS col_521608,
2369929513:::OID AS col_521609,
(-6772850245330114551):::INT8 AS col_521610,
e'\U00002603':::STRING AS col_521611,
tab_212894.col2_6 AS col_521612,
tab_212900._string AS col_521613,
tab_212900._int2 AS col_521614
FROM
defaultdb.public.table2@table2_col2_15_key AS tab_212889,
defaultdb.public.seed AS tab_212890
JOIN defaultdb.public.seed AS tab_212891 ON (tab_212890._jsonb) = (tab_212891._jsonb)
JOIN defaultdb.public.table2 AS tab_212892
JOIN defaultdb.public.table2 AS tab_212893 ON (tab_212892.col2_15) = (tab_212893.col2_15)
JOIN defaultdb.public.table2@table2_col2_15_key AS tab_212894
JOIN defaultdb.public.table1@table1_col1_7_col1_14_col1_8_col1_9_col1_3_col1_0_col1_10_col1_6_key
AS tab_212897 ON (tab_212894.col2_8) = (tab_212897.col1_3) ON
(tab_212893.col2_15) = (tab_212897.col1_0) AND (tab_212893.col2_15) = (tab_212894.col2_15)
JOIN defaultdb.public.table1@table1_col1_14_col1_4_col1_10_col1_9_col1_8_key AS tab_212898
JOIN defaultdb.public.table2@[0] AS tab_212899 ON (tab_212898.col1_10) = (tab_212899.col2_9) ON
(tab_212894.col2_8) = (tab_212899.col2_8)
CROSS JOIN defaultdb.public.seed@[0] AS tab_212900 ON
(tab_212891._jsonb) = (tab_212897.col1_11) AND (tab_212891._jsonb) = (tab_212900._jsonb),
with_86777 AS cte_ref_24921
WHERE
tab_212900._bool
ORDER BY
tab_212899.col2_7 DESC
LIMIT
Schema:
rsg_test.go:575: To reproduce, use schema:
rsg_test.go:577:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
CREATE TABLE table1 (col1_0 STRING NOT NULL, col1_1 DATE[], col1_2 NAME NULL, col1_3 VARCHAR, col1_4 TIMESTAMP, col1_5 CHAR NOT NULL, col1_6 BYTES NOT NULL, col1_7 INT8 NULL, col1_8 INT4, col1_9 TIME, col1_10 REGNAMESPACE NOT NULL, col1_11 JSONB NULL, PRIMARY KEY (col1_0, col1_6), col1_12 INT8 NULL AS (col1_7 + (-3767257320502003951):::INT8) STORED, col1_13 INT8 NULL AS (col1_7 + col1_8) STORED, col1_14 INT8 NULL AS (col1_7 + col1_8) STORED, UNIQUE (col1_14 ASC, col1_4 ASC, col1_10 DESC, col1_9 DESC, col1_8 ASC) WHERE (((((((((((table1.col1_4 >= '294276-12-31 23:59:59.999999':::TIMESTAMP) AND (table1.col1_5 != e'\U00002603':::STRING)) OR (table1.col1_7 < (-9223372036854775807):::INT8)) AND (table1.col1_2 >= '':::STRING)) OR (table1.col1_13 = 127:::INT8)) OR (table1.col1_3 > e'\x00':::STRING)) AND (table1.col1_0 > e'\x00':::STRING)) OR (table1.col1_8 = (-128):::INT8)) OR (table1.col1_12 = (-2147483648):::INT8)) AND (table1.col1_9 <= '00:00:00':::TIME)) OR (table1.col1_14 <= 127:::INT8)) OR (table1.col1_6 > '\x22':::BYTES), INDEX (col1_2 ASC), UNIQUE (col1_0, col1_2, col1_7), INVERTED INDEX (col1_6 ASC, col1_12, col1_1 ASC), UNIQUE (col1_7 DESC, col1_14 ASC, col1_8 ASC, col1_9 ASC, col1_3, col1_0 DESC, col1_10 ASC, col1_6));
CREATE TABLE table2 (col2_0 INTERVAL NOT NULL, col2_1 TIMESTAMP NOT NULL, col2_2 REGNAMESPACE NOT NULL, col2_3 INT8 NOT NULL, col2_4 REGPROCEDURE NOT NULL, col2_5 GEOGRAPHY NULL, col2_6 UUID, col2_7 TIMESTAMP NOT NULL, col2_8 "char" NOT NULL, col2_9 OID, col2_10 OID NOT NULL, col2_11 OID NULL, col2_12 GEOMETRY NULL, col2_13 DECIMAL NOT NULL, col2_14 INT2, col2_15 STRING NOT NULL AS (lower(CAST(col2_7 AS STRING))) STORED, col2_16 STRING NOT NULL AS (lower(CAST(col2_4 AS STRING))) VIRTUAL, col2_17 STRING NOT NULL AS (lower(CAST(col2_1 AS STRING))) VIRTUAL, INDEX (col2_10 DESC, col2_1 ASC, col2_7 DESC, col2_9, col2_4 DESC, col2_16 DESC, col2_11, col2_17, col2_8 DESC, col2_0, col2_14 ASC) STORING (col2_5, col2_15) WHERE (((((table2.col2_14 > (-1):::INT8) AND (table2.col2_15 = '"':::STRING)) AND (table2.col2_1 > '-4713-11-24 00:00:00':::TIMESTAMP)) AND (table2.col2_8 = e'\'':::STRING)) AND (table2.col2_16 != e'\x00':::STRING)) AND (table2.col2_3 <= (-1):::INT8), UNIQUE (col2_15 DESC) STORING (col2_2, col2_7, col2_10, col2_11) WHERE ((((((((table2.col2_8 < '':::STRING) AND (table2.col2_15 < e'\x00':::STRING)) AND (table2.col2_17 <= e'\x00':::STRING)) AND (table2.col2_13 > 1:::DECIMAL)) OR (table2.col2_1 < '0001-01-01 00:00:00':::TIMESTAMP)) OR (table2.col2_3 <= (-9223372036854775807):::INT8)) AND (table2.col2_14 = (-1):::INT8)) OR (table2.col2_16 != 'X':::STRING)) AND (table2.col2_7 >= '-4713-11-24 00:00:00':::TIMESTAMP));
ALTER TABLE table1 INJECT STATISTICS e'[{"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4279925945319033728, "histo_buckets": [{"distinct_range": 0, "num_eq": 6000000000, "num_range": 0, "upper_bound": ""}, {"distinct_range": 0, "num_eq": 4708147236000853926, "num_range": 4116266681642368175, "upper_bound": "\\n"}, {"distinct_range": 0, "num_eq": 50000, "num_range": 0, "upper_bound": "R\\n?f"}, {"distinct_range": 0, "num_eq": 40000, "num_range": 5517172600948884913, "upper_bound": "R\\u001d\\u0016vGOc\x7f;"}, {"distinct_range": 0, "num_eq": 5128593971889659095, "num_range": 7751002934034781226, "upper_bound": "``.3"}], "histo_col_type": "NAME", "name": "__auto__", "null_count": 1774972475402140967, "row_count": 5344994099051291947}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1773880084740458205, "histo_buckets": [{"distinct_range": 0, "num_eq": 2235128088820326312, "num_range": 0, "upper_bound": "-8210862680943589668"}, {"distinct_range": 15484928.517372726, "num_eq": 4771223327468500071, "num_range": 30000000, "upper_bound": "-8163784501736632936"}, {"distinct_range": 0, "num_eq": 6414171317089391382, "num_range": 3812515567117395023, "upper_bound": "-4931232085733302240"}, {"distinct_range": 0, "num_eq": 967802272657276827, "num_range": 10000, "upper_bound": "-3735721932197041466"}, {"distinct_range": 0, "num_eq": 8856161247048739962, "num_range": 8000000000, "upper_bound": "1"}, {"distinct_range": 63243.10091989875, "num_eq": 60000000, "num_range": 100000, "upper_bound": "2497539886038878570"}, {"distinct_range": 0, "num_eq": 1000000000, "num_range": 4000000, "upper_bound": "3007436334844581796"}, {"distinct_range": 1127623038394756900, "num_eq": 700000000, "num_range": 1127623038394756848, "upper_bound": "5471649753447742683"}, {"distinct_range": 169092014.4231932, "num_eq": 2027845353179582897, "num_range": 600000000, "upper_bound": "8281247454734877177"}], "histo_col_type": "INT8", "name": "__auto__", "null_count": 4050866800712988637, "row_count": 5344994099051291947}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4546438137825659887, "histo_buckets": [{"distinct_range": 0, "num_eq": 7452849270340174681, "num_range": 0, "upper_bound": "\\u0019\\u000b>K"}, {"distinct_range": 1000000, "num_eq": 5000000000, "num_range": 1000000, "upper_bound": "\\u001a(R_g\\n\\u00189"}, {"distinct_range": 0, "num_eq": 600000, "num_range": 0, "upper_bound": "\\u001e3\\"\\u0005\\u0004\x7f"}, {"distinct_range": 700, "num_eq": 100000000000, "num_range": 700, "upper_bound": "!;L"}, {"distinct_range": 0, "num_eq": 60, "num_range": 50000000, "upper_bound": "9^^\\r"}, {"distinct_range": 544460222163028350, "num_eq": 70000000000, "num_range": 544460222163028341, "upper_bound": "C*B\\u0012#p"}, {"distinct_range": 900000000, "num_eq": 7000000000, "num_range": 900000000, "upper_bound": "M%D1\'N6\\u001c/"}, {"distinct_range": 9000000000, "num_eq": 6097986053852890881, "num_range": 9000000000, "upper_bound": "|rOt\\u001f"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 0, "row_count": 5344994099051291947}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1249669347951042585, "histo_col_type": "", "name": "__auto__", "null_count": 3128701231207587293, "row_count": 5344994099051291947}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 984019756588165798, "histo_buckets": [{"distinct_range": 0, "num_eq": 700000, "num_range": 0, "upper_bound": "\\\\xfe9649"}], "histo_col_type": "BYTES", "name": "__auto__", "null_count": 0, "row_count": 5344994099051291947}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1925684821558799736, "histo_col_type": "", "name": "__auto__", "null_count": 919313213371729744, "row_count": 5344994099051291947}, {"columns": ["col1_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3011155189084478759, "histo_col_type": "", "name": "__auto__", "null_count": 3361959442800348434, "row_count": 5344994099051291947}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2811809727364181530, "histo_col_type": "", "name": "__auto__", "null_count": 3278964394788286379, "row_count": 5344994099051291947}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3158448186152546321, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 5344994099051291947}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4763731597048042988, "histo_col_type": "", "name": "__auto__", "null_count": 1978138302047254073, "row_count": 5344994099051291947}, {"columns": ["col1_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 376230190865984344, "histo_buckets": [{"distinct_range": 0, "num_eq": 8000, "num_range": 0, "upper_bound": "-2348527706479626873"}, {"distinct_range": 31608890.410502676, "num_eq": 3000, "num_range": 50000000, "upper_bound": "-1"}], "histo_col_type": "INT8", "name": "__auto__", "null_count": 5209935994696181673, "row_count": 5344994099051291947}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1173938991507622049, "histo_col_type": "", "name": "__auto__", "null_count": 420769196418323566, "row_count": 5344994099051291947}, {"columns": ["col1_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3267311193087981291, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 5344994099051291947}, {"columns": ["col1_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3055515769734083641, "histo_col_type": "", "name": "__auto__", "null_count": 1809360533687189232, "row_count": 5344994099051291947}, {"columns": ["col1_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4723557083662268493, "histo_col_type": "", "name": "__auto__", "null_count": 4088436927936350625, "row_count": 5344994099051291947}]':::JSONB;
ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_17"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 133500658, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 400000000}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 232455677, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 400000000}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 286902819, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 400000000}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 109792994, "histo_col_type": "", "name": "__auto__", "null_count": 209069000, "row_count": 400000000}, {"columns": ["col2_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 166135801, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 400000000}, {"columns": ["col2_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 271439843, "histo_col_type": "", "name": "__auto__", "null_count": 395325256, "row_count": 400000000}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 51615693, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 400000000}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 53323104, "histo_col_type": "", "name": "__auto__", "null_count": 237881482, "row_count": 400000000}, {"columns": ["col2_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 118908419, "histo_col_type": "", "name": "__auto__", "null_count": 186536868, "row_count": 400000000}, {"columns": ["col2_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5348447, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 400000000}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 316002771, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 400000000}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 99065615, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 400000000}, {"columns": ["col2_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 371704970, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 400000000}, {"columns": ["col2_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 174126218, "histo_col_type": "", "name": "__auto__", "null_count": 231769744, "row_count": 400000000}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 300519364, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 400000000}, {"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 194664535, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 400000000}, {"columns": ["col2_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 90369797, "histo_col_type": "", "name": "__auto__", "null_count": 271000310, "row_count": 400000000}, {"columns": ["col2_16"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 103422259, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 400000000}]':::JSONB;
CREATE TYPE rand_typ_0 AS ENUM ('ukc', 'ibo', 'zyqsl', 'g', 'o', 'q');
;
rsg_test.go:577:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
SELECT
g::INT2 AS _int2,
g::INT4 AS _int4,
g::INT8 AS _int8,
g::FLOAT4 AS _float4,
g::FLOAT8 AS _float8,
'2001-01-01'::DATE + g AS _date,
'2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
'2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
g * '1 day'::INTERVAL AS _interval,
g % 2 = 1 AS _bool,
g::DECIMAL AS _decimal,
g::STRING AS _string,
g::STRING::BYTES AS _bytes,
substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
'0.0.0.0'::INET + g AS _inet,
g::STRING::JSONB AS _jsonb,
enum_range('hello'::greeting)[g] as _enum
FROM
generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);
;
rsg_test.go:579:
rsg_test.go:580: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith288446533
--- FAIL: TestRandomSyntaxSQLSmith (300.51s)
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-queries @rafiss
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ eecead5c3aa93b5718a57c47970d67ee3035e794:
Random syntax error:
rsg_test.go:758: Crash detected: server panic: pq: internal error: ordering column group (100,114) contains non-equivalent columns (op sort)
Query:
SELECT
true AS col_31609,
(tab_13729.col2_2::TIMESTAMP || tab_13727.col1_4::STRING)::STRING AS col_31610,
tab_13726._date AS col_31611,
tab_13725.col1_4 AS col_31612,
3463649133:::OID AS col_31613,
tab_13726._int4 AS col_31614,
('1988-06-19':::DATE::DATE + '22:40:36.97924+02:56:00':::TIMETZ::TIMETZ)::TIMESTAMPTZ AS col_31615,
tab_13726._bytes AS col_31616
FROM
defaultdb.public.table1@[0] AS tab_13725,
defaultdb.public.seed@seed__int8__float8__date_idx AS tab_13726,
defaultdb.public.table1@[0] AS tab_13727,
defaultdb.public.table2@table2_col2_0_col2_7_col2_3_col2_5_col2_9_col2_2_col2_6_col2_1_col2_10_col2_4_col2_8_col2_11_idx
AS tab_13729
WHERE
(('ad':::rand_typ_2::rand_typ_2 NOT IN (SELECT 'ad':::rand_typ_2::rand_typ_2 AS col_31607 FROM defaultdb.public.seed@seed__int8__float8__date_idx AS tab_13730, defaultdb.public.table1@[0] AS tab_13732, defaultdb.public.seed@seed__int8__float8__date_idx AS tab_13733 ORDER BY tab_13733._string ASC, tab_13730._timestamptz DESC, tab_13733._bool, tab_13733.tableoid ASC)) AND ('124.91.122.88/27':::INET::INET IN (SELECT tab_13726._inet::INET AS col_31608 FROM defaultdb.public.table2 AS tab_13734 JOIN defaultdb.public.table2 AS tab_13735 ON (tab_13734.col2_0) = (tab_13735.col2_0) LIMIT 54:::INT8)))
ORDER BY
tab_13727.col1_2 DESC, tab_13725.col1_2 DESC, tab_13729.col2_3 ASC
LIMIT
67:::INT8;
Schema:
rsg_test.go:575: To reproduce, use schema:
rsg_test.go:577:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
CREATE TABLE table1 (col1_0 DATE NOT NULL, col1_1 REGPROCEDURE, col1_2 NAME NOT NULL, col1_3 CHAR NOT NULL, PRIMARY KEY (col1_3 ASC, col1_0 DESC), col1_4 STRING AS (lower(CAST(col1_1 AS STRING))) VIRTUAL, INDEX (col1_1 DESC) STORING (col1_2) WHERE (((table1.col1_4 > 'X':::STRING) AND (table1.col1_0 = '4714-11-24 BC':::DATE)) AND (table1.col1_3 < e'\U00002603':::STRING)) OR (table1.col1_2 <= 'X':::STRING), INDEX (col1_4 ASC, col1_0 DESC, col1_3 ASC, col1_1 ASC, col1_2) WHERE ((table1.col1_2 <= e'\'':::STRING) OR (table1.col1_3 != e'\U00002603':::STRING)) OR (table1.col1_0 >= '-infinity':::DATE), INDEX (col1_2, col1_1, col1_3, col1_4 ASC, col1_0 DESC), INDEX (col1_2 ASC, col1_1 DESC, col1_3 DESC) WHERE ((table1.col1_4 <= '"':::STRING) AND (table1.col1_2 >= e'\x00':::STRING)) OR (table1.col1_0 > '5874897-12-31':::DATE), FAMILY (col1_2, col1_3, col1_0), FAMILY (col1_1));
CREATE TABLE table2 (col2_0 BYTES, col2_1 INTERVAL, col2_2 TIMESTAMP, col2_3 INT8 NOT NULL, col2_4 BYTES NULL, col2_5 BYTES NOT NULL, col2_6 OID, col2_7 TIMESTAMP NOT NULL, col2_8 INT8 NOT NULL, PRIMARY KEY (col2_8 ASC, col2_5 DESC, col2_3 ASC), col2_9 STRING AS (CASE WHEN col2_0 IS NULL THEN e'\rU\nz':::STRING ELSE e'R``\x1d':::STRING END) VIRTUAL, col2_10 STRING AS (CASE WHEN col2_0 IS NULL THEN 'H;xO':::STRING ELSE e'\x17VY\x02 F3':::STRING END) VIRTUAL, col2_11 INT8 NOT NULL AS (col2_8 + 4161811334214253222:::INT8) STORED, INDEX (col2_7 DESC, col2_3, col2_9 ASC, col2_0 DESC) STORING (col2_11) WHERE (((table2.col2_9 = e'\U00002603':::STRING) AND (table2.col2_10 > '"':::STRING)) AND (table2.col2_7 < '-2000-01-01 00:00:00':::TIMESTAMP)) AND (table2.col2_5 != '\x58':::BYTES), UNIQUE (col2_9, col2_2, col2_8 ASC, col2_11 DESC, col2_1 DESC, col2_6, col2_5, col2_10 ASC, col2_4 DESC, col2_3), INDEX (col2_0 ASC, col2_7, col2_3 DESC, col2_5 ASC, col2_9 ASC, col2_2 DESC, col2_6 ASC, col2_1 ASC, col2_10, col2_4, col2_8 DESC, col2_11 DESC), UNIQUE (col2_9 ASC, col2_6 ASC, col2_5 ASC, col2_3 DESC, col2_4 DESC, col2_7 ASC, col2_2, col2_1) WHERE (table2.col2_3 != (-2147483648):::INT8) OR (table2.col2_0 > '\xe29883':::BYTES), UNIQUE (col2_7, col2_3, col2_4 ASC, col2_1 DESC, col2_6, col2_9, col2_10, col2_11 ASC, col2_2 DESC) WHERE table2.col2_10 >= '':::STRING, FAMILY (col2_4), FAMILY (col2_6), FAMILY (col2_7, col2_2, col2_0, col2_8), FAMILY (col2_11, col2_5, col2_3, col2_1));
ALTER TABLE table1 INJECT STATISTICS e'[{"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 126846306, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000000000}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 549771365, "histo_buckets": [{"distinct_range": 0, "num_eq": 5511031642015678402, "num_range": 0, "upper_bound": "0"}, {"distinct_range": 136.3166913972, "num_eq": 1379292379465087068, "num_range": 900, "upper_bound": "3334487028"}], "histo_col_type": "REGPROCEDURE", "name": "__auto__", "null_count": 617680217, "row_count": 1000000000}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 350792332, "histo_buckets": [{"distinct_range": 0, "num_eq": 60000000000, "num_range": 0, "upper_bound": "\\u001c+u\\u001a)"}, {"distinct_range": 0, "num_eq": 500, "num_range": 0, "upper_bound": ")\\\\\\u001d\x7f%\\u0005_"}, {"distinct_range": 5390025276746211000, "num_eq": 10000, "num_range": 5390025276746211166, "upper_bound": "L"}], "histo_col_type": "NAME", "name": "__auto__", "null_count": 0, "row_count": 1000000000}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 811166769, "histo_buckets": [{"distinct_range": 0, "num_eq": 900000, "num_range": 0, "upper_bound": "#"}, {"distinct_range": 8717890599548434000, "num_eq": 4145264313419409855, "num_range": 8717890599548434836, "upper_bound": "m"}], "histo_col_type": "CHAR", "name": "__auto__", "null_count": 0, "row_count": 1000000000}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 605193699, "histo_buckets": [{"distinct_range": 0, "num_eq": 0, "num_range": 0, "upper_bound": ""}, {"distinct_range": 600000, "num_eq": 80000000, "num_range": 600000, "upper_bound": "\\u0017c9"}, {"distinct_range": 0, "num_eq": 1000000000, "num_range": 50000, "upper_bound": "H7"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 995477914, "row_count": 1000000000}]':::JSONB;
ALTER TABLE table2 INJECT STATISTICS e'[{"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6363642017514130166, "histo_col_type": "", "name": "__auto__", "null_count": 1971470847387319290, "row_count": 7353430924537130484}, {"columns": ["col2_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6179216752076480744, "histo_col_type": "", "name": "__auto__", "null_count": 1788212678433589109, "row_count": 7353430924537130484}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2046606043549320064, "histo_col_type": "", "name": "__auto__", "null_count": 6893085429340863218, "row_count": 7353430924537130484}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3273728590653210041, "histo_buckets": [{"distinct_range": 0, "num_eq": 896886530966934721, "num_range": 0, "upper_bound": "2026-08-25 21:23:08.000355"}], "histo_col_type": "TIMESTAMP", "name": "__auto__", "null_count": 0, "row_count": 7353430924537130484}, {"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 993462553451245437, "histo_buckets": [{"distinct_range": 0, "num_eq": 5000000, "num_range": 0, "upper_bound": "-6636846120810931147"}, {"distinct_range": 1845266105758287600, "num_eq": 6276984730375152452, "num_range": 4627413869947433592, "upper_bound": "-672445716671704918"}, {"distinct_range": 3.884353599907451, "num_eq": 6415903603371856968, "num_range": 30, "upper_bound": "5778106626777825154"}, {"distinct_range": 208133.3474694811, "num_eq": 9160443865680442376, "num_range": 800000, "upper_bound": "7355351900320550566"}, {"distinct_range": 7179.678686657384, "num_eq": 2000000000, "num_range": 90000, "upper_bound": "7968024394963513390"}, {"distinct_range": 1988530305724316700, "num_eq": 30000000000, "num_range": 2376588602139033140, "upper_bound": "8567000219795191309"}], "histo_col_type": "INT8", "name": "__auto__", "null_count": 0, "row_count": 7353430924537130484}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6355395726934091792, "histo_buckets": [{"distinct_range": 0, "num_eq": 0, "num_range": 0, "upper_bound": "\\\\x11"}, {"distinct_range": 7231343824830525000, "num_eq": 30000000000, "num_range": 7231343824830525642, "upper_bound": "\\\\x4649"}, {"distinct_range": 0, "num_eq": 5027648835965739750, "num_range": 80000, "upper_bound": "\\\\x5a5f9440"}, {"distinct_range": 0, "num_eq": 2883327663101376552, "num_range": 2608134565675245084, "upper_bound": "\\\\x9f6b6b07a0"}, {"distinct_range": 0, "num_eq": 7236599564385539105, "num_range": 4915163142632481116, "upper_bound": "\\\\xe29883"}], "histo_col_type": "BYTES", "name": "__auto__", "null_count": 5071387438958061066, "row_count": 7353430924537130484}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5662458162186830056, "histo_col_type": "", "name": "__auto__", "null_count": 3354574034029208066, "row_count": 7353430924537130484}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1542299333541061922, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7353430924537130484}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5814183970763610438, "histo_col_type": "", "name": "__auto__", "null_count": 2666568347309439134, "row_count": 7353430924537130484}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2944187232523046462, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7353430924537130484}, {"columns": ["col2_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1472653749841842892, "histo_buckets": [{"distinct_range": 0, "num_eq": 100000, "num_range": 0, "upper_bound": ""}, {"distinct_range": 0, "num_eq": 8048162010314474171, "num_range": 0, "upper_bound": "\\u0000"}, {"distinct_range": 0, "num_eq": 6000000000, "num_range": 400000, "upper_bound": "/#\\u0002\\\\U"}, {"distinct_range": 0, "num_eq": 0, "num_range": 700000, "upper_bound": "0X\\u0003\\u0016au\\u0016"}, {"distinct_range": 0.19812650964132583, "num_eq": 5686326109735287428, "num_range": 70, "upper_bound": "M\\u000bG<\\u0013n"}, {"distinct_range": 26830156895345830, "num_eq": 2394784738133568999, "num_range": 5772011348347738731, "upper_bound": "s/"}, {"distinct_range": 80000000, "num_eq": 0, "num_range": 80000000, "upper_bound": "~\\u0004"}, {"distinct_range": 0, "num_eq": 400, "num_range": 8561672423828244471, "upper_bound": "~``\\u0006"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 4078966551752018256, "row_count": 7353430924537130484}, {"columns": ["col2_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1358012341762528012, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7353430924537130484}]':::JSONB;
CREATE TYPE rand_typ_0 AS ENUM ('gwjdii', 'xyyd', 'hqnn', 'hyv', 'vi');
CREATE TYPE rand_typ_1 AS ENUM ('bmn', 'xk', 'ggkh');
CREATE TYPE rand_typ_2 AS ENUM ('ad');
CREATE TYPE rand_typ_3 AS ENUM ('ir', 'l', 'm', 'igiyku');
;
rsg_test.go:577:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
SELECT
g::INT2 AS _int2,
g::INT4 AS _int4,
g::INT8 AS _int8,
g::FLOAT4 AS _float4,
g::FLOAT8 AS _float8,
'2001-01-01'::DATE + g AS _date,
'2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
'2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
g * '1 day'::INTERVAL AS _interval,
g % 2 = 1 AS _bool,
g::DECIMAL AS _decimal,
g::STRING AS _string,
g::STRING::BYTES AS _bytes,
substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
'0.0.0.0'::INET + g AS _inet,
g::STRING::JSONB AS _jsonb,
enum_range('hello'::greeting)[g] as _enum
FROM
generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);
;
rsg_test.go:579:
rsg_test.go:580: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith969278355
--- FAIL: TestRandomSyntaxSQLSmith (300.60s)
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-queries rafiss
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ 3eeb35f3ea834228cd724f2a0e01c27b75bb6dd5:
Random syntax error:
rsg_test.go:758: Crash detected: server panic: pq: internal error: ordering column group (101,107) contains non-equivalent columns (op sort)
Query:
SELECT
tab_438381.col2_7 AS col_1050708,
NULL AS col_1050709,
2282866370:::OID AS col_1050710,
tab_438386.col2_5 AS col_1050711,
tab_438382.col2_7 AS col_1050712,
'[[0.7502362160048772, [[], true, {}, [], {}], [null, {}]], true]':::JSONB AS col_1050713,
(-4.353347688863631997E+19):::DECIMAL AS col_1050714
FROM
defaultdb.public.table2@[0] AS tab_438381
JOIN defaultdb.public.table2@[0] AS tab_438382
JOIN defaultdb.public.seed@[0] AS tab_438383 ON
(tab_438382.col2_4) = (tab_438383.crdb_internal_mvcc_timestamp)
AND (tab_438382.col2_6) = (tab_438383.tableoid)
AND (tab_438382.crdb_internal_mvcc_timestamp) = (tab_438383._decimal)
AND (tab_438382.col1_6) = (tab_438383.tableoid)
JOIN defaultdb.public.table2@[0] AS tab_438384 ON
(tab_438382.col2_4) = (tab_438384.crdb_internal_mvcc_timestamp)
AND (tab_438382.col2_8) = (tab_438384.tableoid)
AND (tab_438382.col2_8) = (tab_438384.col2_8) ON (tab_438381.col2_7) = (tab_438382.tableoid),
defaultdb.public.table1@[0] AS tab_438385,
defaultdb.public.table2@[0] AS tab_438386
WHERE
tab_438383._enum::greeting
IN (
SELECT
tab_438383._enum::greeting AS col_1050707
FROM
defaultdb.public.seed@[0] AS tab_438387
JOIN defaultdb.public.table1@[0] AS tab_438388 ON
(tab_438387.tableoid) = (tab_438388.col1_4)
AND (tab_438387.crdb_internal_mvcc_timestamp) = (tab_438388.crdb_internal_mvcc_timestamp)
AND (tab_438387._string) = (tab_438388.col1_9)
ORDER BY
tab_438387._timestamp DESC, tab_438387.tableoid ASC
LIMIT
58:::INT8
)
ORDER BY
tab_438386.col1_2, tab_438381.col1_6 DESC
LIMIT
51:::INT8;
Schema:
rsg_test.go:575: To reproduce, use schema:
rsg_test.go:577:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
CREATE TABLE table1 (col1_0 FLOAT4 NULL, col1_1 TIMESTAMP, col1_2 INET NOT NULL, col1_3 TIMESTAMP, col1_4 REGPROC NOT NULL, col1_5 OID NULL, col1_6 REGTYPE NOT NULL, col1_7 REGPROC NOT NULL, col1_8 GEOMETRY NULL, PRIMARY KEY (col1_6 ASC, col1_2 ASC), col1_9 STRING NOT NULL AS (lower(CAST(col1_7 AS STRING))) VIRTUAL, col1_10 STRING NOT NULL AS (lower(CAST(col1_4 AS STRING))) VIRTUAL, col1_11 STRING NULL AS (lower(CAST(col1_5 AS STRING))) STORED, col1_12 STRING AS (lower(CAST(col1_3 AS STRING))) VIRTUAL, col1_13 STRING NOT NULL AS (lower(CAST(col1_2 AS STRING))) STORED, INDEX (col1_3 ASC, col1_1, col1_7 ASC, col1_0 DESC, col1_6, col1_10 DESC, col1_11 ASC, col1_5 DESC), INDEX (col1_4 ASC, col1_3 DESC, col1_7 DESC, col1_1 ASC, col1_6 ASC, col1_13, col1_11 DESC, col1_12, col1_9, col1_5 DESC) STORING (col1_0, col1_8) WHERE (((table1.col1_3 != '3000-01-01 00:00:00':::TIMESTAMP) OR (table1.col1_13 >= e'\U00002603':::STRING)) OR (table1.col1_11 != e'\'':::STRING)) AND (table1.col1_9 >= e'\'':::STRING), FAMILY (col1_3, col1_0, col1_1), FAMILY (col1_13, col1_8, col1_11, col1_5), FAMILY (col1_2), FAMILY (col1_4, col1_6), FAMILY (col1_7));
CREATE TABLE table2 (col1_6 REGTYPE NOT NULL, col1_2 INET NOT NULL, col2_2 DECIMAL NULL, col2_3 TIME NULL, col2_4 DECIMAL NULL, col2_5 BOX2D NOT NULL, col2_6 REGPROCEDURE, col2_7 REGCLASS NULL, col2_8 OID NOT NULL, PRIMARY KEY (col1_6 ASC, col1_2 ASC), UNIQUE (col2_3, col2_5 ASC) STORING (col2_2), UNIQUE (col2_4, col2_8 ASC, col2_6 DESC), UNIQUE (col2_6, col2_5 ASC, col2_7 ASC), INDEX (col1_2 ASC, col2_3, col2_7 DESC, col2_8, col2_2, col2_4 ASC, col2_5 DESC), INDEX (col2_4 ASC), UNIQUE (col1_2 DESC, col2_8 ASC, col2_2 ASC) STORING (col2_3, col2_5, col2_6, col2_7) WHERE table2.col2_4 = '-Infinity':::DECIMAL, FAMILY (col2_2, col1_2, col2_4), FAMILY (col1_6), FAMILY (col2_8), FAMILY (col2_7), FAMILY (col2_6, col2_5, col2_3), UNIQUE (col1_2)) INTERLEAVE IN PARENT table1 (col1_6, col1_2);
ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 618488545185061616, "histo_col_type": "", "name": "__auto__", "null_count": 505009458449189560, "row_count": 1507826681494491907}, {"columns": ["col1_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1458605774755427937, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1507826681494491907}, {"columns": ["col1_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1020091811031288509, "histo_col_type": "", "name": "__auto__", "null_count": 426443778245067169, "row_count": 1507826681494491907}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 744473953109844649, "histo_col_type": "", "name": "__auto__", "null_count": 1356469820097377966, "row_count": 1507826681494491907}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1260798418620296344, "histo_col_type": "", "name": "__auto__", "null_count": 198338751531060668, "row_count": 1507826681494491907}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 391305558988663261, "histo_col_type": "", "name": "__auto__", "null_count": 791425630294531435, "row_count": 1507826681494491907}, {"columns": ["col1_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 421740456502981828, "histo_col_type": "", "name": "__auto__", "null_count": 110366692347330976, "row_count": 1507826681494491907}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1127998463455317707, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1507826681494491907}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 541611928790990076, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1507826681494491907}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1391004467172070199, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1507826681494491907}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 684638641014353410, "histo_buckets": [{"distinct_range": 0, "num_eq": 2615329302055912115, "num_range": 0, "upper_bound": "1986-04-01 11:08:36.000748"}, {"distinct_range": 0, "num_eq": 20000000, "num_range": 6420434724441389840, "upper_bound": "1989-10-29 14:39:28.000808"}, {"distinct_range": 1272839627049639000, "num_eq": 0, "num_range": 2710853246757787378, "upper_bound": "2028-05-19 16:04:05.000753"}, {"distinct_range": 0, "num_eq": 1000, "num_range": 0, "upper_bound": "294276-12-31 23:59:59.999999"}], "histo_col_type": "TIMESTAMP", "name": "__auto__", "null_count": 997798572715873246, "row_count": 1507826681494491907}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 811587044962585378, "histo_buckets": [{"distinct_range": 0, "num_eq": 200000000, "num_range": 0, "upper_bound": "2087684216"}], "histo_col_type": "REGPROC", "name": "__auto__", "null_count": 0, "row_count": 1507826681494491907}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 682510650832606028, "histo_buckets": [{"distinct_range": 0, "num_eq": 30000000, "num_range": 0, "upper_bound": "0"}, {"distinct_range": 0, "num_eq": 5000000, "num_range": 0, "upper_bound": "363340721"}, {"distinct_range": 0, "num_eq": 900, "num_range": 8328723532021111684, "upper_bound": "1422870416"}, {"distinct_range": 0, "num_eq": 3974392973123287023, "num_range": 3000, "upper_bound": "1903152467"}, {"distinct_range": 9080266924177579000, "num_eq": 0, "num_range": 9080266924177579165, "upper_bound": "2203919109"}], "histo_col_type": "REGTYPE", "name": "__auto__", "null_count": 0, "row_count": 1507826681494491907}, {"columns": ["col1_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 195994993287533824, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1507826681494491907}]':::JSONB;
ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 521381729, "histo_buckets": [{"distinct_range": 0, "num_eq": 4000, "num_range": 0, "upper_bound": "0"}, {"distinct_range": 5000000, "num_eq": 500000000, "num_range": 5000000, "upper_bound": "131941402"}, {"distinct_range": 0, "num_eq": 7562863871218332993, "num_range": 0, "upper_bound": "1055090559"}, {"distinct_range": 6000000, "num_eq": 2747224997337191078, "num_range": 6000000, "upper_bound": "1158958791"}, {"distinct_range": 0, "num_eq": 1792729346495318338, "num_range": 400, "upper_bound": "1421788123"}, {"distinct_range": 1702728639037623800, "num_eq": 1351669398428709446, "num_range": 1702728639037623782, "upper_bound": "3333293984"}, {"distinct_range": 1059211461881660800, "num_eq": 400000, "num_range": 1059211461881660820, "upper_bound": "3409728560"}], "histo_col_type": "REGTYPE", "name": "__auto__", "null_count": 0, "row_count": 1000000000}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 860286677, "histo_col_type": "", "name": "__auto__", "null_count": 60588759, "row_count": 1000000000}, {"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 63959384, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000000000}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 710132250, "histo_buckets": [{"distinct_range": 0, "num_eq": 8976746406755845214, "num_range": 0, "upper_bound": "97.73.213.226/0"}, {"distinct_range": 700000, "num_eq": 8592524566923582242, "num_range": 700000, "upper_bound": "191.98.81.86/5"}, {"distinct_range": 970912412136495500, "num_eq": 805869121902411176, "num_range": 3608504805503972407, "upper_bound": "26.247.12.177/24"}, {"distinct_range": 0, "num_eq": 8837434087807106268, "num_range": 6858362172969311830, "upper_bound": "252.218.104.160/25"}, {"distinct_range": 0, "num_eq": 20, "num_range": 6349046627748459453, "upper_bound": "181.223.144.144/27"}, {"distinct_range": 23225.603878376907, "num_eq": 5433920766692156792, "num_range": 40000, "upper_bound": "30.123.159.12/31"}, {"distinct_range": 335154.94391570886, "num_eq": 70000000000, "num_range": 1000000, "upper_bound": "c3a6:da30:ea3a:6715:221a:42f8:b0cf:ae6c/13"}, {"distinct_range": 40174.36611293461, "num_eq": 5721313773737294846, "num_range": 100000, "upper_bound": "6196:4ccc:77c2:5652:f6ee:547f:dfd9:54a2/30"}], "histo_col_type": "INET", "name": "__auto__", "null_count": 0, "row_count": 1000000000}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 454436139, "histo_col_type": "", "name": "__auto__", "null_count": 666686800, "row_count": 1000000000}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 81959432, "histo_buckets": [{"distinct_range": 0, "num_eq": 6368144330104584568, "num_range": 0, "upper_bound": "01:01:37.11939"}, {"distinct_range": 100000000, "num_eq": 0, "num_range": 100000000, "upper_bound": "05:33:04.251515"}, {"distinct_range": 0, "num_eq": 4000000, "num_range": 3000, "upper_bound": "06:05:11.517419"}, {"distinct_range": 900000000, "num_eq": 100, "num_range": 900000000, "upper_bound": "15:19:04.025825"}, {"distinct_range": 900000, "num_eq": 0, "num_range": 900000, "upper_bound": "15:30:59.717743"}], "histo_col_type": "TIME", "name": "__auto__", "null_count": 735228576, "row_count": 1000000000}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 399364963, "histo_buckets": [{"distinct_range": 0, "num_eq": 7264368386425280959, "num_range": 0, "upper_bound": "-1.705061046979097772E+33"}, {"distinct_range": 6656284471594258000, "num_eq": 7000, "num_range": 8278314298162621931, "upper_bound": "-2.714598247134014338E+30"}, {"distinct_range": 2000000000, "num_eq": 40000, "num_range": 2000000000, "upper_bound": "-290255.4240460510633"}, {"distinct_range": 0, "num_eq": 1572435570565539886, "num_range": 7435527321108338405, "upper_bound": "-0.4462779294938337242"}], "histo_col_type": "DECIMAL", "name": "__auto__", "null_count": 494706769, "row_count": 1000000000}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 652670089, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000000000}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 170215322, "histo_col_type": "", "name": "__auto__", "null_count": 990184298, "row_count": 1000000000}]':::JSONB;
ALTER TABLE table1 ADD FOREIGN KEY (col1_2) REFERENCES table2 (col1_2);
CREATE TYPE rand_typ_0 AS ENUM ('afcyq', 'yn');
;
rsg_test.go:577:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
SELECT
g::INT2 AS _int2,
g::INT4 AS _int4,
g::INT8 AS _int8,
g::FLOAT4 AS _float4,
g::FLOAT8 AS _float8,
'2001-01-01'::DATE + g AS _date,
'2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
'2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
g * '1 day'::INTERVAL AS _interval,
g % 2 = 1 AS _bool,
g::DECIMAL AS _decimal,
g::STRING AS _string,
g::STRING::BYTES AS _bytes,
substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
'0.0.0.0'::INET + g AS _inet,
g::STRING::JSONB AS _jsonb,
enum_range('hello'::greeting)[g] as _enum
FROM
generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);
;
rsg_test.go:579:
rsg_test.go:580: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith909270895
--- FAIL: TestRandomSyntaxSQLSmith (300.68s)
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-experience rafiss
The newest error is internal error: ordering column group (101,107) contains non-equivalent columns (op sort)
, which https://github.com/cockroachdb/cockroach/pull/65547 was meant to address. But it seems like the issue re-occurred even though that PR has been merged.
The newest error is
internal error: ordering column group (101,107) contains non-equivalent columns (op sort)
, which #65547 was meant to address. But it seems like the issue re-occurred even though that PR has been merged.
3eeb35f3ea834228cd724f2a0e01c27b75bb6dd5 doesn't contain #65547
woops i misread the PR-closed time!
LIMIT 1
, so this might be different. I'll see if it's still reproducible.It looks like #65547 did fix the last failure. So the only remaining issues above are the timeouts.
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ 4e3437fb275f1eb7645ca04d942c82a596c3826e:
Random syntax error:
rsg_test.go:763: Crash detected: server panic: driver: bad connection
Query:
SELECT
tab_462938.col2_8 AS col_1080771,
tab_462937.col5_6 AS col_1080772,
1808921928:::OID AS col_1080773,
'9ir3':::STRING AS col_1080774,
tab_462938.col2_7 AS col_1080775,
NULL AS col_1080776,
'e6d5be6a-8f06-452b-937c-5cf8b9a0aa96':::UUID AS col_1080777,
tab_462938.col2_2 AS col_1080778,
tab_462938.col2_10 AS col_1080779,
NULL AS col_1080780,
cume_dist() OVER (PARTITION BY tab_462938.col2_3 ORDER BY tab_462937.col5_8, tab_462938.col2_6 RANGE UNBOUNDED PRECEDING)::FLOAT8
AS col_1080781,
1680816754:::OID AS col_1080782,
'BOX(-0.8989447299746001 -1.2938216624723617,1.3215286313988317 0.06845330083354007)':::BOX2D AS col_1080783,
tab_462937.col5_5 AS col_1080784,
NULL AS col_1080785
FROM
defaultdb.public.table5@[0] AS tab_462937, defaultdb.public.table2@[0] AS tab_462938
ORDER BY
tab_462938.tableoid DESC, tab_462938.col2_9, tab_462938.col2_3;
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-experience rafiss
The last one is tracked in #65763.
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ 55877f386a04ed5b6c7722259ff0b3ac3ad545f6:
Random syntax error:
rsg_test.go:763: Crash detected: server panic: pq: internal error: subquery eval: invalid index 1 for "EXISTS (SELECT tab_258119.col3_0 AS col_621183 FROM defaultdb.public.table1 AS tab_258120 JOIN defaultdb.public.table1 AS tab_258121 ON ((((tab_258120.col1_5) = (tab_258121.col1_5)) AND ((tab_258120.col1_15) = (tab_258121.col1_15))) AND ((tab_258120.col1_10) = (tab_258121.col1_10))) AND ((tab_258120.col1_8) = (tab_258121.col1_8)) ORDER BY tab_258121.col1_7 DESC, tab_258121.col1_7, tab_258120.col1_7 ASC, tab_258120.col1_7 ASC, tab_258121.col1_7 ASC, tab_258121.col1_7 ASC LIMIT 74:::INT8)"
Query:
SELECT
0.7965162128896974:::FLOAT8 AS col_621176,
tab_258114._decimal AS col_621177,
'dd7fbce5-6fcb-4296-a1d4-4743ff4f4721':::UUID AS col_621178,
(
WITH
with_105848 (col_621179)
AS (
SELECT
*
FROM
(
VALUES
(ARRAY[158545218:::OID,3373787515:::OID]),
(ARRAY[681698300:::OID,931114017:::OID]),
(ARRAY[]:::OID[]),
(NULL)
)
AS tab_258115 (col_621179)
),
with_105850 (col_621182)
AS (
SELECT
*
FROM
(
VALUES
(1048507102:::OID),
(
(
WITH
with_105849 (col_621180)
AS (
SELECT
*
FROM
(
VALUES
(1807279152012001135:::INT8),
(733474479865993289:::INT8),
(1943042488855309140:::INT8),
(NULL),
((-2489297541380691213):::INT8),
((-3194521707423855466):::INT8)
)
AS tab_258116 (col_621180)
)
SELECT
0:::OID AS col_621181
FROM
with_105849 AS cte_ref_30772
GROUP BY
cte_ref_30772.col_621180
ORDER BY
cte_ref_30772.col_621180, cte_ref_30772.col_621180 ASC
LIMIT
1:::INT8
)
),
(0:::OID),
(2947031718:::OID)
)
AS tab_258117 (col_621182)
)
SELECT
tab_258114._interval AS col_621185
FROM
defaultdb.public.seed@seed__int8__float8__date_idx AS tab_258118
WHERE
(
SELECT
EXISTS(
SELECT
tab_258119.col3_0 AS col_621183
FROM
defaultdb.public.table1 AS tab_258120
JOIN defaultdb.public.table1 AS tab_258121 ON
(tab_258120.col1_5) = (tab_258121.col1_5)
AND (tab_258120.col1_15) = (tab_258121.col1_15)
AND (tab_258120.col1_10) = (tab_258121.col1_10)
AND (tab_258120.col1_8) = (tab_258121.col1_8)
ORDER BY
tab_258121.col1_7 DESC,
tab_258121.col1_7,
tab_258120.col1_7 ASC,
tab_258120.col1_7 ASC,
tab_258121.col1_7 ASC,
tab_258121.col1_7 ASC
LIMIT
74:::INT8
)
AS col_621184
FROM
defaultdb.public.table3@[0] AS tab_258119
LIMIT
1:::INT8
)
ORDER BY
tab_258118._decimal ASC
LIMIT
Schema:
rsg_test.go:580: To reproduce, use schema:
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
CREATE TABLE table1 (col1_0 CHAR, col1_1 "char", col1_2 TIMETZ, col1_3 FLOAT4[] NOT NULL, col1_4 "char", col1_5 REGCLASS NULL, col1_6 INT2 NULL, col1_7 FLOAT8 NULL, col1_8 BOOL NULL, col1_9 CHAR, col1_10 BOX2D, col1_11 REGCLASS, col1_12 STRING NULL AS (lower(CAST(col1_8 AS STRING))) VIRTUAL, col1_13 STRING AS (lower(CAST(col1_11 AS STRING))) STORED, col1_14 STRING NULL AS (lower(CAST(col1_8 AS STRING))) STORED, col1_15 INT2 NULL AS (col1_6 + 15494:::INT8) VIRTUAL, col1_16 FLOAT8 NULL AS (col1_7 + 0.09722719800821222:::FLOAT8) STORED, INDEX (col1_5 ASC, col1_7, col1_4 DESC, col1_8 DESC, col1_10 DESC, col1_15 ASC) STORING (col1_3, col1_13, col1_14, col1_16) WHERE table1.col1_2 > '00:00:00+15:59:00':::TIMETZ, UNIQUE (col1_11 ASC, col1_2, col1_7, col1_6 DESC) STORING (col1_3, col1_4, col1_5, col1_9) WHERE ((((((((((((table1.col1_2 <= '24:00:00-15:59:00':::TIMETZ) AND table1.col1_8) OR (table1.col1_4 = e'\'':::STRING)) OR (table1.col1_1 = e'\U00002603':::STRING)) AND (table1.col1_14 < e'\x00':::STRING)) AND (table1.col1_15 != 32767:::INT8)) OR (table1.col1_13 != e'\'':::STRING)) AND (table1.col1_16 > 1.401298464324817e-45:::FLOAT8)) OR (table1.col1_0 < e'\x00':::STRING)) AND (table1.col1_6 = 0:::INT8)) OR (table1.col1_9 != '':::STRING)) OR (table1.col1_7 < 1.0:::FLOAT8)) AND (table1.col1_12 != 'X':::STRING), INVERTED INDEX (col1_7 DESC, col1_8, col1_11 ASC, col1_12 DESC, col1_1 ASC, col1_2 ASC, col1_9 DESC, col1_15, col1_3) WHERE ((((((((((((table1.col1_0 > e'\'':::STRING) OR (table1.col1_14 < e'\'':::STRING)) AND (table1.col1_9 > '':::STRING)) AND (table1.col1_4 < '"':::STRING)) AND (table1.col1_13 >= '':::STRING)) AND (table1.col1_15 > (-128):::INT8)) OR (table1.col1_16 < '-Inf':::FLOAT8)) AND (table1.col1_7 < '-Inf':::FLOAT8)) OR (table1.col1_2 = '24:00:00-15:59:00':::TIMETZ)) AND (NOT table1.col1_8)) AND (table1.col1_6 > 0:::INT8)) OR (table1.col1_12 >= '':::STRING)) AND (table1.col1_1 != e'\U00002603':::STRING), INDEX (col1_13 DESC, col1_12 ASC, col1_6 DESC, col1_16 ASC, col1_15 ASC, col1_0 ASC, col1_4, col1_14, col1_9 DESC) STORING (col1_7, col1_8, col1_10, col1_11));
CREATE TABLE table2 (col2_0 INET, col2_1 BYTES NOT NULL, col2_2 CHAR, col2_3 CHAR NULL, col2_4 REGCLASS, col2_5 OID, col2_6 OID, col2_7 REGCLASS NULL, col2_8 FLOAT4 NULL, col2_9 STRING AS (lower(col2_2)) VIRTUAL);
CREATE TABLE table3 (col3_0 NAME NULL, col3_1 TIMETZ[], col3_2 FLOAT4 NOT NULL, col3_3 JSONB, col3_4 GEOGRAPHY NOT NULL, col3_5 BOX2D NULL, col3_6 JSONB NULL, col3_7 TIMESTAMP[] NOT NULL, col3_8 GEOGRAPHY NOT NULL, col3_9 STRING NOT NULL AS (lower(CAST(col3_8 AS STRING))) VIRTUAL, col3_10 FLOAT4 NOT NULL AS (col3_2 + (-1.2635523080825806):::FLOAT8) STORED, col3_11 STRING AS (CASE WHEN col3_1 IS NULL THEN e'\'':::STRING ELSE e'\x18;i\f':::STRING END) STORED, col3_12 STRING AS (lower(CAST(col3_3 AS STRING))) STORED, col3_13 FLOAT4 NOT NULL AS (col3_2 + (-0.15602044761180878):::FLOAT8) STORED, col3_14 STRING NULL AS (lower(CAST(col3_6 AS STRING))) STORED, INVERTED INDEX (col3_10, col3_3 ASC) WHERE (((((((table3.col3_0 > e'\U00002603':::STRING) OR (table3.col3_2 != 1.401298464324817e-45:::FLOAT8)) AND (table3.col3_11 > e'\x00':::STRING)) AND (table3.col3_13 > '+Inf':::FLOAT8)) AND (table3.col3_10 != 3.4028234663852886e+38:::FLOAT8)) OR (table3.col3_12 <= e'\U00002603':::STRING)) AND (table3.col3_9 != '"':::STRING)) AND (table3.col3_14 <= e'\'':::STRING), FAMILY (col3_7, col3_8, col3_4), FAMILY (col3_6, col3_0, col3_13, col3_14, col3_2), FAMILY (col3_3, col3_12, col3_5), FAMILY (col3_10), FAMILY (col3_1, col3_11));
ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2867, "histo_col_type": "", "name": "__auto__", "null_count": 217678, "row_count": 400000}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 302036, "histo_col_type": "", "name": "__auto__", "null_count": 182936, "row_count": 400000}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 194980, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 400000}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 326448, "histo_col_type": "", "name": "__auto__", "null_count": 15992, "row_count": 400000}, {"columns": ["col1_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 72589, "histo_buckets": [{"distinct_range": 0, "num_eq": 300000, "num_range": 0, "upper_bound": ""}, {"distinct_range": 3939590695946460700, "num_eq": 50, "num_range": 8704470236669127045, "upper_bound": "Z*V"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 312492, "row_count": 400000}, {"columns": ["col1_16"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 29312, "histo_col_type": "", "name": "__auto__", "null_count": 248763, "row_count": 400000}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 379911, "histo_buckets": [{"distinct_range": 0, "num_eq": 0, "num_range": 0, "upper_bound": "0"}, {"distinct_range": 0, "num_eq": 3993466937362123083, "num_range": 7698815883932495458, "upper_bound": "197621422"}, {"distinct_range": 9819856829053024, "num_eq": 7495913025453443518, "num_range": 1415712571925768189, "upper_bound": "1082231751"}, {"distinct_range": 0, "num_eq": 6235317632711338309, "num_range": 500, "upper_bound": "2391979867"}, {"distinct_range": 167642.63322079685, "num_eq": 5601083383208173658, "num_range": 200000, "upper_bound": "2514751210"}, {"distinct_range": 2015261237.8290854, "num_eq": 40000000000, "num_range": 10000000000, "upper_bound": "3722175123"}], "histo_col_type": "REGCLASS", "name": "__auto__", "null_count": 296469, "row_count": 400000}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 193375, "histo_col_type": "", "name": "__auto__", "null_count": 287542, "row_count": 400000}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 120575, "histo_col_type": "", "name": "__auto__", "null_count": 146685, "row_count": 400000}, {"columns": ["col1_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 310077, "histo_col_type": "", "name": "__auto__", "null_count": 20081, "row_count": 400000}, {"columns": ["col1_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 378874, "histo_col_type": "", "name": "__auto__", "null_count": 382399, "row_count": 400000}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 135709, "histo_col_type": "", "name": "__auto__", "null_count": 362040, "row_count": 400000}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 273837, "histo_buckets": [{"distinct_range": 0, "num_eq": 10000, "num_range": 0, "upper_bound": "-Inf"}, {"distinct_range": 504271022429688700, "num_eq": 8000000, "num_range": 980788384044514287, "upper_bound": "-0.8873592686932668"}, {"distinct_range": 0, "num_eq": 2770698260103718826, "num_range": 500000, "upper_bound": "0.03480642334036263"}, {"distinct_range": 3319416.772543659, "num_eq": 1033986371229552598, "num_range": 9000000, "upper_bound": "0.06539028535691"}, {"distinct_range": 0, "num_eq": 400, "num_range": 6028046798592252313, "upper_bound": "0.18035435317867154"}, {"distinct_range": 0, "num_eq": 6021854295665679415, "num_range": 0, "upper_bound": "0.2052610577913109"}, {"distinct_range": 4624864600049800000, "num_eq": 9000000000, "num_range": 4624864600049800089, "upper_bound": "0.4316100870918574"}, {"distinct_range": 2842760826683231000, "num_eq": 60000, "num_range": 3778825096108910705, "upper_bound": "1.286112887410204"}, {"distinct_range": 100, "num_eq": 2000000000, "num_range": 100, "upper_bound": "3.4028234663852886e+38"}], "histo_col_type": "FLOAT8", "name": "__auto__", "null_count": 211227, "row_count": 400000}, {"columns": ["col1_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 62353, "histo_col_type": "", "name": "__auto__", "null_count": 61781, "row_count": 400000}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 240072, "histo_col_type": "", "name": "__auto__", "null_count": 312226, "row_count": 400000}, {"columns": ["col1_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 259320, "histo_buckets": [{"distinct_range": 0, "num_eq": 8478556586300979885, "num_range": 0, "upper_bound": "0"}, {"distinct_range": 95048614898029620, "num_eq": 2934309491016742753, "num_range": 1887766643710174913, "upper_bound": "1383585670"}, {"distinct_range": 680645295850592500, "num_eq": 8000000, "num_range": 1494113539379626474, "upper_bound": "1408248142"}, {"distinct_range": 1792816811157387800, "num_eq": 1000, "num_range": 6867457179139219814, "upper_bound": "1639183868"}, {"distinct_range": 80000000, "num_eq": 2028900753259358016, "num_range": 80000000, "upper_bound": "1720265080"}, {"distinct_range": 0, "num_eq": 0, "num_range": 10000, "upper_bound": "1769734993"}], "histo_col_type": "REGCLASS", "name": "__auto__", "null_count": 348375, "row_count": 400000}, {"columns": ["col1_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 196898, "histo_col_type": "", "name": "__auto__", "null_count": 284652, "row_count": 400000}]':::JSONB;
ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2982055, "histo_col_type": "", "name": "__auto__", "null_count": 6146327, "row_count": 9000000}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7922350, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 9000000}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6893614, "histo_col_type": "", "name": "__auto__", "null_count": 1065291, "row_count": 9000000}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5005938, "histo_col_type": "", "name": "__auto__", "null_count": 7645923, "row_count": 9000000}, {"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7275505, "histo_col_type": "", "name": "__auto__", "null_count": 1550199, "row_count": 9000000}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6380805, "histo_col_type": "", "name": "__auto__", "null_count": 4994837, "row_count": 9000000}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4219049, "histo_col_type": "", "name": "__auto__", "null_count": 4897852, "row_count": 9000000}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1766977, "histo_col_type": "", "name": "__auto__", "null_count": 7413768, "row_count": 9000000}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7480031, "histo_col_type": "", "name": "__auto__", "null_count": 7353832, "row_count": 9000000}, {"columns": ["col2_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3458556, "histo_col_type": "", "name": "__auto__", "null_count": 2045475, "row_count": 9000000}]':::JSONB;
ALTER TABLE table3 INJECT STATISTICS '[{"columns": ["col3_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4743139, "histo_col_type": "", "name": "__auto__", "null_count": 5731363, "row_count": 10000000}, {"columns": ["col3_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2582048, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 10000000}, {"columns": ["col3_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 8158156, "histo_col_type": "", "name": "__auto__", "null_count": 9233726, "row_count": 10000000}, {"columns": ["col3_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1405575, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 10000000}, {"columns": ["col3_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6823965, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 10000000}, {"columns": ["col3_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 9011788, "histo_col_type": "", "name": "__auto__", "null_count": 5966233, "row_count": 10000000}, {"columns": ["col3_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5377765, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 10000000}, {"columns": ["col3_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2021363, "histo_buckets": [{"distinct_range": 0, "num_eq": 4017730771361476442, "num_range": 0, "upper_bound": "-1.9992077350616455"}, {"distinct_range": 15353264174.375704, "num_eq": 70000000, "num_range": 70000000000, "upper_bound": "-0.2835067808628082"}, {"distinct_range": 582985122197937400, "num_eq": 800, "num_range": 582985122197937419, "upper_bound": "0.618767261505127"}, {"distinct_range": 0, "num_eq": 6354180375303660225, "num_range": 3552042628767597078, "upper_bound": "1.9718871116638184"}], "histo_col_type": "FLOAT4", "name": "__auto__", "null_count": 0, "row_count": 10000000}, {"columns": ["col3_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3544923, "histo_col_type": "", "name": "__auto__", "null_count": 9691263, "row_count": 10000000}, {"columns": ["col3_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7500648, "histo_col_type": "", "name": "__auto__", "null_count": 8595792, "row_count": 10000000}, {"columns": ["col3_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1521220, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 10000000}, {"columns": ["col3_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5060386, "histo_col_type": "", "name": "__auto__", "null_count": 1729250, "row_count": 10000000}, {"columns": ["col3_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7071802, "histo_col_type": "", "name": "__auto__", "null_count": 4779907, "row_count": 10000000}, {"columns": ["col3_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1464778, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 10000000}, {"columns": ["col3_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7044359, "histo_col_type": "", "name": "__auto__", "null_count": 360983, "row_count": 10000000}]':::JSONB;
CREATE TYPE rand_typ_0 AS ENUM ('teui');
;
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
SELECT
g::INT2 AS _int2,
g::INT4 AS _int4,
g::INT8 AS _int8,
g::FLOAT4 AS _float4,
g::FLOAT8 AS _float8,
'2001-01-01'::DATE + g AS _date,
'2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
'2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
g * '1 day'::INTERVAL AS _interval,
g % 2 = 1 AS _bool,
g::DECIMAL AS _decimal,
g::STRING AS _string,
g::STRING::BYTES AS _bytes,
substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
'0.0.0.0'::INET + g AS _inet,
g::STRING::JSONB AS _jsonb,
enum_range('hello'::greeting)[g] as _enum
FROM
generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);
;
rsg_test.go:584:
rsg_test.go:585: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith115583144
--- FAIL: TestRandomSyntaxSQLSmith (301.50s)
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-experience rafiss
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ 7628160a7dfdc73d693f8018772fef8f79c8c0fe:
Random syntax error:
rsg_test.go:763: Crash detected: server panic: driver: bad connection
Query:
WITH
with_193606 (col_1147173)
AS (
SELECT
*
FROM
(
VALUES
(
'BOX(-0.6371056685789843 -0.039306980163971494,0.3930825274406047 0.5098546472967286)':::BOX2D
),
(
(
SELECT
st_extent(tab_474403.col1_1::GEOMETRY) OVER (PARTITION BY tab_474403.col1_1 ORDER BY tab_474403.col1_1 ASC)::BOX2D
AS col_1147172
FROM
defaultdb.public.table1@[0] AS tab_474403,
defaultdb.public.table1@table1_col1_3_col1_0_col1_4_key AS tab_474422
GROUP BY
tab_474403.col1_0, tab_474403.col1_1
LIMIT
1:::INT8
)
),
(
st_makebox2d('0103000000010000000D0000002C6F44E86414FEC1B2004CF3BC4EF9C1C51682EA9E1201C23AAA9195D2B600C279A0DEBC726BF7C147A3B045B33200C2F006B19D6D5CC4C1AA38D8C0598300C25015CF5E266CE241D92480E0303EFFC1C8E6F9AAD64700423052E2800ACF01C2344FAC31E589FF41718DC3DF61F4FFC1548DA7F8816B00427A24BBBADCC9F9C15C126F7DF0CFF041740E285E92DCDFC1AA180A0AD121E6C1ACD01E4AF37E02420C40585AA1F4E0C1FAD593389E3FF6417AA0B7961E82E1C1882180A1C124F7412C6F44E86414FEC1B2004CF3BC4EF9C1':::GEOMETRY::GEOMETRY, NULL::GEOMETRY)::BOX2D
),
('BOX(0.5509735123743438 -0.04446419665824791,0.7206710845809449 0.9686705544663209)':::BOX2D),
(NULL),
('BOX(-1.4760817484946114 -1.3247418350077744,-0.827686680324118 0.2990352178676119)':::BOX2D)
)
AS tab_474423 (col_1147173)
),
with_193607 (col_1147174)
AS (
SELECT
*
FROM
(
VALUES
(e'\x11%\b\x16g]g>':::STRING),
('JNi3~i':::STRING),
(e'><\x1aA\x0bC':::STRING),
(COALESCE('.w':::STRING, e'{pWH\r5^':::STRING)),
('DC:':::STRING)
)
AS tab_474424 (col_1147174)
),
with_193608 (col_1147175)
AS (
SELECT
*
FROM
(VALUES (NULL), (NULL), (e'\x1c5L!':::STRING), (e'\x01]0':::STRING)) AS tab_474425 (col_1147175)
)
SELECT
tab_474427._int2 AS col_1147176,
29.92976234188847250:::DECIMAL AS col_1147177,
tab_474427._int8 AS col_1147178,
'hf5Zs':::STRING AS col_1147179,
CASE WHEN tab_474426._bool THEN tab_474427._float8 ELSE tab_474427._float8 END AS col_1147180,
tab_474427._enum AS col_1147181,
NULL AS col_1147182,
tab_474427._interval AS col_1147183,
'':::STRING AS col_1147184,
tab_474427._date AS col_1147185,
(
SELECT
tab_474426._inet AS col_1147186
FROM
defaultdb.public.table1@[0] AS tab_474428
WHERE
st_dwithinexclusive(tab_474428.col1_10::STRING, tab_474428.col1_6::STRING, 0.8182316835237813:::FLOAT8::FLOAT8)::BOOL
ORDER BY
tab_474428.col1_10 DESC, tab_474428.col1_8 ASC, tab_474428.col1_6 DESC
LIMIT
1:::INT8
)
AS col_1147187
FROM
defaultdb.public.seed@[0] AS tab_474426,
with_193608 AS cte_ref_56136,
defaultdb.public.seed@seed__int8__float8__date_idx AS tab_474427;
Schema:
rsg_test.go:580: To reproduce, use schema:
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
CREATE TABLE table1 (col1_0 BOOL NOT NULL, col1_1 GEOMETRY NULL, col1_2 "char" NOT NULL, col1_3 BOX2D NULL, col1_4 REGPROCEDURE NOT NULL, col1_5 DATE NULL, col1_6 STRING NULL AS (lower(CAST(col1_1 AS STRING))) VIRTUAL, col1_7 STRING NULL AS (lower(CAST(col1_1 AS STRING))) STORED, col1_8 STRING NULL AS (lower(CAST(col1_1 AS STRING))) STORED, col1_9 STRING NULL AS (lower(CAST(col1_3 AS STRING))) VIRTUAL, col1_10 STRING NULL AS (lower(CAST(col1_3 AS STRING))) STORED, UNIQUE (col1_3 ASC, col1_0 DESC, col1_4 ASC) STORING (col1_7, col1_8) WHERE (((((((table1.col1_5 < '4714-11-24 BC':::DATE) AND (table1.col1_2 >= e'\U00002603':::STRING)) OR table1.col1_0) OR (table1.col1_6 != 'X':::STRING)) OR (table1.col1_7 = e'\U00002603':::STRING)) OR (table1.col1_8 != e'\x00':::STRING)) OR (table1.col1_9 >= '"':::STRING)) OR (table1.col1_10 != '"':::STRING), FAMILY (col1_7), FAMILY (col1_2), FAMILY (col1_8, col1_10), FAMILY (col1_4), FAMILY (col1_1, col1_0, col1_5, col1_3));
ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 542248061589353244, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6582543682333259666}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5937922724516528855, "histo_col_type": "", "name": "__auto__", "null_count": 4316267697716257609, "row_count": 6582543682333259666}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 632119529253646495, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6582543682333259666}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1640303085573639530, "histo_col_type": "", "name": "__auto__", "null_count": 1859820653006990570, "row_count": 6582543682333259666}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2414353688121691421, "histo_col_type": "", "name": "__auto__", "null_count": 972090368035231353, "row_count": 6582543682333259666}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4366249973913847764, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6582543682333259666}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 84858236620653830, "histo_buckets": [{"distinct_range": 0, "num_eq": 4371205352101106246, "num_range": 0, "upper_bound": "BOX(-0.6045592012320077 -0.8642272682918163,0.16495161004584113 0.15761372594743717)"}, {"distinct_range": 8791807554303289000, "num_eq": 2709669584139685805, "num_range": 8791807554303289360, "upper_bound": "BOX(-0.45467640790357866 -0.6482399134511142,0.5935542562682985 1.556712118438258)"}, {"distinct_range": 0, "num_eq": 30, "num_range": 400, "upper_bound": "BOX(-0.40825030454159045 -1.0989812366792824,1.5704546030114082 0.021548411000639867)"}, {"distinct_range": 790949312846041700, "num_eq": 400000000, "num_range": 843193272553608295, "upper_bound": "BOX(-0.2740868623356628 -0.5165959510185295,-0.13535268107997928 2.360136116170456)"}, {"distinct_range": 544941207150106100, "num_eq": 993392314340379111, "num_range": 544941207150106115, "upper_bound": "BOX(-0.1408516110360976 0.4102753792390148,2.5111767947429793 0.6143252921083602)"}, {"distinct_range": 0, "num_eq": 30000000, "num_range": 5684776350202556506, "upper_bound": "BOX(0.001139596705314383 0.14917894400005044,0.7119575034038326 2.0295004605192073)"}, {"distinct_range": 0, "num_eq": 200000000, "num_range": 3000, "upper_bound": "BOX(0.3046699202468308 -0.34361328420972104,1.2457181434456326 -0.14139647172766578)"}, {"distinct_range": 0, "num_eq": 560393798740174751, "num_range": 0, "upper_bound": "BOX(0.3174210950759669 -0.6771647422383485,0.9796636372904102 0.14511773005689715)"}], "histo_col_type": "BOX2D", "name": "__auto__", "null_count": 3373515966398210291, "row_count": 6582543682333259666}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4638717675671914420, "histo_col_type": "", "name": "__auto__", "null_count": 99584700783379161, "row_count": 6582543682333259666}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6575657352867630986, "histo_col_type": "", "name": "__auto__", "null_count": 31111482003098975, "row_count": 6582543682333259666}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2794889600768471636, "histo_col_type": "", "name": "__auto__", "null_count": 190649574678474037, "row_count": 6582543682333259666}, {"columns": ["col1_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3577143366280544193, "histo_col_type": "", "name": "__auto__", "null_count": 2980544810627814687, "row_count": 6582543682333259666}]':::JSONB;
CREATE TYPE rand_typ_0 AS ENUM ('ceym', 'pprzmr', 'huaaf', 'q', 'bg');
CREATE TYPE rand_typ_1 AS ENUM ('vbkoki');
CREATE TYPE rand_typ_2 AS ENUM ('gjqmc', 'mxn', 'hu', 'xeg', 'rjr', 'b');
CREATE TYPE rand_typ_3 AS ENUM ('ils', 'tal', 'lg', 'mp');
;
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
SELECT
g::INT2 AS _int2,
g::INT4 AS _int4,
g::INT8 AS _int8,
g::FLOAT4 AS _float4,
g::FLOAT8 AS _float8,
'2001-01-01'::DATE + g AS _date,
'2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
'2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
g * '1 day'::INTERVAL AS _interval,
g % 2 = 1 AS _bool,
g::DECIMAL AS _decimal,
g::STRING AS _string,
g::STRING::BYTES AS _bytes,
substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
'0.0.0.0'::INET + g AS _inet,
g::STRING::JSONB AS _jsonb,
enum_range('hello'::greeting)[g] as _enum
FROM
generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);
;
rsg_test.go:584:
rsg_test.go:585: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith562437015
--- FAIL: TestRandomSyntaxSQLSmith (300.93s)
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-experience rafiss
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ 91632b5a4db844ea272a1f29196d74e3835922bd:
Random syntax error:
rsg_test.go:763: Crash detected: server panic: pq: internal error: unexpectedly found decreasing offsets: [0 1 2 3 4 0 0]
Query:
WITH
with_100074 (col_606159)
AS (SELECT * FROM (VALUES (2498711152:::OID), (754390268:::OID)) AS tab_245548 (col_606159))
SELECT
tab_245549._decimal AS col_606160,
tab_245549._string AS col_606161,
tab_245549._inet AS col_606162,
'1987-09-17':::DATE AS col_606163,
tab_245549.tableoid AS col_606164,
e'[[false, [[]]], {"4ORnk6": false, "=GDK(h?T\\"~2;": true}]':::JSONB AS col_606165,
1:::INT8 AS col_606166,
true AS col_606167,
'+Inf':::FLOAT8 AS col_606168,
(-4.850971150408756616E+28):::DECIMAL AS col_606169,
lead(tab_245549._bytes::BYTES) OVER (PARTITION BY tab_245549.crdb_internal_mvcc_timestamp ORDER BY tab_245549._decimal)::BYTES
AS col_606170,
tab_245549._timestamptz AS col_606171,
(-1.2720199823379517):::FLOAT8 AS col_606172
FROM
defaultdb.public.seed@seed__int8__float8__date_idx AS tab_245549
LIMIT
58:::INT8;
Schema:
rsg_test.go:580: To reproduce, use schema:
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
CREATE TABLE table1 (col1_0 TIMETZ, col1_1 STRING NOT NULL, col1_2 TIMETZ NOT NULL, col1_3 REGPROCEDURE NOT NULL, col1_4 TIMETZ NOT NULL, col1_5 BYTES, col1_6 FLOAT8 NULL, col1_7 OID NOT NULL, col1_8 STRING NOT NULL, col1_9 BIT(42) NOT NULL, col1_10 BOX2D NULL, col1_11 BOOL NOT NULL, col1_12 REGTYPE, col1_13 DECIMAL NOT NULL, col1_14 TIMESTAMPTZ NOT NULL, PRIMARY KEY (col1_11 DESC, col1_2, col1_7 DESC, col1_8, col1_9, col1_13 DESC, col1_14, col1_4 DESC, col1_3 DESC), col1_15 STRING NULL AS (lower(CAST(col1_10 AS STRING))) STORED, col1_16 STRING NOT NULL AS (lower(CAST(col1_4 AS STRING))) VIRTUAL, col1_17 STRING NOT NULL AS (lower(CAST(col1_4 AS STRING))) VIRTUAL, INDEX (col1_5, col1_17 DESC, col1_11, col1_0 DESC, col1_1 ASC, col1_13 ASC), UNIQUE (col1_17 DESC, col1_0, col1_3, col1_8, col1_12 ASC, col1_13 DESC, col1_2 DESC, col1_4 ASC, col1_15 ASC, col1_14 DESC) STORING (col1_6, col1_10), UNIQUE (col1_9 ASC, col1_5 DESC, col1_3 DESC, col1_1 DESC, col1_2 DESC) STORING (col1_6, col1_10) WHERE (((((((((table1.col1_13 >= (-1.234E+401):::DECIMAL) OR (table1.col1_0 = '24:00:00-15:59:00':::TIMETZ)) AND (table1.col1_4 > '24:00:00-15:59:00':::TIMETZ)) OR (table1.col1_17 >= 'X':::STRING)) AND (table1.col1_8 > '"':::STRING)) OR (table1.col1_15 <= '"':::STRING)) AND (table1.col1_2 <= '24:00:00-15:59:00':::TIMETZ)) AND (table1.col1_5 < '\xff':::BYTES)) AND (table1.col1_1 >= '':::STRING)) OR (table1.col1_16 != 'X':::STRING), INDEX (col1_6 DESC, col1_5 DESC, col1_14), UNIQUE (col1_0 ASC, col1_8 ASC, col1_17 ASC, col1_9 DESC, col1_14 ASC, col1_11, col1_3 DESC, col1_13 ASC, col1_7 ASC, col1_16 DESC, col1_5 DESC, col1_1 ASC), UNIQUE (col1_14, col1_17 ASC, col1_2 ASC, col1_3 ASC, col1_8 DESC, col1_12, col1_10, col1_0, col1_9, col1_6 ASC, col1_16 DESC), FAMILY (col1_15, col1_8), FAMILY (col1_12, col1_10, col1_9), FAMILY (col1_1, col1_3), FAMILY (col1_11, col1_2), FAMILY (col1_5, col1_13), FAMILY (col1_7), FAMILY (col1_4, col1_6, col1_0), FAMILY (col1_14));
CREATE TABLE table2 (col1_11 BOOL NOT NULL, col1_2 TIMETZ NOT NULL, col1_7 OID NOT NULL, col1_8 STRING NOT NULL, col1_9 BIT(42) NOT NULL, col1_13 DECIMAL NOT NULL, col1_14 TIMESTAMPTZ NOT NULL, col1_4 TIMETZ NOT NULL, col1_3 REGPROCEDURE NOT NULL, col2_9 DATE NOT NULL, col2_10 REGTYPE NOT NULL, col2_11 TIMETZ NULL, col2_12 FLOAT4 NULL, col2_13 REGPROCEDURE NULL, col2_14 INET NOT NULL, col2_15 TIMETZ, col2_16 UUID, col2_17 REGNAMESPACE, col2_18 TIMESTAMP, col2_19 REGPROC NOT NULL, col2_20 "char", col2_21 INET, col2_22 BOOL, col2_23 REGPROC, col2_24 REGPROC, PRIMARY KEY (col1_11 DESC, col1_2, col1_7 DESC, col1_8, col1_9, col1_13 DESC, col1_14, col1_4 DESC, col1_3 DESC, col2_10 ASC, col2_13 DESC, col2_18, col2_12 ASC, col2_21 DESC, col2_17, col2_11 ASC, col2_14, col2_19 ASC, col2_23 DESC, col2_24 DESC, col2_15 ASC, col2_9), UNIQUE (col1_9 DESC, col2_21 DESC, col2_10 DESC, col1_7 ASC, col2_9 DESC, col2_15, col2_24 DESC, col1_2 DESC, col1_11), INDEX (col2_17 ASC, col2_14 DESC, col1_3, col2_11, col2_22 ASC, col2_23 DESC, col1_4, col2_20 DESC, col2_21 ASC) WHERE ((((table2.col1_2 < '24:00:00-15:59:00':::TIMETZ) OR (table2.col2_18 >= '-2000-01-01 00:00:00':::TIMESTAMP)) OR (table2.col1_14 < '-4713-11-24 00:00:00+00:00':::TIMESTAMPTZ)) OR table2.col1_11) AND table2.col2_22, INDEX (col2_16 DESC, col2_14 ASC, col2_13, col2_17, col2_19 DESC, col1_7 ASC, col2_11 ASC, col2_20 DESC, col2_23 ASC, col1_3 ASC, col2_9, col1_11 ASC, col2_22, col1_8 ASC, col2_18 ASC, col2_15, col1_2 DESC, col1_14, col2_24 DESC, col2_10, col2_21 ASC) WHERE ((table2.col2_12 < '-Inf':::FLOAT8) OR (table2.col1_8 > '"':::STRING)) OR (table2.col1_13 <= 'Infinity':::DECIMAL), UNIQUE (col1_7 DESC, col2_14 ASC, col2_12 ASC, col1_9, col2_16 DESC, col2_9, col1_2 DESC, col2_23 ASC, col2_10 DESC, col2_21, col2_20 DESC, col1_4, col2_19, col1_11 DESC, col2_17 DESC, col1_14 ASC, col2_18 DESC), UNIQUE (col2_10 ASC, col1_13 ASC, col2_18 DESC, col2_22 ASC, col1_7 DESC, col2_15, col2_19, col2_23, col2_20, col1_11, col2_16 ASC, col1_4 ASC, col2_14 ASC) WHERE (((((((((((table2.col2_20 >= '':::STRING) OR (table2.col2_12 != 1.401298464324817e-45:::FLOAT8)) AND (table2.col2_11 != '00:00:00+15:59:00':::TIMETZ)) OR (table2.col1_14 > '3000-01-01 00:00:00+00:00':::TIMESTAMPTZ)) OR (NOT table2.col2_22)) AND (NOT table2.col1_11)) OR (table2.col1_2 > '00:00:00+15:59:00':::TIMETZ)) AND (table2.col1_4 < '00:00:00+15:59:00':::TIMETZ)) AND (table2.col2_15 >= '24:00:00-15:59:00':::TIMETZ)) AND (table2.col1_13 != (-1.234E+401):::DECIMAL)) OR (table2.col2_9 >= '4714-11-24 BC':::DATE)) OR (table2.col2_18 < '-4713-11-24 00:00:00':::TIMESTAMP), INDEX (col2_22 DESC, col2_14, col2_20 ASC, col2_19 DESC, col2_11 DESC, col2_10 DESC, col1_13 DESC, col1_7 ASC, col1_11 DESC, col1_2 DESC, col2_12 DESC, col1_3, col1_8 DESC, col2_24 DESC, col2_13 DESC, col1_14 DESC, col2_21, col1_9) STORING (col2_16) WHERE ((((((((((((table2.col2_15 = '00:00:00+15:59:00':::TIMETZ) AND (table2.col1_8 != e'\x00':::STRING)) AND (table2.col2_12 = 3.4028234663852886e+38:::FLOAT8)) AND (table2.col1_2 = '00:00:00+15:59:00':::TIMETZ)) AND (table2.col2_20 = e'\x00':::STRING)) AND (NOT table2.col2_22)) AND (table2.col2_18 != '-4713-11-24 00:00:00':::TIMESTAMP)) OR (table2.col1_14 = '0001-01-01 00:00:00+00:00':::TIMESTAMPTZ)) OR table2.col1_11) AND (table2.col2_11 > '00:00:00+15:59:00':::TIMETZ)) AND (table2.col1_13 >= (-1):::DECIMAL)) AND (table2.col1_4 < '24:00:00-15:59:00':::TIMETZ)) OR (table2.col2_9 > '5874897-12-31':::DATE), INDEX (col2_23 ASC, col1_13 ASC, col1_7, col2_19 DESC, col2_20 DESC, col2_12 DESC, col2_22 DESC, col2_11 DESC, col1_2, col1_9, col2_16, col2_21 DESC, col1_3, col1_14 ASC, col2_10, col2_18 ASC, col1_11 DESC, col2_17, col2_13, col2_24 ASC, col2_15 ASC, col1_8 DESC, col2_9, col1_4 DESC, col2_14) WHERE ((((((((((((table2.col2_15 >= '00:00:00+15:59:00':::TIMETZ) AND (table2.col2_20 >= e'\U00002603':::STRING)) AND (table2.col1_8 = e'\U00002603':::STRING)) OR (table2.col1_14 < '3000-01-01 00:00:00+00:00':::TIMESTAMPTZ)) AND (table2.col1_4 != '24:00:00-15:59:00':::TIMETZ)) OR (table2.col2_18 >= '-2000-01-01 00:00:00':::TIMESTAMP)) OR (table2.col1_13 >= (-1):::DECIMAL)) OR (table2.col1_2 = '24:00:00-15:59:00':::TIMETZ)) AND (table2.col2_11 > '24:00:00-15:59:00':::TIMETZ)) OR (table2.col2_12 < 3.4028234663852886e+38:::FLOAT8)) AND table2.col1_11) AND (NOT table2.col2_22)) OR (table2.col2_9 = '5874897-12-31':::DATE), UNIQUE (col1_9 DESC, col2_16 ASC, col1_4 DESC, col2_23, col1_11, col2_19, col2_21, col2_9 DESC, col2_18 DESC, col2_12, col2_15 ASC, col2_24 ASC, col2_22 DESC, col2_20, col1_14 DESC, col1_3, col1_8 DESC, col1_2 DESC, col2_10, col1_7 ASC, col1_13 ASC, col2_13, col2_11) WHERE (((((((((table2.col2_12 < 'NaN':::FLOAT8) OR (table2.col1_8 != e'\'':::STRING)) OR (table2.col2_11 = '24:00:00-15:59:00':::TIMETZ)) OR (table2.col1_4 >= '24:00:00-15:59:00':::TIMETZ)) OR (table2.col2_20 < '"':::STRING)) AND (NOT table2.col2_22)) AND (table2.col2_18 <= '-2000-01-01 00:00:00':::TIMESTAMP)) AND (table2.col2_15 = '00:00:00+15:59:00':::TIMETZ)) OR (table2.col1_13 >= 0:::DECIMAL)) AND (NOT table2.col1_11), FAMILY (col1_9, col2_9, col2_12), FAMILY (col2_24, col2_21), FAMILY (col1_13, col2_11, col2_16, col2_19), FAMILY (col2_20), FAMILY (col2_18, col1_14), FAMILY (col1_3, col1_2), FAMILY (col1_11, col2_15, col1_4), FAMILY (col1_7, col2_22, col2_10, col1_8, col2_23, col2_14), FAMILY (col2_17, col2_13)) INTERLEAVE IN PARENT table1 (col1_11, col1_2, col1_7, col1_8, col1_9, col1_13, col1_14, col1_4, col1_3);
ALTER TABLE table1 INJECT STATISTICS e'[{"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1688253680872987171, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2736520224885379544}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 751178760305039202, "histo_buckets": [{"distinct_range": 0, "num_eq": 2000000000, "num_range": 0, "upper_bound": "\\\\x00"}, {"distinct_range": 14721509736623058, "num_eq": 9000, "num_range": 130221294749570752, "upper_bound": "\\\\x02"}, {"distinct_range": 0, "num_eq": 5467286192578949337, "num_range": 100000, "upper_bound": "\\\\x54"}, {"distinct_range": 0, "num_eq": 7239674089967710170, "num_range": 2610329960619082285, "upper_bound": "\\\\x7b938d57"}], "histo_col_type": "BYTES", "name": "__auto__", "null_count": 123027069676570139, "row_count": 2736520224885379544}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 372743240629642769, "histo_buckets": [{"distinct_range": 0, "num_eq": 8001237521349278072, "num_range": 0, "upper_bound": "0.23349568698137757"}, {"distinct_range": 700311661632119000, "num_eq": 7565550785246051633, "num_range": 700311661632119084, "upper_bound": "0.23929567909710822"}], "histo_col_type": "FLOAT8", "name": "__auto__", "null_count": 2553529414545401750, "row_count": 2736520224885379544}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2236100619543121190, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2736520224885379544}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1702667963935222672, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2736520224885379544}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2599117979667263192, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2736520224885379544}, {"columns": ["col1_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1598598130593125892, "histo_buckets": [{"distinct_range": 0, "num_eq": 2871967080687644319, "num_range": 0, "upper_bound": "false"}, {"distinct_range": 39868.845776308626, "num_eq": 0, "num_range": 40000, "upper_bound": "true"}], "histo_col_type": "BOOL", "name": "__auto__", "null_count": 0, "row_count": 2736520224885379544}, {"columns": ["col1_17"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 631694234095476369, "histo_buckets": [{"distinct_range": 0, "num_eq": 200000000, "num_range": 0, "upper_bound": ""}, {"distinct_range": 0, "num_eq": 4000000000, "num_range": 1303184392582423098, "upper_bound": "\\u0000"}, {"distinct_range": 0, "num_eq": 2754509727151194638, "num_range": 597639480175692855, "upper_bound": ";kb"}, {"distinct_range": 200, "num_eq": 600000, "num_range": 200, "upper_bound": "@c$P\\\\``rt\\u001a"}, {"distinct_range": 6304843010.75823, "num_eq": 40000000, "num_range": 40000000000, "upper_bound": "Is)\\"\\u000c4V+"}, {"distinct_range": 0, "num_eq": 500, "num_range": 600, "upper_bound": "^@Bx1"}, {"distinct_range": 0, "num_eq": 70000000000, "num_range": 2000000000, "upper_bound": "sr"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 0, "row_count": 2736520224885379544}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1426070137547200051, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2736520224885379544}, {"columns": ["col1_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1701338167954058783, "histo_col_type": "", "name": "__auto__", "null_count": 251277352235152998, "row_count": 2736520224885379544}, {"columns": ["col1_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2255834422083898878, "histo_col_type": "", "name": "__auto__", "null_count": 1157754762891101618, "row_count": 2736520224885379544}, {"columns": ["col1_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1929132988321024116, "histo_buckets": [{"distinct_range": 0, "num_eq": 7578737163837570044, "num_range": 0, "upper_bound": "1972-03-21 13:53:30.000122+00:00"}, {"distinct_range": 13355.080253069296, "num_eq": 8000000, "num_range": 20000, "upper_bound": "1980-06-07 12:31:27.000718+00:00"}, {"distinct_range": 500000, "num_eq": 400, "num_range": 500000, "upper_bound": "1986-05-28 11:09:51.000598+00:00"}, {"distinct_range": 980787013096546600, "num_eq": 900000, "num_range": 980787013096546515, "upper_bound": "1986-09-01 15:33:33.000207+00:00"}, {"distinct_range": 0, "num_eq": 0, "num_range": 8160332583424423854, "upper_bound": "2024-02-13 23:37:40.000771+00:00"}, {"distinct_range": 0, "num_eq": 317821532292268992, "num_range": 1886900311694064255, "upper_bound": "2030-08-26 01:23:42.000892+00:00"}, {"distinct_range": 0, "num_eq": 300000, "num_range": 30000000, "upper_bound": "2032-03-31 13:51:36.000478+00:00"}, {"distinct_range": 0, "num_eq": 50000000, "num_range": 6993091519841118250, "upper_bound": "2032-10-12 20:47:04.000761+00:00"}], "histo_col_type": "TIMESTAMPTZ", "name": "__auto__", "null_count": 0, "row_count": 2736520224885379544}, {"columns": ["col1_16"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2352684435235222068, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2736520224885379544}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1766363636966998016, "histo_col_type": "TIMETZ", "name": "__auto__", "null_count": 507194106595442737, "row_count": 2736520224885379544}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 127735265601134960, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2736520224885379544}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 435193074774772816, "histo_col_type": "BIT(42)", "name": "__auto__", "null_count": 0, "row_count": 2736520224885379544}, {"columns": ["col1_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1831624263025032907, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2736520224885379544}, {"columns": ["col1_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1636279428288838782, "histo_col_type": "", "name": "__auto__", "null_count": 1016784787074506661, "row_count": 2736520224885379544}]':::JSONB;
ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_21"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5266992310994170503, "histo_col_type": "", "name": "__auto__", "null_count": 4562216557637480410, "row_count": 7359232321640729476}, {"columns": ["col1_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2127270838472278336, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7359232321640729476}, {"columns": ["col1_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6355579653710162886, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7359232321640729476}, {"columns": ["col2_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2817937390998864717, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7359232321640729476}, {"columns": ["col2_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6117091094653870509, "histo_col_type": "", "name": "__auto__", "null_count": 4672118516576646098, "row_count": 7359232321640729476}, {"columns": ["col2_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3289774505718439844, "histo_col_type": "", "name": "__auto__", "null_count": 5549735045070249984, "row_count": 7359232321640729476}, {"columns": ["col2_16"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6164114382170227268, "histo_buckets": [{"distinct_range": 0, "num_eq": 70000000, "num_range": 0, "upper_bound": "05f8eec2-8769-4567-8644-744bd431bc6c"}, {"distinct_range": 0, "num_eq": 830457114943287336, "num_range": 7695291336444025406, "upper_bound": "dd522ff7-09e2-40fa-a9d1-ed25d5a65cdf"}, {"distinct_range": 3128695693365547500, "num_eq": 4064108828938328325, "num_range": 3960848759288851688, "upper_bound": "ee38bb07-a675-44ee-a215-b58aa00cb23c"}], "histo_col_type": "UUID", "name": "__auto__", "null_count": 4837979980004228354, "row_count": 7359232321640729476}, {"columns": ["col2_17"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7056170906476456286, "histo_buckets": [{"distinct_range": 0, "num_eq": 0, "num_range": 0, "upper_bound": "1085269849"}, {"distinct_range": 40000000, "num_eq": 6713772256610886470, "num_range": 40000000, "upper_bound": "1654827251"}, {"distinct_range": 770895509.9373003, "num_eq": 3000000000, "num_range": 8000000000, "upper_bound": "2203858903"}, {"distinct_range": 0, "num_eq": 80, "num_range": 0, "upper_bound": "2741091551"}, {"distinct_range": 53329529317.81828, "num_eq": 10000000, "num_range": 60000000000, "upper_bound": "2816615655"}, {"distinct_range": 40217.97171357363, "num_eq": 10000000, "num_range": 90000, "upper_bound": "2957307980"}, {"distinct_range": 2498556174774841300, "num_eq": 800000, "num_range": 8630992671441419963, "upper_bound": "3782645378"}], "histo_col_type": "REGNAMESPACE", "name": "__auto__", "null_count": 4516281430403858261, "row_count": 7359232321640729476}, {"columns": ["col2_22"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3790433874437297159, "histo_buckets": [{"distinct_range": 0, "num_eq": 700000000, "num_range": 0, "upper_bound": "false"}, {"distinct_range": 756.5943337352084, "num_eq": 5194037964490085229, "num_range": 800, "upper_bound": "true"}], "histo_col_type": "BOOL", "name": "__auto__", "null_count": 1185105624253101528, "row_count": 7359232321640729476}, {"columns": ["col1_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3046508194542542285, "histo_buckets": [{"distinct_range": 0, "num_eq": 50, "num_range": 0, "upper_bound": "false"}, {"distinct_range": 0, "num_eq": 0, "num_range": 6000, "upper_bound": "true"}], "histo_col_type": "BOOL", "name": "__auto__", "null_count": 0, "row_count": 7359232321640729476}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7344690360193709082, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7359232321640729476}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1055300617017690034, "histo_buckets": [{"distinct_range": 0, "num_eq": 1000000000, "num_range": 0, "upper_bound": "0"}], "histo_col_type": "OID", "name": "__auto__", "null_count": 0, "row_count": 7359232321640729476}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2721624345719733222, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7359232321640729476}, {"columns": ["col2_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2549725777831540999, "histo_buckets": [{"distinct_range": 0, "num_eq": 634716093466350453, "num_range": 0, "upper_bound": "0"}, {"distinct_range": 5607057672.405409, "num_eq": 30, "num_range": 10000000000, "upper_bound": "167100073"}, {"distinct_range": 5053894120305617000, "num_eq": 4801532440010995612, "num_range": 5053894120305616832, "upper_bound": "1382455076"}, {"distinct_range": 70000, "num_eq": 300, "num_range": 70000, "upper_bound": "1651099028"}, {"distinct_range": 41234197334.585144, "num_eq": 90000000, "num_range": 80000000000, "upper_bound": "2044932138"}, {"distinct_range": 0, "num_eq": 5485791139809540470, "num_range": 1553622581822275885, "upper_bound": "3508145914"}], "histo_col_type": "REGTYPE", "name": "__auto__", "null_count": 0, "row_count": 7359232321640729476}, {"columns": ["col2_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6845536524007370390, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7359232321640729476}, {"columns": ["col2_23"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4131829156314015289, "histo_buckets": [{"distinct_range": 0, "num_eq": 8382334854550881055, "num_range": 0, "upper_bound": "0"}, {"distinct_range": 600000, "num_eq": 7561460019926763959, "num_range": 600000, "upper_bound": "283142135"}, {"distinct_range": 8196507627845347000, "num_eq": 10000000, "num_range": 8196507627845347101, "upper_bound": "2373825603"}, {"distinct_range": 54.62933928576662, "num_eq": 100000000, "num_range": 70, "upper_bound": "2717940410"}, {"distinct_range": 0, "num_eq": 2372804881421987057, "num_range": 2763756682087725663, "upper_bound": "2729492201"}, {"distinct_range": 700000, "num_eq": 9124965589094260874, "num_range": 700000, "upper_bound": "2746073049"}, {"distinct_range": 6071172516749243000, "num_eq": 9000, "num_range": 7360412928297244210, "upper_bound": "3212466447"}, {"distinct_range": 9000, "num_eq": 1180885300787011670, "num_range": 9000, "upper_bound": "3447324858"}, {"distinct_range": 602.7059798616029, "num_eq": 100000000, "num_range": 1000, "upper_bound": "3744513344"}], "histo_col_type": "REGPROC", "name": "__auto__", "null_count": 6762425615401707699, "row_count": 7359232321640729476}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1926038153105963747, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7359232321640729476}, {"columns": ["col2_18"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1646764281373202336, "histo_col_type": "", "name": "__auto__", "null_count": 3193173370793496035, "row_count": 7359232321640729476}, {"columns": ["col2_24"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6240318478710339308, "histo_col_type": "", "name": "__auto__", "null_count": 4831078858399453427, "row_count": 7359232321640729476}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7131687409643744554, "histo_buckets": [{"distinct_range": 0, "num_eq": 3825089892530445576, "num_range": 0, "upper_bound": "000011010000101000011101101011100101111000"}, {"distinct_range": 42.44934442262636, "num_eq": 70, "num_range": 100, "upper_bound": "000011100101100111101101001110111101011010"}, {"distinct_range": 10000, "num_eq": 0, "num_range": 10000, "upper_bound": "000101011100110100101101111110100101100010"}, {"distinct_range": 600000000, "num_eq": 70000, "num_range": 600000000, "upper_bound": "011111111111111111111111111111111111111111"}, {"distinct_range": 0, "num_eq": 40000, "num_range": 1195118578439986076, "upper_bound": "100110010110010011101101101111111010011011"}, {"distinct_range": 600000, "num_eq": 4022540254278286015, "num_range": 600000, "upper_bound": "110010010011011000011010101010010111011001"}, {"distinct_range": 1326817875483391700, "num_eq": 6000, "num_range": 6362352781912758163, "upper_bound": "111111101010001011000010111011111000010101"}], "histo_col_type": "BIT(42)", "name": "__auto__", "null_count": 0, "row_count": 7359232321640729476}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5663356964220531623, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7359232321640729476}, {"columns": ["col2_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3566922562067988945, "histo_col_type": "", "name": "__auto__", "null_count": 1882917613785091373, "row_count": 7359232321640729476}, {"columns": ["col2_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4150003294768024478, "histo_col_type": "", "name": "__auto__", "null_count": 6686477654772384686, "row_count": 7359232321640729476}, {"columns": ["col2_19"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6763995305796919418, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7359232321640729476}, {"columns": ["col2_20"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2683974493647842828, "histo_col_type": "", "name": "__auto__", "null_count": 6309886563596506435, "row_count": 7359232321640729476}]':::JSONB;
CREATE TYPE rand_typ_0 AS ENUM ('hiq', 'fqjzl', 'eggyuq', 're', 'hi', 'jw');
CREATE TYPE rand_typ_1 AS ENUM ('wcwzx', 'wgq', 'ei', 'kurevs', 'rvb', 'mepoxu');
CREATE TYPE rand_typ_2 AS ENUM ('cbue', 'r', 'esmfed', 'yvis');
CREATE TYPE rand_typ_3 AS ENUM ('aumxf');
CREATE TYPE rand_typ_4 AS ENUM ('jyj', 'ty', 'wljlh');
;
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
SELECT
g::INT2 AS _int2,
g::INT4 AS _int4,
g::INT8 AS _int8,
g::FLOAT4 AS _float4,
g::FLOAT8 AS _float8,
'2001-01-01'::DATE + g AS _date,
'2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
'2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
g * '1 day'::INTERVAL AS _interval,
g % 2 = 1 AS _bool,
g::DECIMAL AS _decimal,
g::STRING AS _string,
g::STRING::BYTES AS _bytes,
substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
'0.0.0.0'::INET + g AS _inet,
g::STRING::JSONB AS _jsonb,
enum_range('hello'::greeting)[g] as _enum
FROM
generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);
;
rsg_test.go:584:
rsg_test.go:585: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith499868157
--- FAIL: TestRandomSyntaxSQLSmith (300.88s)
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-experience rafiss
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ 63407904f8ecadbe40cce29c3d67788f859b58b3:
Random syntax error:
rsg_test.go:763: Crash detected: server panic: driver: bad connection
Query:
SELECT
tab_312101.crdb_internal_mvcc_timestamp AS col_752039,
0:::OID AS col_752040,
tab_312101._bytes AS col_752041,
tab_312101._int4 AS col_752042,
(tab_312101._bool OR ('07:09:34.196959':::TIME::TIME IN (SELECT current_time(tab_312101._int8::INT8):::TIME::TIME::TIME AS col_752043 FROM defaultdb.public.table1 AS tab_312102 JOIN defaultdb.public.table1 AS tab_312103 ON ((tab_312102.col1_9) = (tab_312103.col1_9)) AND ((tab_312102.col1_5) = (tab_312103.col1_5)) WHERE false ORDER BY tab_312103.col1_5 LIMIT 49:::INT8)))
AS col_752044,
0.3017504811286926:::FLOAT8 AS col_752045,
NULL AS col_752046,
e'{"UA5l{vr.": [], "b": [[[{}]], {}], "bar": 0.6484593581333626, "qwqYb0>\\\\": true}':::JSONB AS col_752047,
'2015-03-16 10:50:11.000982':::TIMESTAMP AS col_752048,
tab_312101._int8 AS col_752049,
tab_312101._enum AS col_752050,
'1124e699-13a5-491c-ae75-ac641b5d743f':::UUID AS col_752051,
tab_312101._string AS col_752052,
tab_312101._float8 AS col_752053
FROM
defaultdb.public.seed AS tab_312099
JOIN defaultdb.public.seed AS tab_312100 ON (tab_312099._jsonb) = (tab_312100._jsonb),
defaultdb.public.seed@seed__int8__float8__date_idx AS tab_312101
WHERE
tab_312101._bool;
Schema:
rsg_test.go:580: To reproduce, use schema:
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
CREATE TABLE table1 (col1_0 REGCLASS NOT NULL, col1_1 "char" NOT NULL, col1_2 GEOGRAPHY NOT NULL, col1_3 BYTES[] NOT NULL, col1_4 DATE, col1_5 BYTES NOT NULL, col1_6 REGPROCEDURE NOT NULL, col1_7 GEOMETRY NOT NULL, col1_8 NAME NULL, col1_9 REGPROCEDURE NULL, col1_10 UUID NULL, col1_11 STRING NULL AS (lower(col1_8)) VIRTUAL, col1_12 STRING NULL AS (lower(CAST(col1_10 AS STRING))) STORED, col1_13 STRING NOT NULL AS (CASE WHEN col1_5 IS NULL THEN e'\x03I0Jl':::STRING ELSE e'\x06_\x06sv':::STRING END) STORED, UNIQUE (col1_9, col1_5 DESC) STORING (col1_1, col1_2, col1_4, col1_7, col1_10));
CREATE TABLE table2 (col2_0 FLOAT8 NOT NULL, col2_1 INT8 NOT NULL, col2_2 FLOAT8 NULL, col2_3 REGPROCEDURE NOT NULL, col2_4 VARCHAR NOT NULL, col2_5 REGPROCEDURE, col2_6 FLOAT8 NOT NULL, col2_7 TIMETZ NOT NULL, PRIMARY KEY (col2_6, col2_4 DESC, col2_0, col2_1), col2_8 FLOAT8 NULL AS ((col2_0 + col2_2) + col2_6) VIRTUAL, col2_9 FLOAT8 NULL AS (col2_0 + col2_6) STORED, col2_10 STRING AS (lower(CAST(col2_5 AS STRING))) STORED, col2_11 FLOAT8 NULL AS ((col2_0 + col2_6) + col2_2) STORED, UNIQUE (col2_10, col2_6 DESC, col2_8 DESC, col2_5 DESC) WHERE ((((((table2.col2_0 <= 1.0:::FLOAT8) AND (table2.col2_6 > 1.0:::FLOAT8)) OR (table2.col2_2 >= 0.0:::FLOAT8)) OR (table2.col2_4 != 'X':::STRING)) AND (table2.col2_1 >= (-9223372036854775807):::INT8)) OR (table2.col2_9 < 0.0:::FLOAT8)) AND (table2.col2_10 = e'\x00':::STRING), INDEX (col2_3 DESC, col2_10 DESC, col2_0 ASC, col2_4 DESC) STORING (col2_2, col2_7) WHERE (((((((((table2.col2_10 >= e'\'':::STRING) AND (table2.col2_9 >= (-1.0):::FLOAT8)) OR (table2.col2_2 <= 1.0:::FLOAT8)) AND (table2.col2_7 = '24:00:00-15:59:00':::TIMETZ)) AND (table2.col2_11 > '-Inf':::FLOAT8)) AND (table2.col2_8 >= 3.4028234663852886e+38:::FLOAT8)) AND (table2.col2_0 >= '+Inf':::FLOAT8)) AND (table2.col2_6 = (-1.0):::FLOAT8)) OR (table2.col2_4 = 'X':::STRING)) AND (table2.col2_1 > (-9223372036854775807):::INT8), INDEX (col2_1, col2_7 ASC, col2_8 DESC, col2_5 DESC, col2_4 ASC, col2_2 ASC, col2_0, col2_6 DESC) STORING (col2_9, col2_10), FAMILY (col2_6, col2_10), FAMILY (col2_11, col2_2), FAMILY (col2_9), FAMILY (col2_3, col2_7), FAMILY (col2_1), FAMILY (col2_5, col2_0, col2_4));
ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3277929, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 9000000}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5328991, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 9000000}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2050946, "histo_col_type": "", "name": "__auto__", "null_count": 7116731, "row_count": 9000000}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7274836, "histo_col_type": "REGPROCEDURE", "name": "__auto__", "null_count": 6204921, "row_count": 9000000}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1734571, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 9000000}, {"columns": ["col1_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 8470738, "histo_col_type": "", "name": "__auto__", "null_count": 6294699, "row_count": 9000000}, {"columns": ["col1_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2931994, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 9000000}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3266830, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 9000000}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7437274, "histo_col_type": "", "name": "__auto__", "null_count": 6750423, "row_count": 9000000}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5437448, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 9000000}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5830950, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 9000000}, {"columns": ["col1_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2044864, "histo_col_type": "", "name": "__auto__", "null_count": 2942511, "row_count": 9000000}, {"columns": ["col1_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 8499160, "histo_col_type": "", "name": "__auto__", "null_count": 3612036, "row_count": 9000000}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 613040, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 9000000}]':::JSONB;
ALTER TABLE table2 INJECT STATISTICS e'[{"columns": ["col2_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 330555682122928832, "histo_col_type": "", "name": "__auto__", "null_count": 260870655693461131, "row_count": 336631550824952337}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 295572634339899684, "histo_col_type": "", "name": "__auto__", "null_count": 244480087361697660, "row_count": 336631550824952337}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 174338679919570697, "histo_col_type": "INT8", "name": "__auto__", "null_count": 0, "row_count": 336631550824952337}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 278785437643602664, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 336631550824952337}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 12082241246177856, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 336631550824952337}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 222405840327533334, "histo_col_type": "", "name": "__auto__", "null_count": 175692268091261557, "row_count": 336631550824952337}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 207444722326317426, "histo_buckets": [{"distinct_range": 0, "num_eq": 0, "num_range": 0, "upper_bound": "-0.059542059827939364"}, {"distinct_range": 6586990040038054000, "num_eq": 6651816415957238333, "num_range": 6768977876879273360, "upper_bound": "0.16955397035648848"}, {"distinct_range": 0, "num_eq": 1000000000, "num_range": 80000000000, "upper_bound": "0.19744727259594708"}, {"distinct_range": 5000000000, "num_eq": 40000000000, "num_range": 5000000000, "upper_bound": "0.26174399278824"}], "histo_col_type": "FLOAT8", "name": "__auto__", "null_count": 0, "row_count": 336631550824952337}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 244587935543200698, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 336631550824952337}, {"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 305056746440384534, "histo_col_type": "", "name": "__auto__", "null_count": 193645780431934768, "row_count": 336631550824952337}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 221933571681908208, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 336631550824952337}, {"columns": ["col2_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 324215513717839974, "histo_buckets": [{"distinct_range": 0, "num_eq": 7560759875338218221, "num_range": 0, "upper_bound": "\\u0007"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 98378202666630488, "row_count": 336631550824952337}, {"columns": ["col2_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 238489677156360986, "histo_col_type": "", "name": "__auto__", "null_count": 184003991093697409, "row_count": 336631550824952337}]':::JSONB;
CREATE TYPE rand_typ_0 AS ENUM ('xjl', 'jfvz');
CREATE TYPE rand_typ_1 AS ENUM ('v', 'unm');
CREATE TYPE rand_typ_2 AS ENUM ('m', 'lsetcb', 'fyvl', 'vdfcdf');
;
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
SELECT
g::INT2 AS _int2,
g::INT4 AS _int4,
g::INT8 AS _int8,
g::FLOAT4 AS _float4,
g::FLOAT8 AS _float8,
'2001-01-01'::DATE + g AS _date,
'2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
'2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
g * '1 day'::INTERVAL AS _interval,
g % 2 = 1 AS _bool,
g::DECIMAL AS _decimal,
g::STRING AS _string,
g::STRING::BYTES AS _bytes,
substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
'0.0.0.0'::INET + g AS _inet,
g::STRING::JSONB AS _jsonb,
enum_range('hello'::greeting)[g] as _enum
FROM
generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);
;
rsg_test.go:584:
rsg_test.go:585: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith420482420
--- FAIL: TestRandomSyntaxSQLSmith (300.98s)
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-experience rafiss
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ 9a1a5eb4211dfcbe27b904fa895d570138a023ab:
Random syntax error:
rsg_test.go:763: Crash detected: server panic: pq: internal error: unexpected error from the vectorized engine: interface conversion: coldata.Column is coldata.Int64s, not coldata.Int16s
Query:
SELECT
tab_698278._int2 AS col_1525418,
tab_698278._timestamptz AS col_1525419,
tab_698278._bytes AS col_1525420,
CASE WHEN tab_698278._bool THEN tab_698279.col2_0 ELSE tab_698278._string END AS col_1525421,
'296c:63d5:10a4:703:189e:36a6:1c:21f3/92':::INET AS col_1525422,
tab_698279.col2_6 AS col_1525423,
1:::DECIMAL AS col_1525424,
NULL AS col_1525425,
tab_698278._int2 AS col_1525426
FROM
defaultdb.public.seed@[0] AS tab_698278 FULL JOIN defaultdb.public.table2@[0] AS tab_698279 ON true
WHERE
tab_698278._bool
ORDER BY
tab_698279.col2_4 ASC, tab_698278._string ASC, tab_698278._date DESC, tab_698278._decimal ASC
LIMIT
9:::INT8;
Schema:
rsg_test.go:580: To reproduce, use schema:
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
CREATE TABLE table1 (col1_0 GEOGRAPHY[], col1_1 GEOMETRY NOT NULL, INVERTED INDEX (col1_1 ASC), INVERTED INDEX (col1_0 DESC), INVERTED INDEX (col1_1), FAMILY (col1_1), FAMILY (col1_0));
CREATE TABLE table2 (col2_0 NAME NOT NULL, col2_1 INT2 NOT NULL, col2_2 DATE NULL, col2_3 REGTYPE NOT NULL, col2_4 REGTYPE, col2_5 FLOAT4 NOT NULL, PRIMARY KEY (col2_0, col2_5 ASC, col2_1 ASC), col2_6 INT2 NOT NULL AS (col2_1 + 127:::INT8) VIRTUAL, col2_7 STRING NULL AS (lower(CAST(col2_2 AS STRING))) VIRTUAL, INDEX (col2_1 ASC) WHERE (((((table2.col2_0 != e'\'':::STRING) OR (table2.col2_6 <= 0:::INT8)) AND (table2.col2_2 < '4714-11-24 BC':::DATE)) AND (table2.col2_5 > 0.0:::FLOAT8)) AND (table2.col2_7 < 'X':::STRING)) OR (table2.col2_1 >= 1:::INT8), INDEX (col2_3, col2_7, col2_1 DESC, col2_0 DESC, col2_4 DESC, col2_5 DESC, col2_6), INDEX (col2_5 DESC, col2_3 DESC, col2_4 DESC, col2_6, col2_2, col2_7 DESC, col2_1 DESC) WHERE (table2.col2_6 <= 32767:::INT8) OR (table2.col2_7 >= e'\x00':::STRING), UNIQUE (col2_6 ASC, col2_5 DESC, col2_4 DESC, col2_0 ASC, col2_1, col2_7 DESC) STORING (col2_3) WHERE ((table2.col2_6 != 127:::INT8) OR (table2.col2_1 < (-1):::INT8)) OR (table2.col2_0 = 'X':::STRING), INDEX (col2_6 ASC, col2_0, col2_3 DESC) STORING (col2_4) WHERE ((table2.col2_6 < (-1):::INT8) AND (table2.col2_7 >= '':::STRING)) AND (table2.col2_0 < 'X':::STRING), UNIQUE (col2_3, col2_6, col2_1 DESC, col2_4 ASC) STORING (col2_2), UNIQUE (col2_3 ASC, col2_2 DESC), UNIQUE (col2_3, col2_4 ASC, col2_6, col2_5, col2_2) WHERE (((table2.col2_6 >= (-128):::INT8) OR (table2.col2_1 > 127:::INT8)) AND (table2.col2_0 > '"':::STRING)) OR (table2.col2_5 <= (-1.0):::FLOAT8), UNIQUE (col2_1, col2_0 DESC, col2_2 ASC, col2_3 ASC, col2_6 DESC), FAMILY (col2_0), FAMILY (col2_1, col2_4, col2_2), FAMILY (col2_5, col2_3));
ALTER TABLE table1 INJECT STATISTICS e'[{"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4599834466705251494, "histo_buckets": [{"distinct_range": 0, "num_eq": 5000, "num_range": 0, "upper_bound": "\\\\x3d00000000000000000801120d010200ff00ff60e61000ff00ff00ff00ff00ff00ff18e6212082808080020001"}, {"distinct_range": 60000, "num_eq": 800000, "num_range": 60000, "upper_bound": "\\\\x3d00000000000000000801120d010300ff00ff60e61000ff00ff00ff00ff00ff00ff18e6212083808080020001"}, {"distinct_range": 0, "num_eq": 1555360898773772598, "num_range": 0, "upper_bound": "\\\\x3d1aaab4d2ad5352b3080112ee08010600ff00ffa0e61000ff00ff0500ff00ff00ff010300ff00ff800100ff00ff00ff0b00ff00ff00ff31889c0e3eff64c09483f6da3b1f3fc090e576b9778ae9c1cd82f9abe07853c03f84821e436246c09eff7f16c170f14104c5abae90204dc0edd92eb1bc7240c0a0adbc24cf44c241c80b36f4102530c084a0a978f93d53c09e21522a3442f5c1a013e3ef51461a4000ff91927286d1ee3ff8ef2da981effb413664859bb63c64405ed466ee34a151403475bd0484f2e2c1dab2c84c0a5266409e40f63ce04e5440e885eb80b212e141d02938b7c7a32e40b0b8d88b3e8b3b40c0127e2a250bbec1f0be13491fff5fc0648abf6b7bbc494054f71bad3923fd41d4f5f5bfe5f85ac0929a01a3df6c404088cd140a66f1e14131889c0e3eff64c09483f6da3b1f3fc090e576b9778ae9c1010300ff00ff800100ff00ff00ff0600ff00ff00ffd7bd5a1e976b54c05c68b819da3240c0b0187fbe98a1f6c1cc7049f7f08f4940ba2fa9b6cd9d47c016ea1cd6d2a3f0c1ede5cd99570c52c07005cbbb2ddc32c02880961665fee9c14ae64fdc2db45ec0b0b7646dd23427c0a0ac3d4c3048e141dbcdfd8c1ea45ec07cf94293ab2238c05c75eab05899fbc1d7bd5a1e976b54c05c68b819da3240c0b0187fbe98a1f6c1010300ff00ff800100ff00ff00ff0600ff00ff00ff20a35000ff957919406a82c2064cee49c06c43fe12e67be941a49a8476130f5d405403ebd4ba3146c0ce6dc483c45af1415a65699fd38d624040a9ccfb8ecb3940d0f51a8b5514ff41bc6aa2e82b255140409ae319fe50f6bf9fa543fbeb61f3c107ecf8f917d452c0d0ccf6781a9e1c403c4fbeefb890f94120a35000ff957919406a82c2064cee49c06c43fe12e67be941010300ff00ff800100ff00ff00ff0900ff00ff00ff88ad917382cb65c020f72139cb4e4bc0945f576c6ce8f94120da064c3efb60c094649f1b7bc04bc0800d753c6ea6d14100fff0bb2f553263c070a4ff0b0ff350c02ba4c6fd3eea00ffc20e8679c6e6ef4dc00d469d08c5f44dc0011a7a6e047ef0c17450a726bba655409ecd3111bf9455c03a0e46fcce14fbc170f8100f4c2138c028558736e03729c084ad292ca906fc413ca07039a95248c040f01e6e08d9f13f4cd2f365db9afdc1355a0c03767258c0108defa8e4ef4d4004ac71b03dc6e84188ad917382cb65c020f72139cb4e4bc0945f576c6ce8f941010300ff00ff800100ff00ff00ff0c00ff00ff00ffedbc21b87b2f61c03dabba024eb546c030f6a43ffb7ee1c186c9bdf7a21150c04aebde89ae9b4ec080d576a57850b1c1e4a04f9348bf6040dca9a3ef22f846c064a5ed34274c0142b06c8f68ad1c644078693d7073c62dc02e57495f0238e7c1a89f0c7bcfc85340a0e6cfae411f19c0782f9583e380e0c1b4849f3663414040a05f8512417917c0f4c51c0eeb380242c0c31e2a019504c008f149300a57224010ed40dc7e31ca41e0a0f2df98411dc0a8df2349c7f93f40c878a02620a9d9c1106503ee6d7625c0a0bada5159d21c4046d83846fd52fec133d3a44f4e865dc0886498b67a4343403afefb025ca5f0c178d93767b07f63c060a11c4b27c90ec0189b85e64061e1c1edbc21b87b2f61c03dabba024eb546c030f6a43ffb7ee1c118e6212086808080042a2409182d4454fb2109c011182d4454fb21094019952e0a6a379df8bf215dd1915f0479f83f0001"}, {"distinct_range": 8646628056784028000, "num_eq": 50000, "num_range": 8646628056784027331, "upper_bound": "\\\\x3d29fc212e588ceb250801126d010200ff00ff60e61000ff00ff0400ff00ff00ff80818ed3b02250400b185c9e8d2847c08e885a04236af441fe749eff05b16340e3645e1d420b52c0c0e977313614b8c1e08fdc9786c6534063621eb47a0e45c08cb2c612cd1ff241dcff7c126dd95340786f1ded742226c07363ea32f3ddfec118e6212082808080022a24090b28c49c0606f23f119c547391e0fe054019c4ccc5a39a79f4bf21fbc7e6307eb9c8bf0001"}, {"distinct_range": 27.27791342458372, "num_eq": 700000, "num_range": 600, "upper_bound": "\\\\x3d364077316c885d5508011219010100ff00ff20e61000ff00ff506c149114805a408833bfffcc65434018e62120012a2409815ffff5e399fd3f11815ffff5e399fd3f197762134bdaaae53f217762134bdaaae53f0001"}, {"distinct_range": 3459619547770577400, "num_eq": 500, "num_range": 3916274882876263567, "upper_bound": "\\\\x3d3c91aecc15f894fb080112ad02010200ff00ffe0e61000ff00ff0900ff00ff00ff14d0865223d85a40ae996a2b612452c0be1e54e642a9f0c1b0c8d71de199dac1b4410377020c5c4056b664afc27048c0e0799a63c927ee417cd2dd1ddddefd414a7bfd9f00ff286540328f149ba98c44c0a2f8598a2c40f2c120f963e4f31dff41a2bd6d6100ff7b64407401280c0a764240e8f16d830257f941fecb68dede17f141f84d6f843d5a5a4038a72e4a4fb23e40568786d6ff9afac1711d5c4f5137f2c18ca332f555025e40e0a17b62424a4b40fc74c882c0b2f8c1c83890790b7df941dca7e7ad0e666240fc49ff4269585540bc2376ad992dfe41a0229e2a76c8d741e8bd86fadb9b5640362aaaf111805440c82e3b7136b1e5c1c0b40caa6432ea418c9a2de9772b45c0aecc236b8e785140ca8e9fff24cef041041adf14353cf9c118e6212082808080062a2409dc68f4b39aa5e7bf11152f5898bba10740198a83a55fd243f4bf2162b0be4593dbf73f0001"}, {"distinct_range": 2891905.782431364, "num_eq": 6721896054545601214, "num_range": 6000000, "upper_bound": "\\\\x3d8c21f77a18fd289108011219010100ff00ff20e61000ff00ff97cc2ce63e7a50c0c0392477b7f52d4018e62120012a24090faa355fd367f2bf110faa355fd367f2bf1964214cef93bbd03f2164214cef93bbd03f0001"}, {"distinct_range": 0, "num_eq": 30, "num_range": 800, "upper_bound": "\\\\x3d9142788be637c03108011221010100ff00ff60e61000ff00ff9a3193da22d551c050a1730ee0732fc03466b3e666c3f6c118e6212081808080022a2409ee5865574eebf3bf11ee5865574eebf3bf19db1418f60391d1bf21db1418f60391d1bf0001"}, {"distinct_range": 95611.37101299394, "num_eq": 5384116180024558072, "num_range": 900000, "upper_bound": "\\\\x3db8f450ba3dc65e730801128901010300ff00ffa0e61000ff00ff0100ff00ff00ff0500ff00ff00ffc864d986203d3ac0e19085928b2355c000ffb5829e7f21c1c1decd4568b4386240c86d0e18dc3025c064bb125c1aae00ff4280185491b5b912c0cc955285936934c03896554338fbf8c17b194c9608b965c09c4e9e70f74a3fc0c8a9e7080c64e441c864d986203d3ac0e19085928b2355c000ffb5829e7f21c1c118e6212083808080042a2409f6d146edbb4308c0111cf82872865a04401958c8e261aaecf8bf2106a6dd61a0abc7bf0001"}, {"distinct_range": 0, "num_eq": 40000, "num_range": 1970701433724789488, "upper_bound": "\\\\x43"}], "histo_col_type": "BYTES", "name": "__auto__", "null_count": 3007231066670323522, "row_count": 6108993656386915423}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1377783133218093041, "histo_buckets": [{"distinct_range": 0, "num_eq": 30000000000, "num_range": 0, "upper_bound": "\\\\x42fd0a4000000000000000c1f0b89e02f9d77ac1d85fed9f3441fc41f5b973e1110232420200243e142b2c"}, {"distinct_range": 0, "num_eq": 0, "num_range": 2149329546377735735, "upper_bound": "\\\\x42fd0bc000000000000000c1f0b89e02f9d77ac1d85fed9f3441fc41f5b973e1110232420200243e142b2c"}, {"distinct_range": 1924402140004435700, "num_eq": 10000000000, "num_range": 1924402140004435720, "upper_bound": "\\\\x42fd0c4000000000000000c1f0b89e02f9d77ac1d85fed9f3441fc41f5b973e1110232420200243e142b2c"}, {"distinct_range": 434779386171133100, "num_eq": 4984857605467172439, "num_range": 3224701363855406171, "upper_bound": "\\\\x42fd0dc000000000000000c1f0b89e02f9d77ac1d85fed9f3441fc41f5b973e1110232420200243e142b2c"}, {"distinct_range": 5758596956984278000, "num_eq": 20, "num_range": 7585911147244116736, "upper_bound": "\\\\x42fd100000000000000000c201081d0fcba40ac200241cb23af2d84200b7ac47ad727842026663df9056c6"}, {"distinct_range": 0, "num_eq": 7753122773077506113, "num_range": 0, "upper_bound": "\\\\x42fd100000000000000000c2026314b1dec3bbc1ffc5c9dab4b22641ff55a9bb2ec5f0420229bfb62ed46c"}, {"distinct_range": 466614810728687550, "num_eq": 70, "num_range": 466614810728687535, "upper_bound": "\\\\x42fdffffffffffffffff00c1f0b89e02f9d77ac1d85fed9f3441fc41f5b973e1110232420200243e142b2c"}, {"distinct_range": 56.41079730369929, "num_eq": 4000000, "num_range": 70, "upper_bound": "\\\\x42fdffffffffffffffff00c201081d0fcba40ac200241cb23af2d84200b7ac47ad727842026663df9056c6"}, {"distinct_range": 0, "num_eq": 3000, "num_range": 2809178541990701231, "upper_bound": "\\\\x42fdffffffffffffffff00c2026314b1dec3bbc1ffc5c9dab4b22641ff55a9bb2ec5f0420229bfb62ed46c"}, {"distinct_range": 1000, "num_eq": 5575265777065482870, "num_range": 1000, "upper_bound": "\\\\x42fdffffffffffffffff0141fd8db7ac34678841f9f031d69c7158"}], "histo_col_type": "BYTES", "name": "__auto__", "null_count": 0, "row_count": 6108993656386915423}]':::JSONB;
ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 28510642709, "histo_col_type": "", "name": "__auto__", "null_count": 23003236003, "row_count": 30000000000}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 17211583933, "histo_col_type": "FLOAT4", "name": "__auto__", "null_count": 0, "row_count": 30000000000}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 26389481639, "histo_buckets": [{"distinct_range": 0, "num_eq": 4093321009025314059, "num_range": 0, "upper_bound": "-12103"}, {"distinct_range": 228958329789449730, "num_eq": 1886335855158773196, "num_range": 228958329789449712, "upper_bound": "-11799"}, {"distinct_range": 0, "num_eq": 20000000000, "num_range": 5043189043733759583, "upper_bound": "-128"}, {"distinct_range": 297.2462253588027, "num_eq": 8161685155111463769, "num_range": 800, "upper_bound": "1"}, {"distinct_range": 0, "num_eq": 700000000, "num_range": 600000000, "upper_bound": "953"}, {"distinct_range": 0, "num_eq": 8742591655215430709, "num_range": 6130644711447352502, "upper_bound": "23367"}, {"distinct_range": 158792.4112516852, "num_eq": 1000000, "num_range": 200000, "upper_bound": "23887"}, {"distinct_range": 0, "num_eq": 2095233438140903651, "num_range": 50000000, "upper_bound": "31435"}], "histo_col_type": "INT2", "name": "__auto__", "null_count": 0, "row_count": 30000000000}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5513471263, "histo_col_type": "", "name": "__auto__", "null_count": 7786444190, "row_count": 30000000000}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 9772305880, "histo_col_type": "NAME", "name": "__auto__", "null_count": 0, "row_count": 30000000000}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1748072384, "histo_buckets": [{"distinct_range": 0, "num_eq": 58242847860599174, "num_range": 0, "upper_bound": "-31461"}, {"distinct_range": 0, "num_eq": 100, "num_range": 8458244408099745195, "upper_bound": "2394"}], "histo_col_type": "INT2", "name": "__auto__", "null_count": 0, "row_count": 30000000000}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 26097551121, "histo_col_type": "", "name": "__auto__", "null_count": 10104740832, "row_count": 30000000000}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 10559656462, "histo_buckets": [{"distinct_range": 0, "num_eq": 500000, "num_range": 0, "upper_bound": "317258020"}, {"distinct_range": 246327213322509570, "num_eq": 10, "num_range": 298080255863133532, "upper_bound": "432303532"}, {"distinct_range": 671.9034802646621, "num_eq": 600000000, "num_range": 1000, "upper_bound": "732159810"}, {"distinct_range": 10000000, "num_eq": 10000, "num_range": 10000000, "upper_bound": "1414654332"}], "histo_col_type": "REGTYPE", "name": "__auto__", "null_count": 0, "row_count": 30000000000}]':::JSONB;
CREATE TYPE rand_typ_0 AS ENUM ('ehpoos', 'stojg', 'v');
CREATE TYPE rand_typ_1 AS ENUM ('vylad');
CREATE TYPE rand_typ_2 AS ENUM ('qtd', 'nvebj', 'z', 'hj', 'fqn');
CREATE TYPE rand_typ_3 AS ENUM ('r');
;
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
SELECT
g::INT2 AS _int2,
g::INT4 AS _int4,
g::INT8 AS _int8,
g::FLOAT4 AS _float4,
g::FLOAT8 AS _float8,
'2001-01-01'::DATE + g AS _date,
'2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
'2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
g * '1 day'::INTERVAL AS _interval,
g % 2 = 1 AS _bool,
g::DECIMAL AS _decimal,
g::STRING AS _string,
g::STRING::BYTES AS _bytes,
substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
'0.0.0.0'::INET + g AS _inet,
g::STRING::JSONB AS _jsonb,
enum_range('hello'::greeting)[g] as _enum
FROM
generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);
;
rsg_test.go:584:
rsg_test.go:585: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith576544196
--- FAIL: TestRandomSyntaxSQLSmith (300.90s)
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-experience rafiss
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ 894a486398f12dc92b2f4af8c6acac4406b0d031:
Random syntax error:
rsg_test.go:763: Crash detected: server panic: pq: internal error: unexpected error from the vectorized engine: interface conversion: coldata.Column is coldata.Int64s, not coldata.Int16s
Query:
SELECT
st_zmflag('01040000C000000000':::GEOMETRY::GEOMETRY)::INT2 AS col_1256426,
tab_515056.tableoid AS col_1256427,
(tab_515056._inet::INET >> tab_515056._inet::INET)::BOOL AS col_1256428,
(
SELECT
tab_515057.col1_3 AS col_1256429
FROM
defaultdb.public.table1@[0] AS tab_515057
ORDER BY
tab_515057.col1_10 DESC, tab_515057.crdb_internal_mvcc_timestamp ASC
LIMIT
1:::INT8
)
AS col_1256430,
NULL AS col_1256431,
tab_515056._timestamptz AS col_1256432,
tab_515056._inet AS col_1256433,
'\x82':::BYTES AS col_1256435,
tab_515056._string AS col_1256436,
tab_515056._int2 AS col_1256437,
e'[{" J,_m{D\'zND": "c"}, [[null], {"3\'eX)pVdG": [{"foo": [0.1280773978715471]}], "b": true, "c": [], "foo": [{}]}], {}]':::JSONB
AS col_1256438,
age(NULL::TIMESTAMPTZ, '1995-06-30 04:57:32.000294+00:00':::TIMESTAMPTZ::TIMESTAMPTZ)::INTERVAL AS col_1256439,
tab_515056._date AS col_1256440,
tab_515056._uuid AS col_1256441,
'1977-01-21 21:34:33.000064':::TIMESTAMP AS col_1256442
FROM
defaultdb.public.seed@[0] AS tab_515056
ORDER BY
tab_515056._int4 DESC;
Schema:
rsg_test.go:580: To reproduce, use schema:
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
CREATE TABLE table1 (col1_0 REGPROC, col1_1 BIT(41) NOT NULL, col1_2 UUID NOT NULL, col1_3 FLOAT8 NOT NULL, col1_4 VARCHAR NOT NULL, col1_5 INET NULL, col1_6 TIME[], col1_7 BYTES NOT NULL, col1_8 TIMETZ NOT NULL, col1_9 BIT(4) NOT NULL, col1_10 TIMETZ, col1_11 "char" NOT NULL, col1_12 BOX2D, col1_13 FLOAT4 NULL, col1_14 INET NULL, col1_15 GEOGRAPHY, UNIQUE (col1_2 ASC, col1_1 DESC) STORING (col1_3, col1_4, col1_6, col1_8, col1_9, col1_13, col1_14) WHERE ((((((table1.col1_8 <= '24:00:00-15:59:00':::TIMETZ) OR (table1.col1_7 >= '\x27':::BYTES)) OR (table1.col1_4 <= '"':::STRING)) AND (table1.col1_11 <= e'\U00002603':::STRING)) OR (table1.col1_3 = (-1.0):::FLOAT8)) AND (table1.col1_10 > '24:00:00-15:59:00':::TIMETZ)) OR (table1.col1_13 = 0.0:::FLOAT8), INVERTED INDEX (col1_10 DESC, col1_7 DESC, col1_11, col1_9 DESC, col1_1, col1_2, col1_8, col1_0 ASC, col1_12 ASC, col1_15 DESC), INDEX (col1_5 DESC) STORING (col1_0, col1_2, col1_3, col1_7, col1_9, col1_10, col1_12, col1_13, col1_15) WHERE ((((((table1.col1_7 <= '\x58':::BYTES) AND (table1.col1_4 = e'\U00002603':::STRING)) OR (table1.col1_3 <= (-1.0):::FLOAT8)) AND (table1.col1_13 = 0.0:::FLOAT8)) AND (table1.col1_8 = '00:00:00+15:59:00':::TIMETZ)) OR (table1.col1_10 = '24:00:00-15:59:00':::TIMETZ)) AND (table1.col1_11 = e'\U00002603':::STRING));
CREATE TABLE table2 (col2_0 DECIMAL NOT NULL, col2_1 REGCLASS NULL, col2_2 INT4, col2_3 CHAR NOT NULL, col2_4 JSONB NULL, col2_5 VARCHAR, col2_6 JSONB NULL, col2_7 GEOGRAPHY NULL, col2_8 REGPROC, col2_9 BYTES, col2_10 INTERVAL NOT NULL, col2_11 INT4, col2_12 INTERVAL, col2_13 INT4 AS (col2_2 + col2_11) VIRTUAL, col2_14 INT4 AS (col2_2 + col2_11) STORED, col2_15 STRING NULL AS (lower(CAST(col2_6 AS STRING))) VIRTUAL, col2_16 INT4 AS (col2_11 + (-1741161357):::INT8) STORED, col2_17 STRING NOT NULL AS (lower(CAST(col2_10 AS STRING))) STORED, INDEX (col2_11 DESC), UNIQUE (col2_16 ASC) STORING (col2_6, col2_14), FAMILY (col2_0), FAMILY (col2_12), FAMILY (col2_8), FAMILY (col2_16), FAMILY (col2_9), FAMILY (col2_14, col2_7), FAMILY (col2_2), FAMILY (col2_4, col2_3, col2_5, col2_10), FAMILY (col2_6, col2_1), FAMILY (col2_11, col2_17));
ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1539518509314350756, "histo_buckets": [{"distinct_range": 0, "num_eq": 20, "num_range": 0, "upper_bound": "00:00:00+15:59:00"}, {"distinct_range": 0, "num_eq": 8451830325785042431, "num_range": 998666460096653838, "upper_bound": "04:23:03.186012+08:50:00"}, {"distinct_range": 26048.196822881946, "num_eq": 60000000000, "num_range": 30000, "upper_bound": "10:24:40.079454+08:15:00"}, {"distinct_range": 0, "num_eq": 7274078967715076668, "num_range": 8000000000, "upper_bound": "10:06:01.882437+04:44:00"}, {"distinct_range": 700000000, "num_eq": 4368693053076045286, "num_range": 700000000, "upper_bound": "12:12:43.050137+00:21:00"}, {"distinct_range": 20000000, "num_eq": 10000000000, "num_range": 20000000, "upper_bound": "21:19:48.688696+07:25:00"}, {"distinct_range": 0, "num_eq": 40000, "num_range": 1000, "upper_bound": "18:46:57.687306+02:42:00"}, {"distinct_range": 2978541996387554300, "num_eq": 50000000000, "num_range": 7310057883774590015, "upper_bound": "24:00:00-15:59:00"}], "histo_col_type": "TIMETZ", "name": "__auto__", "null_count": 1710410776895891766, "row_count": 1786135884262323321}, {"columns": ["col1_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 100593404320675623, "histo_col_type": "", "name": "__auto__", "null_count": 402210955569862069, "row_count": 1786135884262323321}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1023682682398666814, "histo_col_type": "", "name": "__auto__", "null_count": 1281230937192933472, "row_count": 1786135884262323321}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 588952275127143916, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1786135884262323321}, {"columns": ["col1_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1506717121150525603, "histo_col_type": "", "name": "__auto__", "null_count": 71339945577407114, "row_count": 1786135884262323321}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 399392852420091590, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1786135884262323321}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1428193888772890124, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1786135884262323321}, {"columns": ["col1_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 473685667822017172, "histo_col_type": "", "name": "__auto__", "null_count": 526982870718148515, "row_count": 1786135884262323321}, {"columns": ["col1_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 508801282419237617, "histo_col_type": "", "name": "__auto__", "null_count": 1522420836593746728, "row_count": 1786135884262323321}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 680267932518668729, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1786135884262323321}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 479360366705803024, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1786135884262323321}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 746160945850163244, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1786135884262323321}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1419106319937482330, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1786135884262323321}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1630173938508462681, "histo_col_type": "", "name": "__auto__", "null_count": 1655942766586158282, "row_count": 1786135884262323321}, {"columns": ["col1_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1622945185286786030, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1786135884262323321}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 589604042660340791, "histo_col_type": "", "name": "__auto__", "null_count": 1544712559098753019, "row_count": 1786135884262323321}]':::JSONB;
ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6857, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 30000}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 13377, "histo_col_type": "", "name": "__auto__", "null_count": 10218, "row_count": 30000}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3860, "histo_col_type": "", "name": "__auto__", "null_count": 11437, "row_count": 30000}, {"columns": ["col2_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 10940, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 30000}, {"columns": ["col2_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5446, "histo_col_type": "", "name": "__auto__", "null_count": 23665, "row_count": 30000}, {"columns": ["col2_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 19888, "histo_col_type": "", "name": "__auto__", "null_count": 16629, "row_count": 30000}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 10824, "histo_col_type": "", "name": "__auto__", "null_count": 16379, "row_count": 30000}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 13148, "histo_col_type": "", "name": "__auto__", "null_count": 9263, "row_count": 30000}, {"columns": ["col2_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 16720, "histo_col_type": "", "name": "__auto__", "null_count": 6186, "row_count": 30000}, {"columns": ["col2_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4564, "histo_col_type": "", "name": "__auto__", "null_count": 24983, "row_count": 30000}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 15055, "histo_col_type": "", "name": "__auto__", "null_count": 5739, "row_count": 30000}, {"columns": ["col2_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 19942, "histo_col_type": "", "name": "__auto__", "null_count": 11396, "row_count": 30000}, {"columns": ["col2_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 25547, "histo_col_type": "", "name": "__auto__", "null_count": 21848, "row_count": 30000}, {"columns": ["col2_16"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 19115, "histo_col_type": "", "name": "__auto__", "null_count": 27516, "row_count": 30000}, {"columns": ["col2_17"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 23816, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 30000}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 16824, "histo_col_type": "", "name": "__auto__", "null_count": 27683, "row_count": 30000}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3946, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 30000}, {"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1551, "histo_col_type": "", "name": "__auto__", "null_count": 3904, "row_count": 30000}]':::JSONB;
CREATE TYPE rand_typ_0 AS ENUM ('k', 'kn', 'imcli', 'xfslj');
CREATE TYPE rand_typ_1 AS ENUM ('k', 'dvxz');
CREATE TYPE rand_typ_2 AS ENUM ('dxfe', 'ce', 'bbou');
CREATE TYPE rand_typ_3 AS ENUM ('uul', 'go', 'hj', 'zlvir');
;
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
SELECT
g::INT2 AS _int2,
g::INT4 AS _int4,
g::INT8 AS _int8,
g::FLOAT4 AS _float4,
g::FLOAT8 AS _float8,
'2001-01-01'::DATE + g AS _date,
'2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
'2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
g * '1 day'::INTERVAL AS _interval,
g % 2 = 1 AS _bool,
g::DECIMAL AS _decimal,
g::STRING AS _string,
g::STRING::BYTES AS _bytes,
substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
'0.0.0.0'::INET + g AS _inet,
g::STRING::JSONB AS _jsonb,
enum_range('hello'::greeting)[g] as _enum
FROM
generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);
;
rsg_test.go:584:
rsg_test.go:585: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith682692827
--- FAIL: TestRandomSyntaxSQLSmith (325.04s)
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-experience rafiss
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ ecf3f618dc42b025f542aeec89bb0630a3f36fcd:
sync.(*WaitGroup).Wait(0xc0074dc158)
/usr/local/go/src/sync/waitgroup.go:130 +0x65
golang.org/x/sync/errgroup.(*Group).Wait(0xc0074dc150, 0x0, 0x0)
/go/src/github.com/cockroachdb/cockroach/vendor/golang.org/x/sync/errgroup/errgroup.go:40 +0x31
github.com/cockroachdb/cockroach/pkg/util/ctxgroup.Group.Wait(0xc0074dc150, 0x5ee98a0, 0xc033bc0000, 0xc0013b80c0, 0xc033bc0000)
/go/src/github.com/cockroachdb/cockroach/pkg/util/ctxgroup/ctxgroup.go:142 +0x57
github.com/cockroachdb/cockroach/pkg/kv/kvclient/kvcoord.(*DistSender).RangeFeed(0xc033738c00, 0x5ee9960, 0xc0074dc0f0, 0xc00f96f298, 0x1, 0x8, 0xc00f96f2d0, 0x1, 0x1, 0x1687224a1519a237, ...)
/go/src/github.com/cockroachdb/cockroach/pkg/kv/kvclient/kvcoord/dist_sender_rangefeed.go:83 +0x3c7
github.com/cockroachdb/cockroach/pkg/kv/kvclient/rangefeed.(*dbAdapter).RangeFeed(0xc0170f9620, 0x5ee98a0, 0xc02f98e980, 0xc00f96f298, 0x1, 0x8, 0xc00f96f2d0, 0x1, 0x1, 0x1687224a1519a237, ...)
/go/src/github.com/cockroachdb/cockroach/pkg/kv/kvclient/rangefeed/db_adapter.go:69 +0xb4
github.com/cockroachdb/cockroach/pkg/kv/kvclient/rangefeed.(*RangeFeed).run.func1(0x5ee98a0, 0xc02f98e980)
/go/src/github.com/cockroachdb/cockroach/pkg/kv/kvclient/rangefeed/rangefeed.go:218 +0xe3
github.com/cockroachdb/cockroach/pkg/util/stop.(*Stopper).RunAsyncTask.func1(0xc028b40280, 0x5ee98a0, 0xc02f98e980, 0x0, 0xc0074dc0c0)
/go/src/github.com/cockroachdb/cockroach/pkg/util/stop/stopper.go:347 +0xb9
created by github.com/cockroachdb/cockroach/pkg/util/stop.(*Stopper).RunAsyncTask
/go/src/github.com/cockroachdb/cockroach/pkg/util/stop/stopper.go:342 +0xfc
goroutine 9296263 [select]:
github.com/cockroachdb/cockroach/pkg/rpc.respStreamClientAdapter.recvInternal(0x5ee98a0, 0xc034ae9e40, 0xc0190056e0, 0xc019005740, 0x2, 0xc00443949c, 0x2, 0x2)
/go/src/github.com/cockroachdb/cockroach/pkg/rpc/context.go:518 +0xd6
github.com/cockroachdb/cockroach/pkg/rpc.rangeFeedClientAdapter.Recv(...)
/go/src/github.com/cockroachdb/cockroach/pkg/rpc/context.go:547
github.com/cockroachdb/cockroach/pkg/kv/kvclient/kvcoord.(*DistSender).singleRangeFeed(0xc033738c00, 0x5ee98a0, 0xc033bc0000, 0xc00f96f298, 0x1, 0x8, 0xc00f96f2d0, 0x1, 0x1, 0x1687224a1519a237, ...)
/go/src/github.com/cockroachdb/cockroach/pkg/kv/kvclient/kvcoord/dist_sender_rangefeed.go:269 +0x91e
github.com/cockroachdb/cockroach/pkg/kv/kvclient/kvcoord.(*DistSender).partialRangeFeed(0xc033738c00, 0x5ee98a0, 0xc033bc0000, 0xc0046d6c60, 0x0, 0xc0013b8060, 0xc017e66060, 0x0, 0x0)
/go/src/github.com/cockroachdb/cockroach/pkg/kv/kvclient/kvcoord/dist_sender_rangefeed.go:151 +0x370
github.com/cockroachdb/cockroach/pkg/kv/kvclient/kvcoord.(*DistSender).RangeFeed.func1.1(0x5ee98a0, 0xc033bc0000, 0xc028b40280, 0x700000005726380)
/go/src/github.com/cockroachdb/cockroach/pkg/kv/kvclient/kvcoord/dist_sender_rangefeed.go:70 +0x65
github.com/cockroachdb/cockroach/pkg/util/ctxgroup.Group.GoCtx.func1(0xc028b40280, 0x5726380)
/go/src/github.com/cockroachdb/cockroach/pkg/util/ctxgroup/ctxgroup.go:166 +0x3a
golang.org/x/sync/errgroup.(*Group).Go.func1(0xc0074dc150, 0xc02f3407b0)
/go/src/github.com/cockroachdb/cockroach/vendor/golang.org/x/sync/errgroup/errgroup.go:57 +0x59
created by golang.org/x/sync/errgroup.(*Group).Go
/go/src/github.com/cockroachdb/cockroach/vendor/golang.org/x/sync/errgroup/errgroup.go:54 +0x66
goroutine 9295426 [select]:
github.com/cockroachdb/cockroach/pkg/server.(*Node).startGossiping.func1(0x5ee9960, 0xc019d76b40)
/go/src/github.com/cockroachdb/cockroach/pkg/server/node.go:629 +0x207
github.com/cockroachdb/cockroach/pkg/util/stop.(*Stopper).RunAsyncTask.func1(0xc028b40280, 0x5ee9960, 0xc019d76b40, 0x0, 0xc0143a5c40)
/go/src/github.com/cockroachdb/cockroach/pkg/util/stop/stopper.go:347 +0xb9
created by github.com/cockroachdb/cockroach/pkg/util/stop.(*Stopper).RunAsyncTask
/go/src/github.com/cockroachdb/cockroach/pkg/util/stop/stopper.go:342 +0xfc
goroutine 9295169 [select]:
github.com/cockroachdb/cockroach/pkg/internal/client/requestbatcher.(*RequestBatcher).run(0xc00744e120, 0x5ee98e0, 0xc000074120)
/go/src/github.com/cockroachdb/cockroach/pkg/internal/client/requestbatcher/batcher.go:466 +0x370
github.com/cockroachdb/cockroach/pkg/util/stop.(*Stopper).RunAsyncTask.func1(0xc028b40280, 0x5ee98e0, 0xc000074120, 0x0, 0xc00a5ea470)
/go/src/github.com/cockroachdb/cockroach/pkg/util/stop/stopper.go:347 +0xb9
created by github.com/cockroachdb/cockroach/pkg/util/stop.(*Stopper).RunAsyncTask
/go/src/github.com/cockroachdb/cockroach/pkg/util/stop/stopper.go:342 +0xfc
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-experience rafiss
the last one is just a large operation:
SELECT st_buffer('0105000060E610000009000000010200004005000000F844BE5674524D40276F2A9AD9C054C060B19118FE3FEB4130B504B5EE3B57405FDBAAD7254B50C040991E02A964C8C1A8E920931DCC5D405E5E7BC6E37C4EC060E19FFD9695B4C138E2737899CF6240E8088E34E4B63140E88B742D0C82E941349F223276536640B0CD99B496BA41407AAB7F5371650142010200004003000000D029F015C45D21C03A9D33B5C7A24EC02C3B89946B0BF441606DEAB490322D4086D6E2F29F4B4FC0EE21667F9FB1EAC1587CCC51991D5440C601FE52ADA754C0E22833A3285FF14101020000400800000008366ABABCD35340787258DCA18355C0349A7E102386E541F4D4B008A9F3544050DBDE792D1126C0A8BFE5004AE4D5419002F5BA56AE2F40F6462FE1547650400036B5A90AB69A4178FD401B523043C004138FDD0DAC51403082285ED05EE8418AE9D276FE864DC0D03EA943E3DE444048E6AC68B85DE74100B0B6695F5063C0A01ACED4B1F42D408469E2407130EC4171166C427BA565C038EFE01AE181274080CA15EA6B3CFAC1B830478652C365C080CE271FB4AEE43FB35C3DA5958502C2010200004002000000309B366B6C0F56406010AB4CABF712404873685FC57FFB4146252522E28E52C0009FD911977A1BC089ED194652EFF4C10102000040030000007686960EDC2A62C098EBCC5C8A4434C0BCD4FC82FCC4E0411EB47C67FA0B51408946E73BEE1855C0CDAEA074BCFE00C2B8B172631C23564009B788A7A93547C0386B88177BC3D2C1010200004004000000B2CEF125D89355C029C6DF5DFE9452C0B474B25C5D16FD41FC9AA25DC48A6240806B5AD4581B2840E693A536339900C2C0E1A17E770147C08002170C6CD5E63FFC2C081F2336F54190439D7641964BC058C891699E6D2BC008AD4F9A4B12F141010200004002000000B0B0B7383B6E54401C30CB00D05C444023CCB43D7F7CF8C1B8CC0AE1A0C14DC04837DBDC12AA3E4042C3CA230344F5C101020000400400000080A5100CF4FF55408E4B9CBEA0874140547CB8DFFFBCE0C11CF48F77F1604AC0C842A4CE8C733640285360C7AEB7D341F7C1C90CF96B55C024CD130237FD3B400031192C101CE1C1C7C238986FE560C01897907F29244E4016F99E4CA478F941010200004005000000921B0F905168524050A7ADCF512A5340F842322D1CF1F0C1E0D1A1F2AE8514C0B05220DDDC444B40B20911474C12F6415C2CC3E717C144C0CC5791431F6949400008EF2DB56EE4412C494CE439A55CC078B38CB75E075440B6AF9E036B27F44182F9B1A0B9695EC0B6390844CB25544038BC58E9C6FAF1C1':::GEOGRAPHY, 3.4028234663852886e+38:::FLOAT8, 32767:::INT8) ;
i don't think there's a feasible way of "rate limiting" this...
Collecting some of the other failures:
server panic: pq: internal error: unexpected error from the vectorized engine: interface conversion: coldata.Column is coldata.Int64s, not coldata.Int16s
server panic: pq: internal error: unexpectedly found decreasing offsets: [0 1 2 3 4 0 0]
runtime error: invalid memory address or nil pointer dereference
github.com/cockroachdb/cockroach/pkg/sql/colexec.(*Materializer).close
/go/src/github.com/cockroachdb/cockroach/pkg/sql/colexec/materializer.go:312
haven't been able to repro those on my own but they seem @cockroachdb/sql-queries related.
server panic: pq: internal error: unexpected error from the vectorized engine: interface conversion: coldata.Column is coldata.Int64s, not coldata.Int16s
is tracked in #66306.
server panic: pq: internal error: unexpectedly found decreasing offsets: [0 1 2 3 4 0 0]
I remember I tried to repro this problem in this issue but couldn't. It'd be great if we had a repro.
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ 0a61eb767e9d02a01fbbd3c8fd0ebcb7388c3acd:
Random syntax error:
rsg_test.go:763: Crash detected: server panic: pq: internal error: unexpectedly found decreasing offsets: [0 0 0 0 0 0 0 0 1 0 0 0 0]
Query:
WITH
with_17777 (col_92528)
AS (SELECT * FROM (VALUES (NULL), ((-0.5478081703186035):::FLOAT8)) AS tab_43905 (col_92528)),
with_17778 (col_92529)
AS (
SELECT
*
FROM
(VALUES (('\xda3e6217cd84':::BYTES::BYTES || ARRAY['\x':::BYTES]::BYTES[])::BYTES[]), (NULL))
AS tab_43906 (col_92529)
)
SELECT
tab_43907._bool AS col_92530,
tab_43907._float4 AS col_92531,
tab_43907.crdb_internal_mvcc_timestamp AS col_92532,
tab_43907._interval AS col_92533,
tab_43907._timestamp AS col_92534,
tab_43907.tableoid AS col_92535,
'morning':::greeting AS col_92536,
8.261594456907903357E+33:::DECIMAL AS col_92537,
tab_43907._int4 AS col_92538,
tab_43907._timestamptz AS col_92539,
'0f25a203-825a-4f6b-bae5-dc90ca896f71':::UUID AS col_92540,
tab_43907._jsonb AS col_92541,
lag(tab_43907._bytes::BYTES, tab_43907._int2::INT8) OVER (PARTITION BY tab_43907._bool, tab_43907._string ORDER BY tab_43907._int2)::BYTES
AS col_92542,
tab_43907._int8 AS col_92543
FROM
defaultdb.public.seed@[0] AS tab_43907, with_17778 AS cte_ref_5207
LIMIT
14:::INT8;
Schema:
rsg_test.go:580: To reproduce, use schema:
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
CREATE TABLE table1 (col1_0 GEOMETRY NOT NULL, col1_1 JSONB NOT NULL, INVERTED INDEX (col1_1 DESC), INVERTED INDEX (col1_0 DESC), INVERTED INDEX (col1_1), INVERTED INDEX (col1_1), INVERTED INDEX (col1_1 DESC));
CREATE TABLE table2 (col2_0 TIMESTAMP, col2_1 OID NULL, col2_2 JSONB, col2_3 DATE NOT NULL, col2_4 VARCHAR NULL, PRIMARY KEY (col2_3 DESC), col2_5 STRING NULL AS (lower(CAST(col2_1 AS STRING))) VIRTUAL, UNIQUE (col2_1 ASC, col2_3 ASC) STORING (col2_0, col2_4) WHERE table2.col2_0 <= '294276-12-31 23:59:59.999999':::TIMESTAMP, INVERTED INDEX (col2_4 DESC, col2_2 DESC));
CREATE TABLE table3 (col2_3 DATE NOT NULL, col3_1 NAME NULL, col3_2 INT4 NOT NULL, PRIMARY KEY (col2_3 DESC, col3_1 DESC), INDEX (col3_2, col2_3 DESC), UNIQUE (col2_3 ASC) WHERE ((table3.col2_3 = '1970-01-01':::DATE) OR (table3.col3_1 < e'\'':::STRING)) AND (table3.col3_2 >= 0:::INT8), UNIQUE (col3_1 DESC, col2_3 ASC) WHERE table3.col2_3 <= '4714-11-24 BC':::DATE, UNIQUE (col3_1 ASC) WHERE table3.col3_2 = 0:::INT8, FAMILY (col2_3), FAMILY (col3_2, col3_1)) INTERLEAVE IN PARENT table2 (col2_3);
CREATE TABLE table4 (col4_0 BIT(31)[], col4_1 BIT NULL, col4_2 INTERVAL NOT NULL, col4_3 FLOAT4 NULL, col4_4 INTERVAL NULL, PRIMARY KEY (col4_2 ASC), col4_5 STRING NOT NULL AS (lower(CAST(col4_2 AS STRING))) STORED, col4_6 STRING NULL AS (lower(CAST(col4_1 AS STRING))) VIRTUAL, UNIQUE (col4_2 ASC, col4_3 ASC, col4_6 ASC, col4_4 DESC, col4_1 ASC, col4_5) STORING (col4_0), INDEX (col4_4 ASC, col4_5 ASC, col4_2 ASC, col4_6 DESC) STORING (col4_0) WHERE table4.col4_3 != 3.4028234663852886e+38:::FLOAT8, INVERTED INDEX (col4_0 DESC), UNIQUE (col4_2 DESC, col4_4, col4_1 ASC, col4_3, col4_6 DESC, col4_5 DESC), INDEX (col4_4 ASC));
ALTER TABLE table1 INJECT STATISTICS e'[{"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 235, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 400}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 152, "histo_buckets": [{"distinct_range": 0, "num_eq": 6000000, "num_range": 0, "upper_bound": "\\\\x37000300010b"}, {"distinct_range": 152588866360203040, "num_eq": 20000, "num_range": 307151559011791870, "upper_bound": "\\\\x370003000139"}, {"distinct_range": 60000, "num_eq": 0, "num_range": 60000, "upper_bound": "\\\\x370003000300010b"}, {"distinct_range": 32696040036.336365, "num_eq": 1698778045310185553, "num_range": 70000000000, "upper_bound": "\\\\x3700030003000112666f6f6261720001"}, {"distinct_range": 0, "num_eq": 3262543114228705269, "num_range": 0, "upper_bound": "\\\\x3700030003000138"}, {"distinct_range": 0, "num_eq": 500000000, "num_range": 5740085996319074226, "upper_bound": "\\\\x3700030003000139"}, {"distinct_range": 3158742269329132000, "num_eq": 3457366895705940662, "num_range": 3158742269329132066, "upper_bound": "\\\\x370003000357205c2a4300012a05b55f75af03b1934a00"}, {"distinct_range": 30081277976869130, "num_eq": 6000, "num_range": 36513433042234627, "upper_bound": "\\\\x370003000363000279383d553c3338526d5650000138"}, {"distinct_range": 0, "num_eq": 90000000000, "num_range": 0, "upper_bound": "\\\\x3700030003666f6f000138"}, {"distinct_range": 0, "num_eq": 4370601498819406944, "num_range": 1000000000, "upper_bound": "\\\\x3700033e2654542e4d3b000112666f6f6261720001"}, {"distinct_range": 1070222932527189600, "num_eq": 800, "num_range": 3052653510276294060, "upper_bound": "\\\\x3700034678503f216234275c6058000138"}, {"distinct_range": 90000000000, "num_eq": 1000000000, "num_range": 90000000000, "upper_bound": "\\\\x37000362000139"}, {"distinct_range": 2645512.7010163013, "num_eq": 300000, "num_range": 9000000, "upper_bound": "\\\\x370003626172000138"}, {"distinct_range": 0, "num_eq": 8927430875085398621, "num_range": 7481104200426725339, "upper_bound": "\\\\x370003630002666f6f626172000100"}, {"distinct_range": 0, "num_eq": 2104977195156322787, "num_range": 0, "upper_bound": "\\\\x370003630002783941562f413d73710002666f6f000200030003000138"}, {"distinct_range": 5000000, "num_eq": 300000, "num_range": 5000000, "upper_bound": "\\\\x370003666f6f62617200010b"}, {"distinct_range": 6047424479767576000, "num_eq": 700000, "num_range": 6047424479767575952, "upper_bound": "\\\\x370003666f6f626172000138"}, {"distinct_range": 0, "num_eq": 160527961962079933, "num_range": 0, "upper_bound": "\\\\x372f293544382961000138"}, {"distinct_range": 6918929870154437000, "num_eq": 6028643222002930699, "num_range": 6918929870154436415, "upper_bound": "\\\\x37426747413938000138"}, {"distinct_range": 0, "num_eq": 0, "num_range": 40, "upper_bound": "\\\\x376200020003000100"}, {"distinct_range": 0, "num_eq": 600000, "num_range": 100000, "upper_bound": "\\\\x376200020003000139"}, {"distinct_range": 8496.459725014285, "num_eq": 286768242814397918, "num_range": 100000, "upper_bound": "\\\\x3762000200030003000100"}, {"distinct_range": 0, "num_eq": 3901806744621942800, "num_range": 3000, "upper_bound": "\\\\x376200020003262f59000139"}, {"distinct_range": 5686125375540979000, "num_eq": 353955453134495507, "num_range": 5686125375540978207, "upper_bound": "\\\\x376200020003630002000300010b"}, {"distinct_range": 2000000, "num_eq": 1750399364843602984, "num_range": 2000000, "upper_bound": "\\\\x376200020003630002000362617a000139"}, {"distinct_range": 0, "num_eq": 9000000, "num_range": 6079016847465866997, "upper_bound": "\\\\x377b503539315d302421000138"}], "histo_col_type": "BYTES", "name": "__auto__", "null_count": 0, "row_count": 400}]':::JSONB;
ALTER TABLE table2 INJECT STATISTICS e'[{"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 64643, "histo_buckets": [{"distinct_range": 0, "num_eq": 10000, "num_range": 0, "upper_bound": "\\u0000"}, {"distinct_range": 0, "num_eq": 600000000, "num_range": 10000000, "upper_bound": "\\u0007=I\\"|:"}, {"distinct_range": 9096413908115029000, "num_eq": 1000000000, "num_range": 9096413908115028838, "upper_bound": "\\u001b\\u0016s@XPmk"}, {"distinct_range": 0, "num_eq": 40, "num_range": 6055249944490471164, "upper_bound": "0Uy\x7f"}, {"distinct_range": 0, "num_eq": 1230647049890209306, "num_range": 1186377648199551931, "upper_bound": "6fPyd\\u001c\\u0016Z"}, {"distinct_range": 672.0707013396725, "num_eq": 4000000, "num_range": 1000, "upper_bound": "DF\\u001f!U\\u001d\x7f\\u001eP"}, {"distinct_range": 37417335037711620, "num_eq": 100, "num_range": 876808056456610489, "upper_bound": "h"}], "histo_col_type": "VARCHAR", "name": "__auto__", "null_count": 71177, "row_count": 200000}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 46720, "histo_col_type": "", "name": "__auto__", "null_count": 163137, "row_count": 200000}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 155218, "histo_col_type": "", "name": "__auto__", "null_count": 59253, "row_count": 200000}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 128104, "histo_buckets": [{"distinct_range": 0, "num_eq": 500000, "num_range": 0, "upper_bound": "150942415"}, {"distinct_range": 0, "num_eq": 600, "num_range": 30000, "upper_bound": "1367048809"}, {"distinct_range": 0, "num_eq": 2000000, "num_range": 4105092851209038016, "upper_bound": "2590632587"}, {"distinct_range": 658476.9568580189, "num_eq": 40000000000, "num_range": 1000000, "upper_bound": "3015977429"}, {"distinct_range": 6000, "num_eq": 5261810397326391324, "num_range": 6000, "upper_bound": "3982689440"}, {"distinct_range": 2464192258138261000, "num_eq": 9125249143714669215, "num_range": 5436008184744590667, "upper_bound": "4131168929"}], "histo_col_type": "OID", "name": "__auto__", "null_count": 69172, "row_count": 200000}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 130341, "histo_col_type": "", "name": "__auto__", "null_count": 60727, "row_count": 200000}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 70128, "histo_buckets": [{"distinct_range": 0, "num_eq": 20000000000, "num_range": 0, "upper_bound": "1973-05-27"}], "histo_col_type": "DATE", "name": "__auto__", "null_count": 0, "row_count": 200000}]':::JSONB;
ALTER TABLE table3 INJECT STATISTICS e'[{"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 818134746476609796, "histo_buckets": [{"distinct_range": 0, "num_eq": 700000000, "num_range": 0, "upper_bound": "1978-01-06"}, {"distinct_range": 0, "num_eq": 1000000, "num_range": 400000, "upper_bound": "1978-03-26"}, {"distinct_range": 0, "num_eq": 4231769255883068699, "num_range": 70000, "upper_bound": "1981-03-21"}, {"distinct_range": 90000000000, "num_eq": 80000, "num_range": 90000000000, "upper_bound": "1993-07-06"}], "histo_col_type": "DATE", "name": "__auto__", "null_count": 0, "row_count": 3920235679607209627}, {"columns": ["col3_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1007777791729489102, "histo_buckets": [{"distinct_range": 0, "num_eq": 3605070276795546630, "num_range": 0, "upper_bound": "\\u0014S\\r\\u0001+"}, {"distinct_range": 0, "num_eq": 4574938429225151625, "num_range": 70000, "upper_bound": "?"}, {"distinct_range": 10, "num_eq": 6000000000, "num_range": 10, "upper_bound": "X"}, {"distinct_range": 119.44352085405971, "num_eq": 1110124372657780209, "num_range": 200, "upper_bound": "]\\u000e+,s\\u0003"}], "histo_col_type": "NAME", "name": "__auto__", "null_count": 3474717573486640046, "row_count": 3920235679607209627}, {"columns": ["col3_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 986634818596223625, "histo_buckets": [{"distinct_range": 0, "num_eq": 300000000, "num_range": 0, "upper_bound": "-945146285"}, {"distinct_range": 1338098222073201400, "num_eq": 3015255593618609967, "num_range": 1338098222073201378, "upper_bound": "-60985773"}, {"distinct_range": 0, "num_eq": 2174849958258693308, "num_range": 0, "upper_bound": "91892520"}, {"distinct_range": 0, "num_eq": 1008858201662050811, "num_range": 0, "upper_bound": "772152491"}, {"distinct_range": 12.584227866781761, "num_eq": 9000, "num_range": 40, "upper_bound": "1371931373"}, {"distinct_range": 200000000, "num_eq": 8577018343349879486, "num_range": 200000000, "upper_bound": "1805219698"}, {"distinct_range": 134.27314480512493, "num_eq": 0, "num_range": 400, "upper_bound": "2102378085"}], "histo_col_type": "INT4", "name": "__auto__", "null_count": 0, "row_count": 3920235679607209627}]':::JSONB;
ALTER TABLE table4 INJECT STATISTICS '[{"columns": ["col4_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 27627, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 90000}, {"columns": ["col4_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 77319, "histo_col_type": "", "name": "__auto__", "null_count": 59691, "row_count": 90000}, {"columns": ["col4_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 65985, "histo_col_type": "", "name": "__auto__", "null_count": 37542, "row_count": 90000}, {"columns": ["col4_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 37346, "histo_col_type": "", "name": "__auto__", "null_count": 82405, "row_count": 90000}, {"columns": ["col4_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 16494, "histo_buckets": [{"distinct_range": 0, "num_eq": 100000000000, "num_range": 0, "upper_bound": "-33 years -3 mons -76 days -03:15:09.68314"}, {"distinct_range": 0, "num_eq": 60000000000, "num_range": 20000000000, "upper_bound": "-30 years -7 mons -328 days -02:02:09.194921"}, {"distinct_range": 0, "num_eq": 2313232596315356336, "num_range": 1283295686677224279, "upper_bound": "7 years 8 mons 495 days 07:57:47.787073"}, {"distinct_range": 22059233857240240, "num_eq": 9027785410733285772, "num_range": 129508645324393920, "upper_bound": "25 years 11 mons 589 days 24:00:39.156867"}], "histo_col_type": "INTERVAL", "name": "__auto__", "null_count": 0, "row_count": 90000}, {"columns": ["col4_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 13086, "histo_col_type": "", "name": "__auto__", "null_count": 80299, "row_count": 90000}, {"columns": ["col4_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 38303, "histo_col_type": "INTERVAL", "name": "__auto__", "null_count": 61177, "row_count": 90000}]':::JSONB;
CREATE TYPE rand_typ_0 AS ENUM ('ii', 'ogo', 'xa', 'tqa', 'yytv', 'oymhuu');
CREATE TYPE rand_typ_1 AS ENUM ('iaqnae', 'ew', 'jz', 'bfadst', 'smdez');
;
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
SELECT
g::INT2 AS _int2,
g::INT4 AS _int4,
g::INT8 AS _int8,
g::FLOAT4 AS _float4,
g::FLOAT8 AS _float8,
'2001-01-01'::DATE + g AS _date,
'2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
'2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
g * '1 day'::INTERVAL AS _interval,
g % 2 = 1 AS _bool,
g::DECIMAL AS _decimal,
g::STRING AS _string,
g::STRING::BYTES AS _bytes,
substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
'0.0.0.0'::INET + g AS _inet,
g::STRING::JSONB AS _jsonb,
enum_range('hello'::greeting)[g] as _enum
FROM
generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);
;
rsg_test.go:584:
rsg_test.go:585: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith600436817
--- FAIL: TestRandomSyntaxSQLSmith (300.77s)
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-experience rafiss
@DrewKimball I think
internal error: unexpectedly found decreasing offsets:
comes from lag
window function. I think we're missing a call to SetLength
on the batch. It's a bit unfortunate, but we currently have to call SetLength
whenever we're modifying Bytes
vector (even if we don't modify the length of the batch), take a look at proj_non_const_ops_tmpl.go:138
. You mentioned that you want to refactor flat bytes a bit, maybe that would also address this issue.
Yes, I think we'll have to call it on each batch before emitting, bit of a shame.
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ bc03d78fb789a4cf52027228914ab80ef4596035:
Random syntax error:
rsg_test.go:763: Crash detected: server panic: pq: internal error: unexpectedly found decreasing offsets: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 6 0 0]
Query:
SELECT
tab_507609._float8 AS col_1239400,
tab_507609._interval AS col_1239401,
tab_507608._date AS col_1239402,
tab_507608._bool AS col_1239403,
tab_507608._int8 AS col_1239404,
lead(tab_507608._bytes::BYTES, tab_507608._int2::INT8) OVER (PARTITION BY tab_507609._bool, tab_507609.tableoid, tab_507608._bool, tab_507609._int8, tab_507608.tableoid, tab_507609._timestamp ORDER BY tab_507608._int2, tab_507609._float8 DESC, tab_507608._string DESC, tab_507609._int8 DESC, tab_507608._int4, tab_507608._bool ASC, tab_507609._bytes ASC, tab_507609._uuid, tab_507609._enum DESC)::BYTES
AS col_1239405,
e'i~Xg\x0b':::STRING AS col_1239406,
tab_507608._float8 AS col_1239407,
tab_507608._date AS col_1239408,
0:::INT8 AS col_1239409,
tab_507608._float8 AS col_1239410,
tab_507608._bool AS col_1239411,
tab_507608._timestamp AS col_1239412,
tab_507608._enum AS col_1239413
FROM
defaultdb.public.seed@seed__int8__float8__date_idx AS tab_507608, defaultdb.public.seed@[0] AS tab_507609
LIMIT
86:::INT8;
Schema:
rsg_test.go:580: To reproduce, use schema:
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
CREATE TABLE table1 (col1_0 OID NULL, col1_1 CHAR NOT NULL, col1_2 REGCLASS NOT NULL, col1_3 INT2 NOT NULL, col1_4 JSONB NOT NULL, col1_5 VARCHAR NOT NULL, col1_6 INET NOT NULL, col1_7 REGTYPE NOT NULL, col1_8 NAME NOT NULL, PRIMARY KEY (col1_1 ASC, col1_3 ASC, col1_6 DESC, col1_5, col1_8, col1_2 ASC), col1_9 STRING NOT NULL AS (lower(col1_1)) STORED, col1_10 STRING NOT NULL AS (lower(col1_8)) VIRTUAL, col1_11 STRING NOT NULL AS (lower(col1_8)) STORED, col1_12 STRING NOT NULL AS (lower(col1_5)) VIRTUAL, INDEX (col1_1, col1_6, col1_7, col1_12 DESC, col1_9 ASC, col1_10 ASC, col1_5 DESC, col1_11) WHERE ((((((table1.col1_12 > '"':::STRING) OR (table1.col1_8 = e'\x00':::STRING)) AND (table1.col1_1 > e'\U00002603':::STRING)) OR (table1.col1_5 <= e'\U00002603':::STRING)) OR (table1.col1_11 < 'X':::STRING)) OR (table1.col1_9 = e'\U00002603':::STRING)) AND (table1.col1_3 = 1:::INT8), INDEX (col1_12 DESC, col1_9, col1_7 ASC, col1_0 DESC, col1_2 ASC) WHERE (((((table1.col1_10 != e'\x00':::STRING) AND (table1.col1_11 > e'\x00':::STRING)) AND (table1.col1_8 < e'\U00002603':::STRING)) AND (table1.col1_12 < e'\'':::STRING)) OR (table1.col1_9 <= '"':::STRING)) OR (table1.col1_1 >= '':::STRING));
ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 39128650303, "histo_col_type": "", "name": "__auto__", "null_count": 45934794823, "row_count": 50000000000}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 32443369468, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 50000000000}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 34071697528, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 50000000000}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 28555670175, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 50000000000}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 8891341126, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 50000000000}, {"columns": ["col1_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 48665569775, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 50000000000}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 31715974119, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 50000000000}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 25818101957, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 50000000000}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 46015587301, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 50000000000}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 27046720238, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 50000000000}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 24347262841, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 50000000000}, {"columns": ["col1_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5635242120, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 50000000000}, {"columns": ["col1_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 10752062415, "histo_col_type": "STRING", "name": "__auto__", "null_count": 0, "row_count": 50000000000}]':::JSONB;
CREATE TYPE rand_typ_0 AS ENUM ('r', 'fh', 'hhgq', 'qg');
CREATE TYPE rand_typ_1 AS ENUM ('iiz');
;
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
SELECT
g::INT2 AS _int2,
g::INT4 AS _int4,
g::INT8 AS _int8,
g::FLOAT4 AS _float4,
g::FLOAT8 AS _float8,
'2001-01-01'::DATE + g AS _date,
'2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
'2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
g * '1 day'::INTERVAL AS _interval,
g % 2 = 1 AS _bool,
g::DECIMAL AS _decimal,
g::STRING AS _string,
g::STRING::BYTES AS _bytes,
substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
'0.0.0.0'::INET + g AS _inet,
g::STRING::JSONB AS _jsonb,
enum_range('hello'::greeting)[g] as _enum
FROM
generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);
;
rsg_test.go:584:
rsg_test.go:585: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith472405288
--- FAIL: TestRandomSyntaxSQLSmith (300.77s)
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-experience rafiss
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ 9335ade9ce91ebdab1996d7c818b16df32557ac8:
Random syntax error:
rsg_test.go:763: Crash detected: server panic: driver: bad connection
Query:
SELECT
NULL AS col_1035195,
(-2.264002799987793):::FLOAT8 AS col_1035196,
'b3cb:ece3:3bfa:4c4b:2266:d44d:daf9:9785/1':::INET AS col_1035197,
CASE WHEN tab_460585.col4_5 THEN localtimestamp():::DATE::DATE ELSE tab_460586.col2_0 END AS col_1035198,
postgis_lib_build_date()::STRING AS col_1035199,
tab_460585.col4_7::INTERVAL
NOT IN (
SELECT
tab_460585.col4_7::INTERVAL AS col_1035200
FROM
defaultdb.public.table1@table1_col1_10_col1_7_col1_13_col1_6_col1_2_col1_12_col1_0_col1_1_key
AS tab_460587
WHERE
true
)
AS col_1035201,
2049855128:::INT8 AS col_1035202,
tab_460584.col4_0 AS col_1035203,
3.4028234663852886e+38:::FLOAT8 AS col_1035204,
NULL AS col_1035205,
970806364:::OID AS col_1035206,
tab_460585.tableoid AS col_1035207,
tab_460585.col4_0 AS col_1035208,
tab_460585.crdb_internal_mvcc_timestamp AS col_1035209,
NULL AS col_1035210,
0.46895503997802734:::FLOAT8 AS col_1035211,
tab_460583.col4_0 AS col_1035212,
tab_460585.col4_4 AS col_1035213,
tab_460584.col4_0 AS col_1035214
FROM
defaultdb.public.table4 AS tab_460583
JOIN defaultdb.public.table4 AS tab_460584 ON (tab_460583.col4_1) = (tab_460584.col4_1),
defaultdb.public.table4@[0] AS tab_460585
JOIN defaultdb.public.table2@[0] AS tab_460586 ON (tab_460585.tableoid) = (tab_460586.tableoid);
Schema:
rsg_test.go:580: To reproduce, use schema:
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
CREATE TABLE table1 (col1_0 REGPROC NOT NULL, col1_1 OID NOT NULL, col1_2 NAME NULL, col1_3 JSONB, col1_4 DECIMAL NULL, col1_5 DATE NOT NULL, col1_6 INET NULL, col1_7 INT8 NULL, col1_8 FLOAT4, col1_9 DECIMAL NULL AS (col1_4 + 0.3253561856857505352:::DECIMAL) STORED, col1_10 STRING NOT NULL AS (lower(CAST(col1_0 AS STRING))) STORED, col1_11 FLOAT4 AS (col1_8 + 0.2656465172767639:::FLOAT8) VIRTUAL, col1_12 STRING NULL AS (lower(col1_2)) STORED, col1_13 STRING NOT NULL AS (lower(CAST(col1_0 AS STRING))) STORED, col1_14 STRING NULL AS (lower(col1_2)) STORED, UNIQUE (col1_10 ASC, col1_7 ASC, col1_13, col1_6 DESC, col1_2 DESC, col1_12 DESC, col1_0 DESC, col1_1 ASC) STORING (col1_3, col1_4, col1_5) WHERE (((table1.col1_2 != '"':::STRING) OR (table1.col1_8 = '+Inf':::FLOAT8)) AND (table1.col1_7 < 9223372036854775807:::INT8)) OR (table1.col1_11 != '+Inf':::FLOAT8), FAMILY (col1_8), FAMILY (col1_6, col1_7), FAMILY (col1_3, col1_1, col1_13, col1_10, col1_4, col1_2), FAMILY (col1_0, col1_9), FAMILY (col1_12, col1_14, col1_5));
CREATE TABLE table2 (col2_0 DATE NULL, UNIQUE (col2_0) WHERE table2.col2_0 != '4714-11-24 BC':::DATE, INDEX (col2_0 DESC), INDEX (col2_0 ASC) WHERE table2.col2_0 <= 'infinity':::DATE, UNIQUE (col2_0 ASC) WHERE table2.col2_0 > '1970-01-01':::DATE, INDEX (col2_0) WHERE table2.col2_0 > '-infinity':::DATE, INDEX (col2_0 DESC), UNIQUE (col2_0) WHERE table2.col2_0 != '1970-01-01':::DATE, INDEX (col2_0) WHERE table2.col2_0 < '4714-11-24 BC':::DATE);
CREATE TABLE table3 (col3_0 REGPROC NULL, col3_1 GEOMETRY NOT NULL, col3_2 TIME NOT NULL, col3_3 INT2 NULL, col3_4 STRING NOT NULL AS (lower(CAST(col3_2 AS STRING))) STORED, INVERTED INDEX (col3_0 ASC, col3_4 DESC, col3_2 ASC, col3_1 ASC) WHERE ((table3.col3_3 != (-1):::INT8) AND (table3.col3_4 <= 'X':::STRING)) OR (table3.col3_2 > '00:00:00':::TIME), UNIQUE (col3_3 DESC, col3_2, col3_0 DESC) WHERE ((table3.col3_2 <= '24:00:00':::TIME) AND (table3.col3_4 != e'\x00':::STRING)) OR (table3.col3_3 < 0:::INT8), INDEX (col3_2) STORING (col3_0) WHERE table3.col3_2 != '24:00:00':::TIME, UNIQUE (col3_0 DESC, col3_3, col3_4 ASC), INDEX (col3_2 ASC) STORING (col3_0, col3_4) WHERE (table3.col3_3 = 1:::INT8) OR (table3.col3_4 > e'\x00':::STRING), FAMILY (col3_3), FAMILY (col3_0), FAMILY (col3_4, col3_2), FAMILY (col3_1));
CREATE TABLE table4 (col4_0 FLOAT4 NULL, col4_1 VARCHAR NULL, col4_2 INET NULL, col4_3 CHAR NOT NULL, col4_4 BIT(43), col4_5 BOOL NULL, col4_6 INT4 NOT NULL, col4_7 INTERVAL NOT NULL, PRIMARY KEY (col4_7 ASC, col4_6 ASC), col4_8 STRING NULL AS (lower(CAST(col4_2 AS STRING))) VIRTUAL, UNIQUE (col4_0 ASC, col4_7 ASC, col4_4 DESC, col4_5 ASC, col4_1, col4_6 DESC, col4_8, col4_2 DESC), INDEX (col4_1 DESC, col4_0 DESC, col4_5 ASC) STORING (col4_4) WHERE (((table4.col4_5 AND (table4.col4_0 < 0.0:::FLOAT8)) AND (table4.col4_3 < e'\x00':::STRING)) OR (table4.col4_6 = (-1):::INT8)) OR (table4.col4_8 = '':::STRING), FAMILY (col4_4), FAMILY (col4_6, col4_2, col4_3), FAMILY (col4_1), FAMILY (col4_5, col4_0), FAMILY (col4_7));
CREATE TABLE table5 (col4_7 INTERVAL NOT NULL, col4_6 INT4 NOT NULL, col5_2 TIME, col5_3 FLOAT8 NOT NULL, col5_4 "char" NOT NULL, col5_5 REGNAMESPACE NULL, col5_6 TIME NULL, col5_7 INT2 NOT NULL, col5_8 OID, col5_9 TIMESTAMP NOT NULL, col5_10 BIT(44) NOT NULL, col5_11 TIMESTAMPTZ, col5_12 REGPROCEDURE NOT NULL, col5_13 FLOAT4, col5_14 OID, PRIMARY KEY (col4_7 ASC, col4_6 ASC, col5_13 DESC, col5_9 ASC, col5_5 ASC, col5_11 ASC, col5_2, col5_12 ASC, col5_8 ASC, col5_10 DESC, col5_7 DESC, col5_14), INDEX (col5_5, col5_8 ASC, col5_12 DESC, col5_7, col5_11, col5_14 ASC, col4_6 DESC, col5_10 ASC, col5_4 ASC, col5_13 ASC, col5_9 DESC)) INTERLEAVE IN PARENT table4 (col4_7, col4_6);
ALTER TABLE table1 INJECT STATISTICS e'[{"columns": ["col1_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4101408329951826910, "histo_col_type": "", "name": "__auto__", "null_count": 2110192267239410827, "row_count": 6204241941857246557}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4391223056195446712, "histo_col_type": "", "name": "__auto__", "null_count": 1534625912854956440, "row_count": 6204241941857246557}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6069060534101722027, "histo_col_type": "", "name": "__auto__", "null_count": 5790320832806779269, "row_count": 6204241941857246557}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 15508606254135760, "histo_col_type": "", "name": "__auto__", "null_count": 1053101820108945893, "row_count": 6204241941857246557}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4487783521032658614, "histo_col_type": "", "name": "__auto__", "null_count": 5986410797317728233, "row_count": 6204241941857246557}, {"columns": ["col1_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 52243023105830763, "histo_col_type": "", "name": "__auto__", "null_count": 5404856176852889108, "row_count": 6204241941857246557}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5757871385401074195, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6204241941857246557}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2375345146332158563, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6204241941857246557}, {"columns": ["col1_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4286807378483990892, "histo_col_type": "", "name": "__auto__", "null_count": 5469650523516835533, "row_count": 6204241941857246557}, {"columns": ["col1_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4720085979921247355, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6204241941857246557}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5823276942441959096, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6204241941857246557}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5575575257590718364, "histo_col_type": "", "name": "__auto__", "null_count": 3386683647408703853, "row_count": 6204241941857246557}, {"columns": ["col1_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3960849591600050404, "histo_buckets": [{"distinct_range": 0, "num_eq": 9000000000, "num_range": 0, "upper_bound": "\\u0000"}, {"distinct_range": 101951.42872053575, "num_eq": 40000000, "num_range": 200000, "upper_bound": "\\u0003\\u000c:\\u0013t\\u001d"}, {"distinct_range": 3281143677445270000, "num_eq": 7105524138004548803, "num_range": 3281143677445270247, "upper_bound": "\\u000b\\\\\\n&\\u0018(W\\u0013"}, {"distinct_range": 4875563620943616000, "num_eq": 103230202158803395, "num_range": 4875563620943616482, "upper_bound": "D\\u0006l$xJ"}, {"distinct_range": 7735045464020924000, "num_eq": 4273072248544128332, "num_range": 7735045464020924251, "upper_bound": "_S#}k,\\u000e "}, {"distinct_range": 40, "num_eq": 100, "num_range": 40, "upper_bound": "e\\u0013\\u000bX\\u001ew{du"}, {"distinct_range": 51.16383543018411, "num_eq": 5000, "num_range": 80, "upper_bound": "u#"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 0, "row_count": 6204241941857246557}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4377921137099472933, "histo_col_type": "", "name": "__auto__", "null_count": 372115953670127968, "row_count": 6204241941857246557}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2006313191653293483, "histo_col_type": "", "name": "__auto__", "null_count": 923645166618643889, "row_count": 6204241941857246557}]':::JSONB;
ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 221749300997081600, "histo_buckets": [{"distinct_range": 0, "num_eq": 5131601667672667053, "num_range": 0, "upper_bound": "1977-09-23"}, {"distinct_range": 0, "num_eq": 8674794940684942601, "num_range": 4930831558124744645, "upper_bound": "1993-06-06"}], "histo_col_type": "DATE", "name": "__auto__", "null_count": 177482314100449899, "row_count": 1703084519407548980}]':::JSONB;
ALTER TABLE table3 INJECT STATISTICS '[{"columns": ["col3_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 700659978823121890, "histo_buckets": [{"distinct_range": 0, "num_eq": 0, "num_range": 0, "upper_bound": "05:27:39.187079"}, {"distinct_range": 0, "num_eq": 7000000, "num_range": 6795900056208019388, "upper_bound": "19:33:06.75032"}, {"distinct_range": 18874397.62869629, "num_eq": 6052974019961790405, "num_range": 40000000, "upper_bound": "22:15:29.708494"}], "histo_col_type": "TIME", "name": "__auto__", "null_count": 0, "row_count": 6435544400732396009}, {"columns": ["col3_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4008115651950079721, "histo_col_type": "", "name": "__auto__", "null_count": 5707959006210798526, "row_count": 6435544400732396009}, {"columns": ["col3_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4609686886247326806, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6435544400732396009}, {"columns": ["col3_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4819403481508984456, "histo_buckets": [{"distinct_range": 0, "num_eq": 3626781143139755816, "num_range": 0, "upper_bound": "0"}, {"distinct_range": 0, "num_eq": 1000000, "num_range": 4480222340211764308, "upper_bound": "1280063922"}, {"distinct_range": 0, "num_eq": 5440831043953998774, "num_range": 2322303457158551807, "upper_bound": "1296107466"}, {"distinct_range": 3000000000, "num_eq": 300000000, "num_range": 3000000000, "upper_bound": "2219003529"}, {"distinct_range": 0, "num_eq": 700, "num_range": 10000000, "upper_bound": "2428734421"}, {"distinct_range": 8570537554711431000, "num_eq": 2748255222320679013, "num_range": 8570537554711431672, "upper_bound": "2536288223"}, {"distinct_range": 0, "num_eq": 60000, "num_range": 9000000000, "upper_bound": "2667048236"}, {"distinct_range": 7371988650354352000, "num_eq": 8142632794630468658, "num_range": 7371988650354351701, "upper_bound": "2908932688"}, {"distinct_range": 0, "num_eq": 2999056507987908399, "num_range": 5844320925136474340, "upper_bound": "3804175789"}], "histo_col_type": "REGPROC", "name": "__auto__", "null_count": 5809136614585480713, "row_count": 6435544400732396009}, {"columns": ["col3_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2874600586895477177, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6435544400732396009}]':::JSONB;
ALTER TABLE table4 INJECT STATISTICS e'[{"columns": ["col4_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2049967898277780613, "histo_buckets": [{"distinct_range": 0, "num_eq": 8510829390679818291, "num_range": 0, "upper_bound": "-2.03426194190979"}, {"distinct_range": 0, "num_eq": 50, "num_range": 100000000, "upper_bound": "-1.1173709630966187"}, {"distinct_range": 2345545471324740000, "num_eq": 8000000, "num_range": 2345545471324740053, "upper_bound": "-0.5409338474273682"}, {"distinct_range": 0, "num_eq": 300000000, "num_range": 800000000, "upper_bound": "-0.06093617528676987"}, {"distinct_range": 4423456654387241500, "num_eq": 2000, "num_range": 4423456654387241631, "upper_bound": "0.44689682126045227"}, {"distinct_range": 751343934.8149176, "num_eq": 30, "num_range": 900000000, "upper_bound": "0.6713685393333435"}, {"distinct_range": 69781185.3177927, "num_eq": 10000000, "num_range": 100000000, "upper_bound": "0.7284423112869263"}, {"distinct_range": 0, "num_eq": 9000, "num_range": 60000000, "upper_bound": "1.120895266532898"}, {"distinct_range": 201233037153662180, "num_eq": 300000, "num_range": 214377138155474479, "upper_bound": "3.4028234663852886e+38"}], "histo_col_type": "FLOAT4", "name": "__auto__", "null_count": 588361019996038169, "row_count": 8949236372452977366}, {"columns": ["col4_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5634315044651806183, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8949236372452977366}, {"columns": ["col4_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7918926926172489705, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8949236372452977366}, {"columns": ["col4_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7944955561246469209, "histo_col_type": "", "name": "__auto__", "null_count": 1727328565817954361, "row_count": 8949236372452977366}, {"columns": ["col4_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 973134749833930217, "histo_col_type": "", "name": "__auto__", "null_count": 6503470170295151292, "row_count": 8949236372452977366}, {"columns": ["col4_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2319412058544507544, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8949236372452977366}, {"columns": ["col4_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2456124611502478607, "histo_col_type": "", "name": "__auto__", "null_count": 5155734102043379742, "row_count": 8949236372452977366}, {"columns": ["col4_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5811670411453105875, "histo_buckets": [{"distinct_range": 0, "num_eq": 3885711087427376440, "num_range": 0, "upper_bound": ""}, {"distinct_range": 3888979733149139000, "num_eq": 8657135609197812908, "num_range": 9028333213411152347, "upper_bound": "\\u001c."}, {"distinct_range": 0, "num_eq": 90, "num_range": 4974243600011279032, "upper_bound": "$U\\u0008H\\u0001g"}, {"distinct_range": 0, "num_eq": 1112553937054883333, "num_range": 2464099039656166958, "upper_bound": "vYZ@"}, {"distinct_range": 0, "num_eq": 1731459715966363217, "num_range": 0, "upper_bound": "x\\u001cD\\t"}], "histo_col_type": "VARCHAR", "name": "__auto__", "null_count": 3367064356740775061, "row_count": 8949236372452977366}, {"columns": ["col4_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4528680886300252428, "histo_col_type": "", "name": "__auto__", "null_count": 2154752613050776772, "row_count": 8949236372452977366}]':::JSONB;
ALTER TABLE table5 INJECT STATISTICS '[{"columns": ["col4_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 83365, "histo_buckets": [{"distinct_range": 0, "num_eq": 9133502611141503715, "num_range": 0, "upper_bound": "-80 years -2 mons -715 days -22:30:29.519644"}, {"distinct_range": 60000, "num_eq": 1713596305916198376, "num_range": 60000, "upper_bound": "-61 years -2 mons -319 days -00:44:40.129513"}, {"distinct_range": 2190180899467970000, "num_eq": 100000000, "num_range": 2190180899467970073, "upper_bound": "7 years 11 mons 304 days 18:34:51.59469"}, {"distinct_range": 210.11576325931657, "num_eq": 900, "num_range": 300, "upper_bound": "21 years 7 mons 778 days 06:30:59.799416"}, {"distinct_range": 3958819145267531000, "num_eq": 300000000, "num_range": 4797356877421949616, "upper_bound": "32 years 9 mons 142 days 12:38:24.580737"}, {"distinct_range": 0, "num_eq": 3671036818190276232, "num_range": 0, "upper_bound": "64 years 1 mon 852 days 23:58:18.216221"}], "histo_col_type": "INTERVAL", "name": "__auto__", "null_count": 0, "row_count": 200000}, {"columns": ["col4_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 164212, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 200000}, {"columns": ["col5_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 184480, "histo_col_type": "", "name": "__auto__", "null_count": 37729, "row_count": 200000}, {"columns": ["col5_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 48996, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 200000}, {"columns": ["col5_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 99537, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 200000}, {"columns": ["col5_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 28944, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 200000}, {"columns": ["col5_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 156569, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 200000}, {"columns": ["col5_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 106617, "histo_buckets": [{"distinct_range": 0, "num_eq": 6415487162548127541, "num_range": 0, "upper_bound": "448909555"}, {"distinct_range": 2779436117222059500, "num_eq": 7469769163174653917, "num_range": 2779436117222059329, "upper_bound": "863217685"}, {"distinct_range": 6.614070358160516, "num_eq": 3035385820460215044, "num_range": 10, "upper_bound": "1067834051"}, {"distinct_range": 0, "num_eq": 100000000, "num_range": 0, "upper_bound": "1540119994"}, {"distinct_range": 2321849702058131000, "num_eq": 0, "num_range": 4694869225589114819, "upper_bound": "2256476682"}, {"distinct_range": 0, "num_eq": 2000, "num_range": 6060663712502192815, "upper_bound": "3737966425"}, {"distinct_range": 3774.064807529906, "num_eq": 100000, "num_range": 9000, "upper_bound": "4216761283"}], "histo_col_type": "REGNAMESPACE", "name": "__auto__", "null_count": 30623, "row_count": 200000}, {"columns": ["col5_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 120263, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 200000}, {"columns": ["col5_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 138030, "histo_col_type": "", "name": "__auto__", "null_count": 58000, "row_count": 200000}, {"columns": ["col5_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 96722, "histo_col_type": "", "name": "__auto__", "null_count": 59432, "row_count": 200000}, {"columns": ["col5_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 174926, "histo_col_type": "", "name": "__auto__", "null_count": 31035, "row_count": 200000}, {"columns": ["col5_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 26540, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 200000}, {"columns": ["col5_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 186848, "histo_col_type": "", "name": "__auto__", "null_count": 45176, "row_count": 200000}, {"columns": ["col5_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 76484, "histo_col_type": "", "name": "__auto__", "null_count": 166507, "row_count": 200000}]':::JSONB;
CREATE TYPE rand_typ_0 AS ENUM ('nupa', 'vj');
CREATE TYPE rand_typ_1 AS ENUM ('zog', 's', 'cez', 'ewqkf');
;
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
SELECT
g::INT2 AS _int2,
g::INT4 AS _int4,
g::INT8 AS _int8,
g::FLOAT4 AS _float4,
g::FLOAT8 AS _float8,
'2001-01-01'::DATE + g AS _date,
'2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
'2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
g * '1 day'::INTERVAL AS _interval,
g % 2 = 1 AS _bool,
g::DECIMAL AS _decimal,
g::STRING AS _string,
g::STRING::BYTES AS _bytes,
substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
'0.0.0.0'::INET + g AS _inet,
g::STRING::JSONB AS _jsonb,
enum_range('hello'::greeting)[g] as _enum
FROM
generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);
;
rsg_test.go:584:
rsg_test.go:585: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith211778436
--- FAIL: TestRandomSyntaxSQLSmith (300.89s)
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-experience rafiss
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ 2bdeffc210b63c8268944048c758a73a2cf07bed:
Random syntax error:
rsg_test.go:763: Crash detected: server panic: driver: bad connection
Query:
WITH
with_209242 (col_1242702) AS (SELECT * FROM (VALUES (NULL)) AS tab_513002 (col_1242702)),
with_209243 (col_1242703)
AS (
SELECT
*
FROM
(
VALUES
('18:17:13.706604-03:58:00':::TIMETZ),
('11:54:59.05083-08:48:00':::TIMETZ),
(NULL),
('11:33:17.62653-00:26:00':::TIMETZ),
('02:17:26.726853-13:15:00':::TIMETZ)
)
AS tab_513003 (col_1242703)
)
SELECT
tab_513004._float8 AS col_1242704,
'\x9cb11e9518c6167a':::BYTES AS col_1242705,
'18 years 10 mons 878 days 02:55:53.562181':::INTERVAL::INTERVAL
IN (
SELECT
tab_513004._interval::INTERVAL AS col_1242706
FROM
defaultdb.public.table1@table1_col1_3_col1_0_col1_9_col1_7_col1_4_col1_6_key AS tab_513005
LIMIT
24:::INT8
)
AS col_1242707,
tab_513004._float4 AS col_1242708,
tab_513004._timestamptz AS col_1242709,
NULL AS col_1242710
FROM
defaultdb.public.seed@seed__int8__float8__date_idx AS tab_513004
WHERE
tab_513004._bool
ORDER BY
tab_513004._decimal, tab_513004._enum ASC
LIMIT
73:::INT8;
Schema:
rsg_test.go:580: To reproduce, use schema:
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
CREATE TABLE table1 (col1_0 TIMESTAMPTZ NOT NULL, col1_1 "char", col1_2 STRING[] NULL, col1_3 TIMESTAMP NULL, col1_4 TIME, col1_5 DECIMAL, col1_6 DECIMAL, col1_7 TIMESTAMPTZ NOT NULL, col1_8 BYTES NOT NULL, col1_9 NAME NOT NULL, PRIMARY KEY (col1_8 ASC, col1_0 DESC), INDEX (col1_8 DESC, col1_4 DESC) STORING (col1_1, col1_3, col1_6) WHERE ((((((((table1.col1_0 < '-4713-11-24 00:00:00+00:00':::TIMESTAMPTZ) OR (table1.col1_6 < 'NaN':::DECIMAL)) OR (table1.col1_8 >= '\x27':::BYTES)) AND (table1.col1_1 > '"':::STRING)) OR (table1.col1_5 <= 'NaN':::DECIMAL)) OR (table1.col1_7 = '-2000-01-01 00:00:00+00:00':::TIMESTAMPTZ)) AND (table1.col1_4 < '24:00:00':::TIME)) OR (table1.col1_9 >= e'\'':::STRING)) OR (table1.col1_3 <= '3000-01-01 00:00:00':::TIMESTAMP), UNIQUE (col1_1 ASC, col1_0 DESC) STORING (col1_3, col1_5, col1_6, col1_7, col1_9), UNIQUE (col1_1 ASC, col1_7 ASC, col1_4 DESC, col1_0 DESC, col1_6 DESC, col1_8 DESC, col1_9, col1_5 ASC) STORING (col1_2, col1_3), UNIQUE (col1_3 DESC, col1_0 DESC, col1_9, col1_7 ASC, col1_4 ASC, col1_6 DESC));
CREATE TABLE table2 (col1_8 BYTES NOT NULL, col1_0 TIMESTAMPTZ NOT NULL, col2_2 NAME, col2_3 OID, col2_4 DATE NOT NULL, col2_5 STRING NULL, col2_6 VARCHAR, col2_7 REGPROC NOT NULL, col2_8 DECIMAL, col2_9 REGPROC, col2_10 DATE NULL, col2_11 NAME, col2_12 FLOAT4, col2_13 TIMESTAMP NOT NULL, col2_14 BOOL, PRIMARY KEY (col1_8 ASC, col1_0 DESC, col2_7, col2_11 DESC, col2_9, col2_10 ASC, col2_12 ASC, col2_8 DESC, col2_2 DESC, col2_4 DESC, col2_6 DESC, col2_13 ASC, col2_5), INDEX (col2_3, col2_14 ASC, col2_8, col2_2 DESC, col2_5, col2_7 DESC, col1_0) WHERE (((((NOT table2.col2_14) OR (table2.col2_8 = (-1):::DECIMAL)) AND (table2.col2_2 <= '':::STRING)) OR (table2.col2_12 = '+Inf':::FLOAT8)) AND (table2.col2_4 < '-infinity':::DATE)) AND (table2.col2_5 > '"':::STRING), UNIQUE (col2_12 ASC, col2_10 DESC), UNIQUE (col2_13 ASC, col2_3 DESC, col2_14, col2_7, col2_11 ASC, col2_10, col2_12 DESC), UNIQUE (col2_10 ASC, col2_14 DESC, col2_2 DESC, col2_8 ASC, col2_4, col2_5, col2_7 ASC) WHERE (((((((((((table2.col1_0 != '-2000-01-01 00:00:00+00:00':::TIMESTAMPTZ) OR (table2.col2_6 >= '"':::STRING)) AND (table2.col2_10 != '4714-11-24 BC':::DATE)) OR (table2.col2_11 >= e'\U00002603':::STRING)) OR (table2.col2_12 < 1.401298464324817e-45:::FLOAT8)) AND (table2.col2_2 = '"':::STRING)) AND (table2.col1_8 != '\x58':::BYTES)) OR (table2.col2_8 <= (-1):::DECIMAL)) AND (table2.col2_13 < '0001-01-01 00:00:00':::TIMESTAMP)) OR table2.col2_14) AND (table2.col2_4 != '-infinity':::DATE)) OR (table2.col2_5 < '':::STRING), UNIQUE (col1_8 ASC, col2_10, col2_8 ASC, col2_6 ASC, col2_5, col2_9, col1_0 DESC, col2_13, col2_4 DESC, col2_12 ASC, col2_3 DESC, col2_7 DESC, col2_11 ASC, col2_2) STORING (col2_14), INDEX (col2_8 ASC, col2_11, col2_2 ASC, col2_13, col2_12, col2_9, col2_6, col2_3 DESC, col2_14 DESC, col2_10 DESC, col2_7, col2_5, col1_0 DESC, col2_4 ASC)) INTERLEAVE IN PARENT table1 (col1_8, col1_0);
CREATE TABLE table3 (col3_0 VARCHAR NOT NULL, col3_1 OID NULL, col3_2 INT2 NULL, col3_3 TIMESTAMP NOT NULL, col3_4 CHAR NOT NULL, col3_5 BOX2D[] NOT NULL, col3_6 TIMETZ NOT NULL, col3_7 INT8 NOT NULL, col3_8 REGPROCEDURE, col3_9 TIMESTAMP NOT NULL, col3_10 GEOMETRY, col3_11 STRING NOT NULL AS (lower(CAST(col3_6 AS STRING))) VIRTUAL, col3_12 STRING NOT NULL AS (lower(CAST(col3_3 AS STRING))) STORED, col3_13 STRING NOT NULL AS (lower(CAST(col3_3 AS STRING))) STORED, col3_14 INT2 NULL AS (col3_2 + col3_7) STORED, col3_15 INT2 NULL AS (col3_2 + col3_7) STORED, col3_16 INT2 NULL AS (col3_2 + col3_7) VIRTUAL, col3_17 STRING AS (lower(CAST(col3_10 AS STRING))) STORED, UNIQUE (col3_14 ASC, col3_2 DESC) STORING (col3_0, col3_1, col3_3, col3_5, col3_7, col3_9, col3_10, col3_15, col3_17), INDEX (col3_12, col3_8, col3_16 ASC, col3_2 ASC, col3_9, col3_11) STORING (col3_0, col3_1, col3_3, col3_5, col3_6, col3_15, col3_17), UNIQUE (col3_9 DESC, col3_1 DESC), UNIQUE (col3_2 ASC, col3_3, col3_11 ASC, col3_6 ASC, col3_0 DESC, col3_4 ASC, col3_8 ASC, col3_15) STORING (col3_1, col3_5, col3_7, col3_9, col3_12) WHERE table3.col3_2 < (-1):::INT8, UNIQUE (col3_15 DESC, col3_17 ASC, col3_7 DESC, col3_12, col3_14, col3_13 ASC, col3_6 DESC) STORING (col3_2, col3_3, col3_4, col3_8, col3_9) WHERE (((((((((table3.col3_7 <= 32767:::INT8) OR (table3.col3_13 <= '"':::STRING)) OR (table3.col3_17 > 'X':::STRING)) AND (table3.col3_11 > 'X':::STRING)) AND (table3.col3_3 > '-4713-11-24 00:00:00':::TIMESTAMP)) OR (table3.col3_2 != 0:::INT8)) AND (table3.col3_12 <= '':::STRING)) AND (table3.col3_0 = 'X':::STRING)) OR (table3.col3_4 < e'\'':::STRING)) AND (table3.col3_6 > '00:00:00+15:59:00':::TIMETZ), INDEX (col3_17 ASC, col3_2 ASC, col3_1 DESC, col3_3 ASC, col3_15 ASC, col3_11, col3_12 DESC, col3_14, col3_13 DESC) WHERE table3.col3_4 <= '"':::STRING, FAMILY (col3_3), FAMILY (col3_13), FAMILY (col3_9, col3_0), FAMILY (col3_1, col3_7), FAMILY (col3_6), FAMILY (col3_2, col3_5, col3_12), FAMILY (col3_14, col3_10, col3_8, col3_17), FAMILY (col3_4), FAMILY (col3_15));
CREATE TABLE table4 (col1_8 BYTES NOT NULL, col1_0 TIMESTAMPTZ NOT NULL, col2_7 REGPROC NOT NULL, col2_11 NAME, col2_9 REGPROC, col2_10 DATE NULL, col2_12 FLOAT4, col2_8 DECIMAL, col2_2 NAME, col2_4 DATE NOT NULL, col2_6 VARCHAR, col2_13 TIMESTAMP NOT NULL, col2_5 STRING NULL, col4_13 BOX2D NOT NULL, PRIMARY KEY (col1_8 ASC, col1_0 DESC, col2_7, col2_11 DESC, col2_9, col2_10 ASC, col2_12 ASC, col2_8 DESC, col2_2 DESC, col2_4 DESC, col2_6 DESC, col2_13 ASC, col2_5), UNIQUE (col2_10 DESC, col2_6 DESC, col2_4, col2_11 DESC), UNIQUE (col2_6 DESC, col2_13 ASC, col4_13 DESC, col2_12 DESC, col2_5, col1_8, col2_4, col1_0 DESC, col2_10, col2_9, col2_11 ASC, col2_2 ASC, col2_7 ASC) WHERE ((table4.col2_5 != '':::STRING) OR (table4.col2_8 = 'Infinity':::DECIMAL)) AND (table4.col2_6 = '"':::STRING), UNIQUE (col2_8 DESC, col2_13 ASC, col2_9 DESC, col2_5, col2_6, col2_7 DESC, col2_4, col2_2 DESC), UNIQUE (col2_11 ASC, col2_9 DESC, col2_12 ASC, col2_7 DESC, col2_4 DESC) WHERE ((((((((table4.col2_4 < '1970-01-01':::DATE) OR (table4.col2_6 < e'\'':::STRING)) AND (table4.col2_2 > e'\U00002603':::STRING)) AND (table4.col2_11 < '"':::STRING)) AND (table4.col2_8 <= 0:::DECIMAL)) AND (table4.col1_0 <= '-2000-01-01 00:00:00+00:00':::TIMESTAMPTZ)) OR (table4.col2_12 >= '+Inf':::FLOAT8)) AND (table4.col2_5 >= e'\U00002603':::STRING)) AND (table4.col2_10 = '5874897-12-31':::DATE), UNIQUE (col2_8 DESC, col2_7 DESC, col2_4 DESC, col1_0 DESC, col2_10 DESC, col2_12, col2_13, col2_9 ASC, col2_6 ASC, col1_8 DESC) STORING (col4_13) WHERE (((((table4.col2_13 = '0001-01-01 00:00:00':::TIMESTAMP) AND (table4.col2_12 >= 'NaN':::FLOAT8)) OR (table4.col1_0 < '-4713-11-24 00:00:00+00:00':::TIMESTAMPTZ)) OR (table4.col2_5 > '"':::STRING)) OR (table4.col2_8 <= 'NaN':::DECIMAL)) AND (table4.col2_10 != 'infinity':::DATE), INDEX (col2_4), FAMILY (col2_4, col2_2, col2_11), FAMILY (col2_12, col2_8, col1_8), FAMILY (col4_13, col2_10), FAMILY (col2_5), FAMILY (col2_7, col1_0), FAMILY (col2_9, col2_6, col2_13)) INTERLEAVE IN PARENT table2 (col1_8, col1_0, col2_7, col2_11, col2_9, col2_10, col2_12, col2_8, col2_2, col2_4, col2_6, col2_13, col2_5);
ALTER TABLE table1 INJECT STATISTICS e'[{"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 213713, "histo_col_type": "", "name": "__auto__", "null_count": 231701, "row_count": 300000}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 221266, "histo_col_type": "", "name": "__auto__", "null_count": 97241, "row_count": 300000}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 246392, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 300000}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 197625, "histo_col_type": "", "name": "__auto__", "null_count": 104635, "row_count": 300000}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3740, "histo_buckets": [{"distinct_range": 0, "num_eq": 80000000000, "num_range": 0, "upper_bound": "\\""}, {"distinct_range": 0, "num_eq": 9139512605645586325, "num_range": 6437320216379520096, "upper_bound": "\'"}, {"distinct_range": 8000000, "num_eq": 200000000, "num_range": 8000000, "upper_bound": "D"}, {"distinct_range": 1260471923114603800, "num_eq": 4950959511147209186, "num_range": 1260471923114603722, "upper_bound": "R"}, {"distinct_range": 527934800819170560, "num_eq": 4427554803497512069, "num_range": 527934800819170569, "upper_bound": "S"}, {"distinct_range": 0, "num_eq": 60000000000, "num_range": 7000000, "upper_bound": "``"}, {"distinct_range": 809943.030495612, "num_eq": 5880372582961361496, "num_range": 3000000, "upper_bound": "|"}], "histo_col_type": "\\"char\\"", "name": "__auto__", "null_count": 188078, "row_count": 300000}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 123797, "histo_col_type": "", "name": "__auto__", "null_count": 76278, "row_count": 300000}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 32413, "histo_col_type": "TIMESTAMP", "name": "__auto__", "null_count": 241792, "row_count": 300000}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 267992, "histo_buckets": [{"distinct_range": 0, "num_eq": 6113874654289737646, "num_range": 0, "upper_bound": "\\\\x0bcacc60"}, {"distinct_range": 4590343.832397514, "num_eq": 100, "num_range": 10000000, "upper_bound": "\\\\x9747a31677936a"}, {"distinct_range": 0, "num_eq": 2000, "num_range": 500000000, "upper_bound": "\\\\xe9abee0bf6de4bbb"}], "histo_col_type": "BYTES", "name": "__auto__", "null_count": 0, "row_count": 300000}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 56174, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 300000}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 111854, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 300000}]':::JSONB;
ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5021061554876171386, "histo_buckets": [{"distinct_range": 0, "num_eq": 200000000, "num_range": 0, "upper_bound": "1930007129"}, {"distinct_range": 8486082749331518000, "num_eq": 800000, "num_range": 8486082749331518195, "upper_bound": "2293354102"}, {"distinct_range": 0, "num_eq": 2192863431993525099, "num_range": 500000, "upper_bound": "2386477305"}], "histo_col_type": "OID", "name": "__auto__", "null_count": 2996175146947955281, "row_count": 6408198823439960842}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3714329409802045697, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6408198823439960842}, {"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3954049000858020137, "histo_col_type": "DECIMAL", "name": "__auto__", "null_count": 535294246185332612, "row_count": 6408198823439960842}, {"columns": ["col2_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1173816067000067196, "histo_col_type": "", "name": "__auto__", "null_count": 2279784717164226111, "row_count": 6408198823439960842}, {"columns": ["col2_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1674585612167991119, "histo_col_type": "", "name": "__auto__", "null_count": 365984455699474985, "row_count": 6408198823439960842}, {"columns": ["col2_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 629946454734486121, "histo_col_type": "", "name": "__auto__", "null_count": 1531427100196418724, "row_count": 6408198823439960842}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3236706431077077123, "histo_col_type": "", "name": "__auto__", "null_count": 671412832090893542, "row_count": 6408198823439960842}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4804915407704562961, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6408198823439960842}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5730569895647047402, "histo_col_type": "", "name": "__auto__", "null_count": 3269948589070692973, "row_count": 6408198823439960842}, {"columns": ["col2_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6351880961327172372, "histo_col_type": "", "name": "__auto__", "null_count": 6179605681577338504, "row_count": 6408198823439960842}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1664586232217771263, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6408198823439960842}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2210095721990663760, "histo_col_type": "", "name": "__auto__", "null_count": 671375208376247805, "row_count": 6408198823439960842}, {"columns": ["col2_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5457327711880888815, "histo_col_type": "", "name": "__auto__", "null_count": 493904582276413434, "row_count": 6408198823439960842}, {"columns": ["col2_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6035436130509207205, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6408198823439960842}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2774494746826234394, "histo_col_type": "BYTES", "name": "__auto__", "null_count": 0, "row_count": 6408198823439960842}]':::JSONB;
ALTER TABLE table3 INJECT STATISTICS e'[{"columns": ["col3_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 278563159673562479, "histo_col_type": "INT2", "name": "__auto__", "null_count": 202292372320528168, "row_count": 355371736676947853}, {"columns": ["col3_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 270611931752480841, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 355371736676947853}, {"columns": ["col3_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 176488314245209764, "histo_col_type": "STRING", "name": "__auto__", "null_count": 0, "row_count": 355371736676947853}, {"columns": ["col3_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 158914094355425772, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 355371736676947853}, {"columns": ["col3_16"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 289314040968151915, "histo_col_type": "", "name": "__auto__", "null_count": 340440251302103561, "row_count": 355371736676947853}, {"columns": ["col3_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 286881633929977231, "histo_col_type": "", "name": "__auto__", "null_count": 346484518355430470, "row_count": 355371736676947853}, {"columns": ["col3_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 13647689973489520, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 355371736676947853}, {"columns": ["col3_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 73366048545711252, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 355371736676947853}, {"columns": ["col3_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 354551436067781134, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 355371736676947853}, {"columns": ["col3_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 266900348418686577, "histo_col_type": "INT2", "name": "__auto__", "null_count": 6011084165210390, "row_count": 355371736676947853}, {"columns": ["col3_17"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 236878694382722257, "histo_buckets": [{"distinct_range": 0, "num_eq": 1000000, "num_range": 0, "upper_bound": "\\u001e"}, {"distinct_range": 85318172087875630, "num_eq": 500000000, "num_range": 382693901181748388, "upper_bound": "2\\u000b\\tFQ\\u0017e\\u0013"}, {"distinct_range": 143.24995046610715, "num_eq": 2000, "num_range": 1000, "upper_bound": "L$0\'V"}, {"distinct_range": 1920342.5773132222, "num_eq": 5941399663428736107, "num_range": 3000000, "upper_bound": "``0"}, {"distinct_range": 19467.891713643756, "num_eq": 965971458707880276, "num_range": 40000, "upper_bound": "b"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 15701052449671680, "row_count": 355371736676947853}, {"columns": ["col3_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 216722089790102817, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 355371736676947853}, {"columns": ["col3_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 25902046507834879, "histo_buckets": [{"distinct_range": 0, "num_eq": 7788181276325376809, "num_range": 0, "upper_bound": "-26966"}, {"distinct_range": 6530644299427490000, "num_eq": 6377200257049493738, "num_range": 6530644299427489455, "upper_bound": "-4822"}, {"distinct_range": 900000, "num_eq": 6080154937954681028, "num_range": 900000, "upper_bound": "-421"}, {"distinct_range": 7565773055049817000, "num_eq": 9000, "num_range": 7565773055049816817, "upper_bound": "-128"}, {"distinct_range": 0, "num_eq": 2854401236778177735, "num_range": 1000, "upper_bound": "1"}, {"distinct_range": 68003.80520059893, "num_eq": 10000, "num_range": 300000, "upper_bound": "546"}, {"distinct_range": 8249008283109063000, "num_eq": 80000000, "num_range": 8249008283109062316, "upper_bound": "2778"}, {"distinct_range": 1468059133765799700, "num_eq": 5206287652564615117, "num_range": 6122238741306847012, "upper_bound": "17935"}], "histo_col_type": "INT2", "name": "__auto__", "null_count": 19406267818196928, "row_count": 355371736676947853}, {"columns": ["col3_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 215026545314244846, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 355371736676947853}, {"columns": ["col3_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 10522714517396714, "histo_col_type": "", "name": "__auto__", "null_count": 315115660237442955, "row_count": 355371736676947853}, {"columns": ["col3_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 297226473064205474, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 355371736676947853}, {"columns": ["col3_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 217149257372253562, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 355371736676947853}, {"columns": ["col3_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 85380607232208686, "histo_col_type": "", "name": "__auto__", "null_count": 238143085473193003, "row_count": 355371736676947853}]':::JSONB;
ALTER TABLE table4 INJECT STATISTICS e'[{"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6621067979278425963, "histo_col_type": "DATE", "name": "__auto__", "null_count": 0, "row_count": 7228550059725204681}, {"columns": ["col2_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6937270248685603133, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7228550059725204681}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3920457954337877738, "histo_col_type": "", "name": "__auto__", "null_count": 3895558096933344423, "row_count": 7228550059725204681}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6624225957405547915, "histo_buckets": [{"distinct_range": 0, "num_eq": 8000, "num_range": 0, "upper_bound": "\\\\x3c"}, {"distinct_range": 4715632871861968000, "num_eq": 5157774336084516223, "num_range": 4715632871861967631, "upper_bound": "\\\\xc51a78"}, {"distinct_range": 0, "num_eq": 768139058823354756, "num_range": 799119065302303416, "upper_bound": "\\\\xc6963c"}, {"distinct_range": 700000, "num_eq": 30000, "num_range": 700000, "upper_bound": "\\\\xe1"}, {"distinct_range": 365782022.66235787, "num_eq": 2302381808614045331, "num_range": 400000000, "upper_bound": "\\\\xe7"}], "histo_col_type": "BYTES", "name": "__auto__", "null_count": 0, "row_count": 7228550059725204681}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5464339699550329311, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7228550059725204681}, {"columns": ["col2_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3507363180420624745, "histo_buckets": [{"distinct_range": 0, "num_eq": 495607421171763773, "num_range": 0, "upper_bound": "1972-02-17"}, {"distinct_range": 5678464309873174000, "num_eq": 7682021605476741375, "num_range": 5678464309873173837, "upper_bound": "1985-08-06"}, {"distinct_range": 0, "num_eq": 3471380687139953278, "num_range": 4000, "upper_bound": "1986-09-12"}, {"distinct_range": 5764708924508802000, "num_eq": 2178101107839698170, "num_range": 5764708924508802320, "upper_bound": "1993-03-24"}], "histo_col_type": "DATE", "name": "__auto__", "null_count": 2273049632703679796, "row_count": 7228550059725204681}, {"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4602130853601637012, "histo_buckets": [{"distinct_range": 0, "num_eq": 70000000000, "num_range": 0, "upper_bound": "-6.268160801592703313E+27"}, {"distinct_range": 0, "num_eq": 3539417761712357060, "num_range": 8860853250910738383, "upper_bound": "-19351623227.7675323"}, {"distinct_range": 3409715572373300700, "num_eq": 6664572333627492411, "num_range": 7039639848233842809, "upper_bound": "-647994510.702261414"}, {"distinct_range": 0, "num_eq": 5741900109744823884, "num_range": 5787453311923263558, "upper_bound": "-6848412.891511646824"}, {"distinct_range": 6860.439180835222, "num_eq": 5811594573482147128, "num_range": 8000, "upper_bound": "-27923.78008567964491"}, {"distinct_range": 3752596629982406000, "num_eq": 1000000, "num_range": 7314325962663295703, "upper_bound": "1.346862941622896031E+19"}, {"distinct_range": 286060970273395900, "num_eq": 2000000, "num_range": 867990470720618506, "upper_bound": "5.872066836293736164E+20"}, {"distinct_range": 2240094750102867500, "num_eq": 8493635847932080998, "num_range": 2642784167611418070, "upper_bound": "6.162449994397007684E+22"}, {"distinct_range": 0, "num_eq": 8004452891328578720, "num_range": 1000000, "upper_bound": "1.135351838268123413E+35"}], "histo_col_type": "DECIMAL", "name": "__auto__", "null_count": 5024174960715824650, "row_count": 7228550059725204681}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4073486256405392651, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7228550059725204681}, {"columns": ["col2_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6067458858396369663, "histo_col_type": "", "name": "__auto__", "null_count": 6184167669301160830, "row_count": 7228550059725204681}, {"columns": ["col2_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2477590184294691961, "histo_buckets": [{"distinct_range": 0, "num_eq": 300000000, "num_range": 0, "upper_bound": "\\u0007\\u0016\\u0002\x7f\\u0013"}, {"distinct_range": 900000000, "num_eq": 541350873994786453, "num_range": 900000000, "upper_bound": "\\u0008\\\\\\u0006HZy"}, {"distinct_range": 333705079053841340, "num_eq": 800, "num_range": 9196618481714045508, "upper_bound": "\\ry"}, {"distinct_range": 40, "num_eq": 6956504054243277263, "num_range": 40, "upper_bound": "\\""}, {"distinct_range": 0, "num_eq": 90, "num_range": 5605637050210555483, "upper_bound": "bv"}, {"distinct_range": 7675741842686176000, "num_eq": 20, "num_range": 7675741842686176206, "upper_bound": "n\\u0007O"}, {"distinct_range": 0, "num_eq": 928380896960056025, "num_range": 0, "upper_bound": "x%\'"}], "histo_col_type": "NAME", "name": "__auto__", "null_count": 2473887797273768198, "row_count": 7228550059725204681}, {"columns": ["col2_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1498218722557263747, "histo_col_type": "", "name": "__auto__", "null_count": 1066648614692389331, "row_count": 7228550059725204681}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7054620834216227297, "histo_col_type": "", "name": "__auto__", "null_count": 3925036905748570205, "row_count": 7228550059725204681}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6224382795047312591, "histo_col_type": "VARCHAR", "name": "__auto__", "null_count": 6619724509445319634, "row_count": 7228550059725204681}, {"columns": ["col4_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2396722735371521717, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7228550059725204681}]':::JSONB;
CREATE TYPE rand_typ_0 AS ENUM ('e', 'd', 'pr', 'um', 'm', 'roawin');
CREATE TYPE rand_typ_1 AS ENUM ('t', 'qfabds', 'uq', 'enc');
CREATE TYPE rand_typ_2 AS ENUM ('qwunk', 'qhwhwm');
;
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
SELECT
g::INT2 AS _int2,
g::INT4 AS _int4,
g::INT8 AS _int8,
g::FLOAT4 AS _float4,
g::FLOAT8 AS _float8,
'2001-01-01'::DATE + g AS _date,
'2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
'2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
g * '1 day'::INTERVAL AS _interval,
g % 2 = 1 AS _bool,
g::DECIMAL AS _decimal,
g::STRING AS _string,
g::STRING::BYTES AS _bytes,
substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
'0.0.0.0'::INET + g AS _inet,
g::STRING::JSONB AS _jsonb,
enum_range('hello'::greeting)[g] as _enum
FROM
generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);
;
rsg_test.go:584:
rsg_test.go:585: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith838587502
--- FAIL: TestRandomSyntaxSQLSmith (300.93s)
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-experience rafiss
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ ec36bc66f5147a8703719a9c890be12dd0c08945:
Random syntax error:
rsg_test.go:763: Crash detected: server panic: driver: bad connection
Query:
SELECT
tab_521217._enum AS col_1263617,
(
WITH
with_213640 (col_1263618)
AS (SELECT * FROM (VALUES ('dg':::rand_typ_0), (NULL), ('dg':::rand_typ_0)) AS tab_521218 (col_1263618))
SELECT
tab_521217._timestamp AS col_1263619
FROM
defaultdb.public.table2@[0] AS tab_521219
WHERE
true
ORDER BY
tab_521219.col2_7 DESC, tab_521219.col2_9 ASC, tab_521219.col2_13 DESC, tab_521219.col2_12 ASC
LIMIT
1:::INT8
)
AS col_1263620,
tab_521217.crdb_internal_mvcc_timestamp AS col_1263621,
(-128):::INT8 AS col_1263622,
tab_521217._int4 AS col_1263623,
CASE WHEN tab_521217._bool THEN tab_521217._int4 ELSE tab_521217._int2 END AS col_1263624,
CASE
WHEN (true AND tab_521217._bool) THEN (-0.14315229654312134):::FLOAT8
ELSE (-1.148481011390686):::FLOAT8
END
AS col_1263625,
tab_521217._float4 AS col_1263626
FROM
defaultdb.public.seed@[0] AS tab_521217
ORDER BY
tab_521217._string DESC
LIMIT
25:::INT8;
Schema:
rsg_test.go:580: To reproduce, use schema:
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
CREATE TABLE table1 (col1_0 REGTYPE NOT NULL, col1_1 TIMESTAMPTZ NOT NULL, col1_2 UUID[] NOT NULL, col1_3 TIMETZ NULL, col1_4 INT8, col1_5 FLOAT8 NOT NULL, col1_6 BIT(37) NOT NULL, col1_7 NAME NOT NULL, col1_8 DATE NOT NULL, col1_9 STRING NOT NULL AS (lower(CAST(col1_0 AS STRING))) VIRTUAL, col1_10 INT8 AS (col1_4 + (-9060135617224834114):::INT8) VIRTUAL, col1_11 STRING NOT NULL AS (lower(CAST(col1_0 AS STRING))) VIRTUAL, col1_12 STRING NOT NULL AS (lower(CAST(col1_6 AS STRING))) STORED);
CREATE TABLE table2 (col2_0 TIMESTAMP, col2_1 GEOGRAPHY NULL, col2_2 TIME, col2_3 GEOMETRY NOT NULL, col2_4 REGCLASS NULL, col2_5 BIT(19) NOT NULL, col2_6 REGPROC NOT NULL, col2_7 TIME NOT NULL, col2_8 OID NOT NULL, col2_9 NAME NOT NULL, col2_10 REGPROC NULL, col2_11 STRING NOT NULL AS (lower(CAST(col2_6 AS STRING))) STORED, col2_12 STRING NOT NULL AS (lower(CAST(col2_3 AS STRING))) VIRTUAL, col2_13 STRING NOT NULL AS (lower(CAST(col2_3 AS STRING))) VIRTUAL, col2_14 STRING NOT NULL AS (lower(CAST(col2_8 AS STRING))) STORED, col2_15 STRING NOT NULL AS (lower(CAST(col2_3 AS STRING))) VIRTUAL, col2_16 STRING NOT NULL AS (lower(col2_9)) STORED, INDEX (col2_0 DESC, col2_11 DESC, col2_5 ASC, col2_9 ASC, col2_13, col2_2 ASC, col2_14 ASC) STORING (col2_3, col2_4, col2_6, col2_10, col2_16), UNIQUE (col2_5));
ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 15065833, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 40000000}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 30770105, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 40000000}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 35470037, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 40000000}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2140954, "histo_col_type": "", "name": "__auto__", "null_count": 6173043, "row_count": 40000000}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 17688410, "histo_col_type": "", "name": "__auto__", "null_count": 35529099, "row_count": 40000000}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4295791, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 40000000}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 44921, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 40000000}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 25090533, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 40000000}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 18134397, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 40000000}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4501948, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 40000000}, {"columns": ["col1_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 13420991, "histo_col_type": "", "name": "__auto__", "null_count": 5982243, "row_count": 40000000}, {"columns": ["col1_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 29689766, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 40000000}, {"columns": ["col1_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6710974, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 40000000}]':::JSONB;
ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 898204880478803345, "histo_col_type": "", "name": "__auto__", "null_count": 799205811295954550, "row_count": 1182186826396369662}, {"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 818187002025383776, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1182186826396369662}, {"columns": ["col2_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1036716418274580302, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1182186826396369662}, {"columns": ["col2_16"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 119519844666929614, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1182186826396369662}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1084042781463255310, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1182186826396369662}, {"columns": ["col2_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 392331508777926947, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1182186826396369662}, {"columns": ["col2_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 391943887245685361, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1182186826396369662}, {"columns": ["col2_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 677203783409771215, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1182186826396369662}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 489321959096312088, "histo_buckets": [{"distinct_range": 0, "num_eq": 4295745101203810744, "num_range": 0, "upper_bound": "1973-01-27 03:58:04.000997"}, {"distinct_range": 26123682.999346763, "num_eq": 50, "num_range": 30000000, "upper_bound": "1998-03-11 14:48:38.00083"}, {"distinct_range": 0, "num_eq": 7000000000, "num_range": 8371464672553247870, "upper_bound": "2000-12-07 02:03:34.00074"}, {"distinct_range": 598106978246099300, "num_eq": 1992973599535123620, "num_range": 7463043698889700180, "upper_bound": "2008-04-13 06:13:30.000864"}, {"distinct_range": 5697051806639911000, "num_eq": 90000, "num_range": 5697051806639911056, "upper_bound": "2018-03-08 08:42:54.000891"}, {"distinct_range": 30000000, "num_eq": 3000000, "num_range": 30000000, "upper_bound": "2027-04-12 15:05:35.00027"}], "histo_col_type": "TIMESTAMP", "name": "__auto__", "null_count": 257404430072877957, "row_count": 1182186826396369662}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 709553892702845575, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1182186826396369662}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 132930701201209950, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1182186826396369662}, {"columns": ["col2_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 931261079240843620, "histo_col_type": "", "name": "__auto__", "null_count": 661385825071759671, "row_count": 1182186826396369662}, {"columns": ["col2_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 253434897866305097, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1182186826396369662}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 106964388668692209, "histo_col_type": "", "name": "__auto__", "null_count": 672800627367924686, "row_count": 1182186826396369662}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 725724051641557849, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1182186826396369662}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 279000091659206104, "histo_col_type": "", "name": "__auto__", "null_count": 781055332199589389, "row_count": 1182186826396369662}, {"columns": ["col2_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 256742499702718906, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1182186826396369662}]':::JSONB;
ALTER TABLE table1 ADD FOREIGN KEY (col1_6) REFERENCES table2 (col2_5);
CREATE TYPE rand_typ_0 AS ENUM ('dg');
CREATE TYPE rand_typ_1 AS ENUM ('lm', 'd', 'cdrf', 'bq', 'o');
CREATE TYPE rand_typ_2 AS ENUM ('ffmray', 'lpjrj', 'rtn', 'il');
CREATE TYPE rand_typ_3 AS ENUM ('yk');
;
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
SELECT
g::INT2 AS _int2,
g::INT4 AS _int4,
g::INT8 AS _int8,
g::FLOAT4 AS _float4,
g::FLOAT8 AS _float8,
'2001-01-01'::DATE + g AS _date,
'2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
'2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
g * '1 day'::INTERVAL AS _interval,
g % 2 = 1 AS _bool,
g::DECIMAL AS _decimal,
g::STRING AS _string,
g::STRING::BYTES AS _bytes,
substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
'0.0.0.0'::INET + g AS _inet,
g::STRING::JSONB AS _jsonb,
enum_range('hello'::greeting)[g] as _enum
FROM
generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);
;
rsg_test.go:584:
rsg_test.go:585: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith480601633
--- FAIL: TestRandomSyntaxSQLSmith (300.76s)
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-experience rafiss
@RaduBerinde I'm assigning this to you since you'll be working on avoiding unbounded exploration. This comment describes the original issue that caused the timeout here.
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ f56208a85ed0ac6519f648dde14e46d63d13f284:
Random syntax error:
rsg_test.go:763: Crash detected: server panic: statement exec timeout
Query:
SELECT
604208860721384.5628:::DECIMAL AS col_1098710
FROM
defaultdb.public.table1@table1_col1_5_col1_8_col1_6_col1_2_key AS tab_454073
JOIN defaultdb.public.table1 AS tab_454074
JOIN defaultdb.public.table1 AS tab_454075 ON (tab_454074.col1_5) = (tab_454075.col1_5) ON
(tab_454073.col1_8) = (tab_454075.col1_8)
AND (tab_454073.col1_9) = (tab_454074.col1_8)
AND (tab_454073.col1_10) = (tab_454074.col1_8)
AND (tab_454073.col1_9) = (tab_454075.col1_8)
JOIN defaultdb.public.table1@table1_col1_5_col1_8_col1_6_col1_2_key AS tab_454076 ON
(tab_454075.col1_8) = (tab_454076.col1_3) AND (tab_454073.col1_8) = (tab_454076.col1_9)
JOIN defaultdb.public.table1@[0] AS tab_454077
JOIN defaultdb.public.table1@[0] AS tab_454078 ON
(tab_454077.col1_10) = (tab_454078.col1_10) AND (tab_454077.col1_7) = (tab_454078.col1_3) ON
(tab_454073.col1_9) = (tab_454077.col1_10)
JOIN defaultdb.public.table1@[0] AS tab_454082
JOIN defaultdb.public.seed@seed__int8__float8__date_idx AS tab_454083 ON
(tab_454082.crdb_internal_mvcc_timestamp) = (tab_454083._decimal) ON
(tab_454077.col1_7) = (tab_454083._string) AND (tab_454073.col1_10) = (tab_454082.col1_7)
JOIN defaultdb.public.seed@seed__int8__float8__date_idx AS tab_454084
JOIN defaultdb.public.seed@seed__int8__float8__date_idx AS tab_454085
JOIN defaultdb.public.seed@seed__int8__float8__date_idx AS tab_454086 ON
(tab_454085._int4) = (tab_454086._int2) ON (tab_454084._int8) = (tab_454086._int8) ON
(tab_454073.col1_3) = (tab_454086._string),
defaultdb.public.table1@table1_col1_5_col1_8_col1_6_col1_2_key AS tab_454087
WHERE
tab_454086._bool
ORDER BY
tab_454076.col1_10 DESC
LIMIT
30:::INT8;
Schema:
rsg_test.go:580: To reproduce, use schema:
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
CREATE TABLE table1 (col1_0 TIMESTAMPTZ NOT NULL, col1_1 GEOMETRY NULL, col1_2 DECIMAL NOT NULL, col1_3 "char" NOT NULL, col1_4 INTERVAL NULL, col1_5 REGCLASS NOT NULL, col1_6 INT4 NOT NULL, PRIMARY KEY (col1_5 DESC, col1_2 DESC, col1_0 DESC, col1_3 ASC), col1_7 STRING NOT NULL AS (lower(CAST(col1_5 AS STRING))) STORED, col1_8 STRING NULL AS (lower(CAST(col1_1 AS STRING))) STORED, col1_9 STRING NULL AS (lower(CAST(col1_1 AS STRING))) STORED, col1_10 STRING NOT NULL AS (lower(CAST(col1_5 AS STRING))) VIRTUAL, UNIQUE (col1_5, col1_8 ASC, col1_6, col1_2 ASC) STORING (col1_1));
ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2027628486215114771, "histo_buckets": [{"distinct_range": 0, "num_eq": 800, "num_range": 0, "upper_bound": "0"}, {"distinct_range": 450914002502352500, "num_eq": 8211032018351762525, "num_range": 450914002502352498, "upper_bound": "246454285"}, {"distinct_range": 192082.03113300484, "num_eq": 549140498236793954, "num_range": 200000, "upper_bound": "1026861022"}, {"distinct_range": 96624867989403170, "num_eq": 10, "num_range": 6413677998962632612, "upper_bound": "2088874487"}, {"distinct_range": 6000, "num_eq": 1482573730516948112, "num_range": 6000, "upper_bound": "2705485223"}, {"distinct_range": 50000000, "num_eq": 3133072919936361208, "num_range": 50000000, "upper_bound": "3149922207"}, {"distinct_range": 0, "num_eq": 3884849304896859862, "num_range": 8684023894723547115, "upper_bound": "3351407004"}, {"distinct_range": 1045331394755158900, "num_eq": 9184994377661863378, "num_range": 6553743391379490603, "upper_bound": "3746382594"}, {"distinct_range": 10000000, "num_eq": 20000000, "num_range": 10000000, "upper_bound": "3921391573"}], "histo_col_type": "REGCLASS", "name": "__auto__", "null_count": 0, "row_count": 7095227084021491493}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4527028105744925974, "histo_col_type": "", "name": "__auto__", "null_count": 6294129930859129207, "row_count": 7095227084021491493}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6762430070525460283, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7095227084021491493}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3831952551436703545, "histo_col_type": "", "name": "__auto__", "null_count": 1222245675373556980, "row_count": 7095227084021491493}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3689055636997831927, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7095227084021491493}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6432856863864378412, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7095227084021491493}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6727017247020572836, "histo_col_type": "", "name": "__auto__", "null_count": 3919225229638700311, "row_count": 7095227084021491493}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 156358513723084379, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7095227084021491493}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5501717241552977444, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7095227084021491493}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1654244971279293196, "histo_col_type": "", "name": "__auto__", "null_count": 773207451093614938, "row_count": 7095227084021491493}, {"columns": ["col1_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6059649711781239955, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7095227084021491493}]':::JSONB;
CREATE TYPE rand_typ_0 AS ENUM ('aflbjy', 'edgu', 'mti', 'i');
CREATE TYPE rand_typ_1 AS ENUM ('zncwi');
;
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
SELECT
g::INT2 AS _int2,
g::INT4 AS _int4,
g::INT8 AS _int8,
g::FLOAT4 AS _float4,
g::FLOAT8 AS _float8,
'2001-01-01'::DATE + g AS _date,
'2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
'2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
g * '1 day'::INTERVAL AS _interval,
g % 2 = 1 AS _bool,
g::DECIMAL AS _decimal,
g::STRING AS _string,
g::STRING::BYTES AS _bytes,
substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
'0.0.0.0'::INET + g AS _inet,
g::STRING::JSONB AS _jsonb,
enum_range('hello'::greeting)[g] as _enum
FROM
generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);
;
rsg_test.go:584:
rsg_test.go:585: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith063770416
--- FAIL: TestRandomSyntaxSQLSmith (300.68s)
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-experience rafiss
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ 1b686aef9949c1c7ef930b55bd1fbc0ed2e8268a:
Random syntax error:
rsg_test.go:763: Crash detected: server panic: statement exec timeout
Query:
SELECT
(-0.43123690468441056):::FLOAT8 AS col_871066,
tab_363784._float4 AS col_871067,
NULL AS col_871068,
NULL AS col_871069,
tab_363792._int4 AS col_871070,
'2029-07-12 00:50:26.000865+00:00':::TIMESTAMPTZ AS col_871071,
NULL AS col_871072
FROM
defaultdb.public.seed@seed__int8__float8__date_idx AS tab_363784
JOIN defaultdb.public.seed AS tab_363785
JOIN defaultdb.public.seed AS tab_363786 ON (tab_363785._jsonb) = (tab_363786._jsonb) ON
(tab_363784._jsonb) = (tab_363786._jsonb)
JOIN defaultdb.public.seed@[0] AS tab_363787
JOIN defaultdb.public.seed@[0] AS tab_363788
JOIN defaultdb.public.table2@[0] AS tab_363789 ON
(tab_363788._string) = (tab_363789.col1_1) AND (tab_363788.tableoid) = (tab_363789.col2_16) ON
(tab_363787._float4) = (tab_363788._float4)
AND (tab_363787._int2) = (tab_363789.col2_14)
AND (tab_363787._timestamptz) = (tab_363788._timestamptz)
JOIN defaultdb.public.seed@[0] AS tab_363792
JOIN defaultdb.public.seed@seed__int8__float8__date_idx AS tab_363793 ON
(tab_363792._int4) = (tab_363793._int8) AND (tab_363792._uuid) = (tab_363793._uuid) ON
(tab_363787._int8) = (tab_363792._int2) ON
(tab_363784._timestamp) = (tab_363792._timestamp)
AND (tab_363784.tableoid) = (tab_363789.col2_10)
AND (tab_363784._string) = (tab_363787._string)
WHERE
tab_363789.col2_12::STRING
IN (
SELECT
'Hd)1S%%':::STRING::STRING AS col_871065
FROM
defaultdb.public.seed@seed__int8__float8__date_idx AS tab_363794
WHERE
true
ORDER BY
tab_363794._inet DESC
LIMIT
99:::INT8
)
ORDER BY
tab_363787._decimal
LIMIT
58:::INT8;
Schema:
rsg_test.go:580: To reproduce, use schema:
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
CREATE TABLE table1 (col1_0 TIMETZ NOT NULL, col1_1 "char" NOT NULL, col1_2 REGTYPE NOT NULL, col1_3 INET, col1_4 "char" NOT NULL, col1_5 JSONB NOT NULL, col1_6 INT8 NOT NULL, PRIMARY KEY (col1_1 DESC, col1_6 ASC, col1_0 DESC, col1_2), col1_7 STRING NOT NULL AS (lower(col1_4)) STORED, INDEX (col1_2 DESC, col1_1) STORING (col1_4) WHERE ((((table1.col1_4 != e'\x00':::STRING) OR (table1.col1_0 > '24:00:00-15:59:00':::TIMETZ)) AND (table1.col1_6 > 127:::INT8)) OR (table1.col1_1 > '"':::STRING)) OR (table1.col1_7 >= 'X':::STRING), INDEX (col1_1 DESC) STORING (col1_5, col1_7), INVERTED INDEX (col1_4 DESC, col1_7 DESC, col1_3, col1_0 DESC, col1_6 ASC, col1_5) WHERE ((((table1.col1_0 = '00:00:00+15:59:00':::TIMETZ) AND (table1.col1_1 > e'\x00':::STRING)) OR (table1.col1_7 = e'\x00':::STRING)) AND (table1.col1_4 >= e'\x00':::STRING)) AND (table1.col1_6 >= 32767:::INT8));
CREATE TABLE table2 (col1_1 "char" NOT NULL, col1_6 INT8 NOT NULL, col1_0 TIMETZ NOT NULL, col1_2 REGTYPE NOT NULL, col2_4 INT4, col2_5 INET NOT NULL, col2_6 DATE, col2_7 REGPROCEDURE NOT NULL, col2_8 TIMESTAMP NULL, col2_9 OID NOT NULL, col2_10 OID NOT NULL, col2_11 TIMESTAMPTZ NULL, col2_12 VARCHAR NOT NULL, col2_13 DATE NULL, col2_14 INT8 NOT NULL, col2_15 "char" NOT NULL, col2_16 OID NULL, col2_17 FLOAT8 NOT NULL, col2_18 CHAR, col2_19 REGPROCEDURE, col2_20 INTERVAL NOT NULL, PRIMARY KEY (col1_1 DESC, col1_6 ASC, col1_0 DESC, col1_2, col2_8 ASC, col2_16, col2_6, col2_4 DESC, col2_19, col2_10, col2_18 ASC, col2_17, col2_20, col2_9 ASC, col2_11 ASC), FAMILY (col2_16, col2_20), FAMILY (col2_17), FAMILY (col1_0), FAMILY (col2_6, col2_18, col1_1), FAMILY (col2_4), FAMILY (col2_12), FAMILY (col2_14), FAMILY (col2_15), FAMILY (col2_11, col2_19), FAMILY (col1_6, col1_2), FAMILY (col2_7), FAMILY (col2_13, col2_5, col2_8), FAMILY (col2_9, col2_10)) INTERLEAVE IN PARENT table1 (col1_1, col1_6, col1_0, col1_2);
ALTER TABLE table1 INJECT STATISTICS e'[{"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_buckets": [{"distinct_range": 0, "num_eq": 900, "num_range": 0, "upper_bound": "\\\\"}], "histo_col_type": "\\"char\\"", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}]':::JSONB;
ALTER TABLE table2 INJECT STATISTICS e'[{"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2339324590402029858, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 3212587792901331001}, {"columns": ["col2_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1568502172789909200, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 3212587792901331001}, {"columns": ["col2_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1534101737607112944, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 3212587792901331001}, {"columns": ["col2_18"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1228776266072527768, "histo_col_type": "", "name": "__auto__", "null_count": 1980953697734059750, "row_count": 3212587792901331001}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 57824159736051761, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 3212587792901331001}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1847172728517855416, "histo_col_type": "", "name": "__auto__", "null_count": 507155630316812064, "row_count": 3212587792901331001}, {"columns": ["col2_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2613129577965065438, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 3212587792901331001}, {"columns": ["col2_16"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2754150589909557224, "histo_col_type": "", "name": "__auto__", "null_count": 2228201650725428174, "row_count": 3212587792901331001}, {"columns": ["col2_19"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3023571203834895239, "histo_col_type": "", "name": "__auto__", "null_count": 182820070020279204, "row_count": 3212587792901331001}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 342238235510632534, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 3212587792901331001}, {"columns": ["col2_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 118579621123099163, "histo_col_type": "", "name": "__auto__", "null_count": 2495698323529997778, "row_count": 3212587792901331001}, {"columns": ["col2_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 116776836051188728, "histo_col_type": "", "name": "__auto__", "null_count": 278515902785862392, "row_count": 3212587792901331001}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 889143793205621347, "histo_col_type": "", "name": "__auto__", "null_count": 2544099598011793602, "row_count": 3212587792901331001}, {"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 910454538931244766, "histo_col_type": "", "name": "__auto__", "null_count": 2266184259487959936, "row_count": 3212587792901331001}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2166561445547528421, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 3212587792901331001}, {"columns": ["col2_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1672572822148352426, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 3212587792901331001}, {"columns": ["col2_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 508204382028491511, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 3212587792901331001}, {"columns": ["col2_17"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1146016176950229066, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 3212587792901331001}, {"columns": ["col2_20"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1610174122075413864, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 3212587792901331001}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1240930975689756885, "histo_buckets": [{"distinct_range": 0, "num_eq": 2523233555347762396, "num_range": 0, "upper_bound": "\\t"}, {"distinct_range": 0, "num_eq": 4000000000, "num_range": 20000, "upper_bound": "&"}, {"distinct_range": 0, "num_eq": 80000000, "num_range": 1000000, "upper_bound": "d"}], "histo_col_type": "\\"char\\"", "name": "__auto__", "null_count": 0, "row_count": 3212587792901331001}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2455529914253430266, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 3212587792901331001}]':::JSONB;
CREATE TYPE rand_typ_0 AS ENUM ('awr');
CREATE TYPE rand_typ_1 AS ENUM ('qsze', 'acs', 'airyur', 'b');
;
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
SELECT
g::INT2 AS _int2,
g::INT4 AS _int4,
g::INT8 AS _int8,
g::FLOAT4 AS _float4,
g::FLOAT8 AS _float8,
'2001-01-01'::DATE + g AS _date,
'2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
'2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
g * '1 day'::INTERVAL AS _interval,
g % 2 = 1 AS _bool,
g::DECIMAL AS _decimal,
g::STRING AS _string,
g::STRING::BYTES AS _bytes,
substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
'0.0.0.0'::INET + g AS _inet,
g::STRING::JSONB AS _jsonb,
enum_range('hello'::greeting)[g] as _enum
FROM
generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);
;
rsg_test.go:584:
rsg_test.go:585: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith173197316
--- FAIL: TestRandomSyntaxSQLSmith (300.72s)
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-experience rafiss
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ b35fe177c0fb6bf58ba00357e152ecaf6c1e0a2a:
Fatal error:
panic: runtime error: index out of range [0] with length 0
Stack:
goroutine 9636910 [running]:
github.com/cockroachdb/cockroach/pkg/internal/sqlsmith.makeMergeJoinExpr.func1(0xc02a3e0a80, 0xc010f4f6c0, 0xc01397fd10, 0xc01b5e3470, 0xc01b5e34a8, 0x0, 0x0, 0x0, 0x0)
/go/src/github.com/cockroachdb/cockroach/pkg/internal/sqlsmith/relational.go:288 +0x870
github.com/cockroachdb/cockroach/pkg/internal/sqlsmith.makeMergeJoinExpr(0xc02a3e0a80, 0x0, 0x0, 0x0, 0x1, 0x64d3980, 0xc01397fcc0, 0xc037b09c80, 0xc, 0xc, ...)
/go/src/github.com/cockroachdb/cockroach/pkg/internal/sqlsmith/relational.go:323 +0x26b
github.com/cockroachdb/cockroach/pkg/internal/sqlsmith.makeTableExpr(0xc02a3e0a80, 0x0, 0x0, 0x0, 0x1, 0x64d3980, 0xc01397fcc0, 0xc037b09c80, 0xc, 0xc, ...)
/go/src/github.com/cockroachdb/cockroach/pkg/internal/sqlsmith/relational.go:144 +0xb0
github.com/cockroachdb/cockroach/pkg/internal/sqlsmith.makeEquiJoinExpr(0xc02a3e0a80, 0x0, 0x0, 0x0, 0xc002b92000, 0x10e0fb759d0d11c2, 0x1, 0xc01b5e37f8, 0x41a5962, 0xc00f292378, ...)
/go/src/github.com/cockroachdb/cockroach/pkg/internal/sqlsmith/relational.go:208 +0xeb
github.com/cockroachdb/cockroach/pkg/internal/sqlsmith.makeTableExpr(0xc02a3e0a80, 0x0, 0x0, 0x0, 0x0, 0xc008f5b8f0, 0x0, 0x1, 0xd, 0xd, ...)
/go/src/github.com/cockroachdb/cockroach/pkg/internal/sqlsmith/relational.go:144 +0xb0
github.com/cockroachdb/cockroach/pkg/internal/sqlsmith.(*Smither).makeSelectClause(0xc02a3e0a80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/go/src/github.com/cockroachdb/cockroach/pkg/internal/sqlsmith/relational.go:521 +0x16a
github.com/cockroachdb/cockroach/pkg/internal/sqlsmith.(*Smither).makeSelect(0xc02a3e0a80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x47d5480, 0x100000001, 0xc01b5e3d00, ...)
/go/src/github.com/cockroachdb/cockroach/pkg/internal/sqlsmith/relational.go:726 +0xcf
github.com/cockroachdb/cockroach/pkg/internal/sqlsmith.makeSelect(0xc02a3e0a80, 0x56062f0, 0xc03dc1d2c0, 0xc037b09920)
/go/src/github.com/cockroachdb/cockroach/pkg/internal/sqlsmith/relational.go:679 +0x52
github.com/cockroachdb/cockroach/pkg/internal/sqlsmith.(*Smither).makeStmt(0xc02a3e0a80, 0xc03dc1d2c0, 0x8, 0x47d5480)
/go/src/github.com/cockroachdb/cockroach/pkg/internal/sqlsmith/relational.go:20 +0x45
github.com/cockroachdb/cockroach/pkg/internal/sqlsmith.(*Smither).Generate(0xc02a3e0a80, 0x0, 0x45ffaa0)
/go/src/github.com/cockroachdb/cockroach/pkg/internal/sqlsmith/sqlsmith.go:158 +0x36
github.com/cockroachdb/cockroach/pkg/sql/tests_test.TestRandomSyntaxSQLSmith.func2(0x65011e8, 0xc010a5aa40, 0xc01844e3f0, 0xc007cc1be0, 0x0, 0x0)
/go/src/github.com/cockroachdb/cockroach/pkg/sql/tests/rsg_test.go:554 +0x4e
github.com/cockroachdb/cockroach/pkg/sql/tests_test.testRandomSyntax.func3(0x65011e8, 0xc010a5aa40, 0x5, 0x12d32e2, 0x6501220)
/go/src/github.com/cockroachdb/cockroach/pkg/sql/tests/rsg_test.go:753 +0xc7
github.com/cockroachdb/cockroach/pkg/util/ctxgroup.GroupWorkers.func1(0x65011e8, 0xc010a5aa40, 0xc01783c380, 0x560b598)
/go/src/github.com/cockroachdb/cockroach/pkg/util/ctxgroup/ctxgroup.go:175 +0x42
github.com/cockroachdb/cockroach/pkg/util/ctxgroup.Group.GoCtx.func1(0xc024f00d90, 0x560b518)
/go/src/github.com/cockroachdb/cockroach/pkg/util/ctxgroup/ctxgroup.go:166 +0x3a
golang.org/x/sync/errgroup.(*Group).Go.func1(0xc003b8cc00, 0xc003b8cd20)
/go/src/github.com/cockroachdb/cockroach/vendor/golang.org/x/sync/errgroup/errgroup.go:57 +0x59
created by golang.org/x/sync/errgroup.(*Group).Go
/go/src/github.com/cockroachdb/cockroach/vendor/golang.org/x/sync/errgroup/errgroup.go:54 +0x66
``` === RUN TestRandomSyntaxSQLSmith test_log_scope.go:73: test logs captured to: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith745841943 test_log_scope.go:74: use -show-logs to present logs inline rsg_test.go:548: SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true; SET enable_drop_enum_value = true; SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false; SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false; SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true; CREATE TABLE table1 (col1_0 REGCLASS NOT NULL, col1_1 INT4 NOT NULL, PRIMARY KEY (col1_0, col1_1 ASC), INDEX (col1_1 ASC), INDEX (col1_1 ASC, col1_0), UNIQUE (col1_1 ASC), INDEX (col1_1 ASC), INDEX (col1_0 DESC, col1_1 ASC) WHERE table1.col1_1 > (-2147483648):::INT8, FAMILY (col1_0), FAMILY (col1_1)); CREATE TABLE table2 (col1_0 REGCLASS NOT NULL, col1_1 INT4 NOT NULL, col2_2 FLOAT8 NULL, col2_3 STRING NOT NULL, col2_4 REGPROCEDURE NULL, col2_5 NAME, col2_6 FLOAT8 NOT NULL, col2_7 INT4, col2_8 DATE NOT NULL, col2_9 INT4 NULL, col2_10 TIMESTAMP NULL, PRIMARY KEY (col1_0, col1_1 ASC, col2_3 DESC, col2_2 DESC, col2_6 ASC), UNIQUE (col2_10 DESC, col2_9 DESC, col2_2 DESC, col2_5, col2_7 ASC, col1_0 ASC, col2_6 ASC, col2_4 ASC, col2_8 ASC, col2_3 ASC) WHERE ((((((((table2.col1_1 >= (-128):::INT8) OR (table2.col2_6 >= 1.7976931348623157e+308:::FLOAT8)) AND (table2.col2_8 > '1970-01-01':::DATE)) AND (table2.col2_7 = 127:::INT8)) AND (table2.col2_3 >= e'\'':::STRING)) OR (table2.col2_10 = '3000-01-01 00:00:00':::TIMESTAMP)) OR (table2.col2_5 = e'\'':::STRING)) OR (table2.col2_9 = (-1):::INT8)) OR (table2.col2_2 >= '-Inf':::FLOAT8), INDEX (col2_6 ASC, col2_3 ASC, col1_1 DESC, col1_0 DESC, col2_4, col2_2 DESC, col2_5, col2_7 ASC) STORING (col2_8, col2_10) WHERE table2.col2_2 >= 'NaN':::FLOAT8, INDEX (col2_10 DESC, col2_5, col1_1 DESC) STORING (col2_8), UNIQUE (col2_9 ASC, col2_3, col2_2, col2_7 ASC, col1_0 ASC, col2_4 ASC, col2_10), UNIQUE (col2_7 DESC, col2_4), INDEX (col1_0 DESC, col2_9, col2_7 DESC, col2_8 ASC, col2_10 DESC) STORING (col2_4, col2_5) WHERE ((table2.col1_1 != (-1):::INT8) OR (table2.col2_7 < 0:::INT8)) OR (table2.col2_6 < (-1.0):::FLOAT8), UNIQUE (col2_6 ASC, col2_4, col2_3, col1_0 ASC, col2_7 ASC, col2_2 ASC, col2_9 DESC), FAMILY (col2_5), FAMILY (col1_0), FAMILY (col2_8), FAMILY (col1_1, col2_9), FAMILY (col2_7), FAMILY (col2_6), FAMILY (col2_10), FAMILY (col2_4, col2_2), FAMILY (col2_3)) INTERLEAVE IN PARENT table1 (col1_0, col1_1); CREATE TABLE table3 (col3_0 INT2, col3_1 "char", col3_2 BYTES[] NOT NULL, col3_3 UUID[] NULL, col3_4 FLOAT4 NULL, col3_5 REGPROC NOT NULL, col3_6 INT8 NOT NULL, col3_7 JSONB NULL, col3_8 INT8 AS (col3_6 + col3_0) VIRTUAL, col3_9 STRING NULL AS (lower(CAST(col3_7 AS STRING))) VIRTUAL, FAMILY (col3_7, col3_4), FAMILY (col3_1), FAMILY (col3_0, col3_5), FAMILY (col3_6, col3_2, col3_3)); ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 52049301808, "histo_buckets": [{"distinct_range": 0, "num_eq": 600, "num_range": 0, "upper_bound": "3664755361"}], "histo_col_type": "REGCLASS", "name": "__auto__", "null_count": 0, "row_count": 80000000000}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 34174492078, "histo_buckets": [{"distinct_range": 0, "num_eq": 2605206165814917689, "num_range": 0, "upper_bound": "-1121305935"}, {"distinct_range": 7478007435518988000, "num_eq": 474013427834927526, "num_range": 8738654739853837531, "upper_bound": "-443104842"}, {"distinct_range": 8352910339.253192, "num_eq": 40, "num_range": 20000000000, "upper_bound": "-52909086"}, {"distinct_range": 8576737.875663357, "num_eq": 6337933680977759100, "num_range": 50000000, "upper_bound": "-1"}, {"distinct_range": 21.778315730681307, "num_eq": 1846805823779386495, "num_range": 80, "upper_bound": "201985726"}, {"distinct_range": 763436841.2703108, "num_eq": 859945526659689921, "num_range": 900000000, "upper_bound": "505521117"}, {"distinct_range": 70000000000, "num_eq": 5547350821180613727, "num_range": 70000000000, "upper_bound": "1543991976"}], "histo_col_type": "INT4", "name": "__auto__", "null_count": 0, "row_count": 80000000000}]':::JSONB; ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1308748519, "histo_col_type": "", "name": "__auto__", "null_count": 1014245585, "row_count": 2000000000}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1294330714, "histo_col_type": "", "name": "__auto__", "null_count": 933669012, "row_count": 2000000000}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 912698300, "histo_buckets": [{"distinct_range": 0, "num_eq": 4251038544502457733, "num_range": 0, "upper_bound": "-1.1747571341889012"}, {"distinct_range": 0, "num_eq": 1000, "num_range": 2000, "upper_bound": "-0.6130681559818746"}, {"distinct_range": 900, "num_eq": 714352917169649223, "num_range": 900, "upper_bound": "5e-324"}, {"distinct_range": 15349.920723600497, "num_eq": 20000, "num_range": 50000, "upper_bound": "0.4893426804576606"}, {"distinct_range": 9024119049006889000, "num_eq": 5355895785638363664, "num_range": 9024119049006889385, "upper_bound": "0.5208412815238861"}, {"distinct_range": 0, "num_eq": 20000000, "num_range": 9000, "upper_bound": "0.6864605379687543"}, {"distinct_range": 3241307830173698000, "num_eq": 2880380914518900514, "num_range": 6797527210699360718, "upper_bound": "0.8260259820701619"}], "histo_col_type": "FLOAT8", "name": "__auto__", "null_count": 0, "row_count": 2000000000}, {"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 361317125, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2000000000}, {"columns": ["col2_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 467947344, "histo_buckets": [{"distinct_range": 0, "num_eq": 8718907994072695398, "num_range": 0, "upper_bound": "-185675273"}, {"distinct_range": 6995681772505415000, "num_eq": 3089214896999728362, "num_range": 6995681772505414666, "upper_bound": "2146523407"}], "histo_col_type": "INT4", "name": "__auto__", "null_count": 148320869, "row_count": 2000000000}, {"columns": ["col2_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1424937387, "histo_col_type": "", "name": "__auto__", "null_count": 1715546590, "row_count": 2000000000}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 346833084, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2000000000}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1310670158, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2000000000}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1874861074, "histo_col_type": "", "name": "__auto__", "null_count": 124486130, "row_count": 2000000000}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 36817326, "histo_buckets": [{"distinct_range": 0, "num_eq": 8404774626016933030, "num_range": 0, "upper_bound": "-1533382996"}, {"distinct_range": 0, "num_eq": 1438981592521461466, "num_range": 6851242205781263645, "upper_bound": "-1490929108"}, {"distinct_range": 0, "num_eq": 320155848423072367, "num_range": 70000000, "upper_bound": "-676383201"}, {"distinct_range": 3881375013668625400, "num_eq": 6097677450314485908, "num_range": 6470155260102966166, "upper_bound": "-1"}, {"distinct_range": 200000000, "num_eq": 0, "num_range": 200000000, "upper_bound": "994990937"}, {"distinct_range": 0.30328504271245543, "num_eq": 3119638178118617670, "num_range": 20, "upper_bound": "1264496595"}, {"distinct_range": 80000000, "num_eq": 6696547686157846403, "num_range": 80000000, "upper_bound": "1317364118"}], "histo_col_type": "INT4", "name": "__auto__", "null_count": 1912819626, "row_count": 2000000000}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1448610949, "histo_buckets": [{"distinct_range": 0, "num_eq": 20000000000, "num_range": 0, "upper_bound": "0"}, {"distinct_range": 0, "num_eq": 0, "num_range": 0, "upper_bound": "834191807"}, {"distinct_range": 5087847707346818000, "num_eq": 1124853437926949818, "num_range": 5087847707346817626, "upper_bound": "3964614633"}, {"distinct_range": 0, "num_eq": 2970830586319093335, "num_range": 121715666673447148, "upper_bound": "4178776979"}], "histo_col_type": "REGCLASS", "name": "__auto__", "null_count": 0, "row_count": 2000000000}]':::JSONB; ALTER TABLE table3 INJECT STATISTICS '[{"columns": ["col3_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 44663627, "histo_col_type": "", "name": "__auto__", "null_count": 10647797, "row_count": 50000000}, {"columns": ["col3_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 12784422, "histo_col_type": "", "name": "__auto__", "null_count": 12104011, "row_count": 50000000}, {"columns": ["col3_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 24149665, "histo_col_type": "", "name": "__auto__", "null_count": 24124621, "row_count": 50000000}, {"columns": ["col3_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 44941455, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 50000000}, {"columns": ["col3_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 45457201, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 50000000}, {"columns": ["col3_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 18179209, "histo_col_type": "", "name": "__auto__", "null_count": 17115177, "row_count": 50000000}, {"columns": ["col3_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 24254047, "histo_col_type": "", "name": "__auto__", "null_count": 48609472, "row_count": 50000000}, {"columns": ["col3_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 9768284, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 50000000}, {"columns": ["col3_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 34051507, "histo_col_type": "", "name": "__auto__", "null_count": 34057066, "row_count": 50000000}, {"columns": ["col3_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 29697992, "histo_col_type": "", "name": "__auto__", "null_count": 47936323, "row_count": 50000000}]':::JSONB; CREATE TYPE rand_typ_0 AS ENUM ('b', 'l', 'leeatp', 'axlf', 'pnpmd'); ; rsg_test.go:548: SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true; SET enable_drop_enum_value = true; CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning'); CREATE TABLE IF NOT EXISTS seed AS SELECT g::INT2 AS _int2, g::INT4 AS _int4, g::INT8 AS _int8, g::FLOAT4 AS _float4, g::FLOAT8 AS _float8, '2001-01-01'::DATE + g AS _date, '2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp, '2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz, g * '1 day'::INTERVAL AS _interval, g % 2 = 1 AS _bool, g::DECIMAL AS _decimal, g::STRING AS _string, g::STRING::BYTES AS _bytes, substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid, '0.0.0.0'::INET + g AS _inet, g::STRING::JSONB AS _jsonb, enum_range('hello'::greeting)[g] as _enum FROM generate_series(1, 5) AS g; INSERT INTO seed DEFAULT VALUES; CREATE INDEX on seed (_int8, _float8, _date); CREATE INVERTED INDEX on seed (_jsonb); ; ```
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-experience rafiss
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ 95028269160e0bfa2b94477238e72670bf780e9d:
Fatal error:
panic: runtime error: index out of range [0] with length 0
Stack:
goroutine 9252225 [running]:
github.com/cockroachdb/cockroach/pkg/internal/sqlsmith.makeMergeJoinExpr.func1(0xc032f181c0, 0xc012dac5b0, 0xc0051cbb80, 0xc006e25470, 0xc006e254a8, 0x0, 0x0, 0x0, 0x0)
/go/src/github.com/cockroachdb/cockroach/pkg/internal/sqlsmith/relational.go:288 +0x870
github.com/cockroachdb/cockroach/pkg/internal/sqlsmith.makeMergeJoinExpr(0xc032f181c0, 0x0, 0x0, 0x0, 0x1, 0x64dde60, 0xc0051cbb30, 0xc0053bd320, 0x4, 0x4, ...)
/go/src/github.com/cockroachdb/cockroach/pkg/internal/sqlsmith/relational.go:323 +0x26b
github.com/cockroachdb/cockroach/pkg/internal/sqlsmith.makeTableExpr(0xc032f181c0, 0x0, 0x0, 0x0, 0x1, 0x64dde60, 0xc0051cbb30, 0xc0053bd320, 0x4, 0x4, ...)
/go/src/github.com/cockroachdb/cockroach/pkg/internal/sqlsmith/relational.go:144 +0xb0
github.com/cockroachdb/cockroach/pkg/internal/sqlsmith.makeEquiJoinExpr(0xc032f181c0, 0x0, 0x0, 0x0, 0xc0105f3d00, 0x9a85d8800000002, 0x9a85d88cc5e51d1, 0xc009e587f8, 0x41adb42, 0xc0105f3da0, ...)
/go/src/github.com/cockroachdb/cockroach/pkg/internal/sqlsmith/relational.go:208 +0xeb
github.com/cockroachdb/cockroach/pkg/internal/sqlsmith.makeTableExpr(0xc032f181c0, 0x0, 0x0, 0x0, 0x0, 0xc006ca9d50, 0x0, 0x1, 0xd, 0xd, ...)
/go/src/github.com/cockroachdb/cockroach/pkg/internal/sqlsmith/relational.go:144 +0xb0
github.com/cockroachdb/cockroach/pkg/internal/sqlsmith.(*Smither).makeSelectClause(0xc032f181c0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/go/src/github.com/cockroachdb/cockroach/pkg/internal/sqlsmith/relational.go:521 +0x16a
github.com/cockroachdb/cockroach/pkg/internal/sqlsmith.(*Smither).makeSelect(0xc032f181c0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x4541f8, ...)
/go/src/github.com/cockroachdb/cockroach/pkg/internal/sqlsmith/relational.go:726 +0xcf
github.com/cockroachdb/cockroach/pkg/internal/sqlsmith.makeSelect(0xc032f181c0, 0x560f5e0, 0xc007a624b0, 0x740000c0088984f0)
/go/src/github.com/cockroachdb/cockroach/pkg/internal/sqlsmith/relational.go:679 +0x52
github.com/cockroachdb/cockroach/pkg/internal/sqlsmith.(*Smither).makeStmt(0xc032f181c0, 0x7f5950bd55e0, 0x203003, 0x100)
/go/src/github.com/cockroachdb/cockroach/pkg/internal/sqlsmith/relational.go:20 +0x45
github.com/cockroachdb/cockroach/pkg/internal/sqlsmith.(*Smither).Generate(0xc032f181c0, 0x3f, 0xc008898548)
/go/src/github.com/cockroachdb/cockroach/pkg/internal/sqlsmith/sqlsmith.go:158 +0x36
github.com/cockroachdb/cockroach/pkg/sql/tests_test.TestRandomSyntaxSQLSmith.func2(0x650b648, 0xc00587df00, 0xc016543980, 0xc0175d02c0, 0x560fd50, 0xc008898720)
/go/src/github.com/cockroachdb/cockroach/pkg/sql/tests/rsg_test.go:554 +0x4e
github.com/cockroachdb/cockroach/pkg/sql/tests_test.testRandomSyntax.func3(0x650b648, 0xc00587df00, 0x4, 0x12d4122, 0x650b680)
/go/src/github.com/cockroachdb/cockroach/pkg/sql/tests/rsg_test.go:753 +0xc7
github.com/cockroachdb/cockroach/pkg/util/ctxgroup.GroupWorkers.func1(0x650b648, 0xc00587df00, 0xc00136a280, 0x5614890)
/go/src/github.com/cockroachdb/cockroach/pkg/util/ctxgroup/ctxgroup.go:175 +0x42
github.com/cockroachdb/cockroach/pkg/util/ctxgroup.Group.GoCtx.func1(0xc005fbed40, 0x5614810)
/go/src/github.com/cockroachdb/cockroach/pkg/util/ctxgroup/ctxgroup.go:166 +0x3a
golang.org/x/sync/errgroup.(*Group).Go.func1(0xc01b645830, 0xc01b645920)
/go/src/github.com/cockroachdb/cockroach/vendor/golang.org/x/sync/errgroup/errgroup.go:57 +0x59
created by golang.org/x/sync/errgroup.(*Group).Go
/go/src/github.com/cockroachdb/cockroach/vendor/golang.org/x/sync/errgroup/errgroup.go:54 +0x66
``` SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false; SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false; SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true; CREATE TABLE table1 (col1_0 BOX2D, col1_1 REGPROC NULL, col1_2 REGCLASS, col1_3 DECIMAL NOT NULL, col1_4 INET NULL, col1_5 INTERVAL, col1_6 TIMESTAMP NOT NULL, col1_7 REGCLASS NOT NULL, col1_8 "char", col1_9 CHAR NOT NULL, col1_10 REGPROCEDURE, PRIMARY KEY (col1_7 ASC, col1_3 DESC), col1_11 DECIMAL NOT NULL AS (col1_3 + 47587046391369.10337:::DECIMAL) STORED, INDEX (col1_5 DESC, col1_2 ASC, col1_8, col1_11, col1_4, col1_6 ASC, col1_3 DESC, col1_7, col1_0, col1_10, col1_1 ASC) STORING (col1_9) WHERE ((((table1.col1_3 > '-Infinity':::DECIMAL) AND (table1.col1_9 < e'\'':::STRING)) OR (table1.col1_11 <= 'NaN':::DECIMAL)) AND (table1.col1_6 < '294276-12-31 23:59:59.999999':::TIMESTAMP)) OR (table1.col1_8 = e'\x00':::STRING), UNIQUE (col1_8 ASC, col1_4, col1_1, col1_0 ASC, col1_5 ASC) STORING (col1_2, col1_9, col1_10), INDEX (col1_1 DESC, col1_11, col1_3 DESC, col1_10 DESC, col1_8 DESC, col1_4 ASC, col1_5, col1_7 DESC, col1_0 ASC, col1_9, col1_2 ASC) WHERE ((table1.col1_6 != '294276-12-31 23:59:59.999999':::TIMESTAMP) OR (table1.col1_11 <= 1:::DECIMAL)) AND (table1.col1_9 = '':::STRING), INDEX (col1_8 DESC, col1_11 DESC, col1_9, col1_6 ASC, col1_7, col1_5, col1_10, col1_1 DESC, col1_0 DESC, col1_4 DESC, col1_2), UNIQUE (col1_7 ASC, col1_10 DESC, col1_5, col1_2 DESC, col1_0, col1_8, col1_6 DESC) WHERE ((((table1.col1_6 <= '-2000-01-01 00:00:00':::TIMESTAMP) OR (table1.col1_3 > 0:::DECIMAL)) AND (table1.col1_8 <= 'X':::STRING)) AND (table1.col1_11 = 1:::DECIMAL)) OR (table1.col1_9 > e'\x00':::STRING), UNIQUE (col1_0, col1_2, col1_4 DESC) STORING (col1_9, col1_10) WHERE ((((table1.col1_8 >= e'\'':::STRING) AND (table1.col1_3 = 'Infinity':::DECIMAL)) OR (table1.col1_6 >= '-4713-11-24 00:00:00':::TIMESTAMP)) OR (table1.col1_9 < '':::STRING)) AND (table1.col1_11 <= 1:::DECIMAL), INDEX (col1_3 ASC, col1_2 DESC, col1_7 DESC, col1_6 ASC, col1_1, col1_10, col1_5 DESC, col1_9 ASC, col1_0 DESC, col1_11 ASC, col1_4 DESC, col1_8 ASC), INDEX (col1_1, col1_9 ASC, col1_4 ASC, col1_11 ASC, col1_3 DESC, col1_6, col1_7 DESC, col1_2 DESC, col1_5 ASC), FAMILY (col1_9, col1_6), FAMILY (col1_10, col1_5), FAMILY (col1_0), FAMILY (col1_3, col1_8), FAMILY (col1_1, col1_11, col1_7), FAMILY (col1_4), FAMILY (col1_2)); CREATE TABLE table2 (col2_0 BIT(47) NULL, col2_1 INT8 NULL, col2_2 FLOAT4 NOT NULL, col2_3 DECIMAL NOT NULL, col2_4 INET NULL, col2_5 UUID NULL, col2_6 TIME NOT NULL, col2_7 JSONB NULL, col2_8 FLOAT4 NOT NULL AS (col2_2 + (-0.6837095618247986):::FLOAT8) VIRTUAL, INDEX (col2_5, col2_0) STORING (col2_1, col2_2, col2_3, col2_7) WHERE ((((table2.col2_2 != 'NaN':::FLOAT8) OR (table2.col2_6 >= '24:00:00':::TIME)) AND (table2.col2_1 < 2147483647:::INT8)) AND (table2.col2_3 != 0:::DECIMAL)) AND (table2.col2_8 = (-1.0):::FLOAT8), INDEX (col2_6, col2_2 ASC, col2_8 ASC, col2_5) WHERE (table2.col2_3 <= 'Infinity':::DECIMAL) OR (table2.col2_1 > 32767:::INT8), UNIQUE (col2_4, col2_6 DESC, col2_1 DESC) STORING (col2_3, col2_7), FAMILY (col2_0), FAMILY (col2_4), FAMILY (col2_2), FAMILY (col2_5, col2_6, col2_3), FAMILY (col2_7, col2_1), UNIQUE (col2_5)); CREATE TABLE table3 (col3_0 BIT(46), col3_1 BYTES NOT NULL, col3_2 GEOMETRY, col3_3 REGPROCEDURE, col3_4 TIME NOT NULL, col3_5 REGNAMESPACE, col3_6 REGTYPE NOT NULL, col3_7 FLOAT4 NOT NULL, col3_8 TIMETZ NOT NULL, col3_9 STRING AS (lower(CAST(col3_0 AS STRING))) VIRTUAL, col3_10 STRING AS (lower(CAST(col3_3 AS STRING))) STORED, col3_11 STRING NOT NULL AS (lower(CAST(col3_6 AS STRING))) VIRTUAL, FAMILY (col3_4, col3_10, col3_5), FAMILY (col3_7), FAMILY (col3_2), FAMILY (col3_3), FAMILY (col3_0, col3_8, col3_1, col3_6), UNIQUE (col3_0)); CREATE TABLE table4 (col4_0 GEOGRAPHY, col4_1 REGTYPE NOT NULL, col4_2 UUID NULL, col4_3 DATE, col4_4 REGTYPE, col4_5 INET NOT NULL, PRIMARY KEY (col4_1), col4_6 STRING AS (lower(CAST(col4_4 AS STRING))) VIRTUAL, col4_7 STRING AS (lower(CAST(col4_4 AS STRING))) STORED, col4_8 STRING AS (lower(CAST(col4_3 AS STRING))) VIRTUAL, col4_9 STRING AS (lower(CAST(col4_4 AS STRING))) VIRTUAL, col4_10 STRING NOT NULL AS (lower(CAST(col4_1 AS STRING))) STORED, INDEX (col4_7 DESC, col4_2, col4_6 ASC, col4_10, col4_9 ASC) STORING (col4_5) WHERE (((table4.col4_8 <= e'\x00':::STRING) AND (table4.col4_7 < '':::STRING)) OR (table4.col4_3 >= '-infinity':::DATE)) OR (table4.col4_6 < '"':::STRING), INDEX (col4_10, col4_3 ASC, col4_4, col4_2 ASC, col4_7 ASC) WHERE (((((table4.col4_3 = 'infinity':::DATE) OR (table4.col4_6 <= e'\U00002603':::STRING)) AND (table4.col4_10 != e'\x00':::STRING)) OR (table4.col4_8 < '':::STRING)) AND (table4.col4_7 <= '"':::STRING)) OR (table4.col4_9 >= e'\x00':::STRING), INDEX (col4_10, col4_3, col4_2 ASC) STORING (col4_0) WHERE (table4.col4_10 >= e'\'':::STRING) OR (table4.col4_7 <= 'X':::STRING), FAMILY (col4_2, col4_10, col4_1, col4_0), FAMILY (col4_5), FAMILY (col4_3), FAMILY (col4_7), FAMILY (col4_4)); CREATE TABLE table5 (col5_0 DATE NOT NULL, col5_1 BIT(2) NOT NULL, PRIMARY KEY (col5_1 ASC, col5_0 DESC), INDEX (col5_1 DESC), INDEX (col5_0 DESC) WHERE table5.col5_0 <= 'infinity':::DATE, INDEX (col5_1 DESC), INDEX (col5_1, col5_0 DESC) WHERE table5.col5_0 <= '4714-11-24 BC':::DATE, UNIQUE (col5_0) WHERE table5.col5_0 > '1970-01-01':::DATE, INDEX (col5_1, col5_0 DESC)); ALTER TABLE table1 INJECT STATISTICS e'[{"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 12, "histo_col_type": "", "name": "__auto__", "null_count": 22, "row_count": 30}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 11, "histo_col_type": "INTERVAL", "name": "__auto__", "null_count": 10, "row_count": 30}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 15, "histo_buckets": [{"distinct_range": 0, "num_eq": 9000, "num_range": 0, "upper_bound": "118697185"}, {"distinct_range": 3858345525534600000, "num_eq": 1640818677832852330, "num_range": 6274214174567970195, "upper_bound": "272736216"}, {"distinct_range": 0, "num_eq": 4000, "num_range": 0, "upper_bound": "301779983"}, {"distinct_range": 942959151704331600, "num_eq": 6126276670251301599, "num_range": 4441437020276444836, "upper_bound": "2147578617"}, {"distinct_range": 80000, "num_eq": 2299744081283499794, "num_range": 80000, "upper_bound": "2165177721"}, {"distinct_range": 800000000, "num_eq": 200, "num_range": 800000000, "upper_bound": "2260217105"}, {"distinct_range": 0, "num_eq": 5077202509721381601, "num_range": 9113129025417958047, "upper_bound": "2668533138"}, {"distinct_range": 3111.0992629609723, "num_eq": 3472152322714571454, "num_range": 5000, "upper_bound": "4058370517"}], "histo_col_type": "REGCLASS", "name": "__auto__", "null_count": 0, "row_count": 30}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 16, "histo_buckets": [{"distinct_range": 0, "num_eq": 20000000, "num_range": 0, "upper_bound": "\\u0014"}, {"distinct_range": 1397023735199350800, "num_eq": 80000, "num_range": 1742605909788481326, "upper_bound": "&"}, {"distinct_range": 168.42026720435186, "num_eq": 7320444788300022027, "num_range": 9000, "upper_bound": "a"}, {"distinct_range": 4198901699379335700, "num_eq": 10000000000, "num_range": 7520021930126714887, "upper_bound": "r"}], "histo_col_type": "\\"char\\"", "name": "__auto__", "null_count": 23, "row_count": 30}, {"columns": ["col1_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 8, "histo_col_type": "", "name": "__auto__", "null_count": 29, "row_count": 30}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 11, "histo_col_type": "REGPROC", "name": "__auto__", "null_count": 18, "row_count": 30}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 27, "histo_buckets": [{"distinct_range": 0, "num_eq": 3099144921306991383, "num_range": 0, "upper_bound": "NaN"}, {"distinct_range": 2000000000, "num_eq": 30000000000, "num_range": 2000000000, "upper_bound": "-8.306418049182567562E+35"}, {"distinct_range": 0, "num_eq": 9000000, "num_range": 10000000000, "upper_bound": "-2.970289497549661004E+33"}, {"distinct_range": 300000000, "num_eq": 1708076684652948883, "num_range": 300000000, "upper_bound": "-4.49538443402103798E+27"}, {"distinct_range": 500453789204789900, "num_eq": 0, "num_range": 500453789204789884, "upper_bound": "-2.946699233818566473E+24"}, {"distinct_range": 59838398506.75599, "num_eq": 5050372554665405667, "num_range": 60000000000, "upper_bound": "55.81202424134793559"}, {"distinct_range": 983783498385441500, "num_eq": 20000, "num_range": 1032318386480785133, "upper_bound": "2662728066480601.352"}], "histo_col_type": "DECIMAL", "name": "__auto__", "null_count": 0, "row_count": 30}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 16, "histo_col_type": "", "name": "__auto__", "null_count": 9, "row_count": 30}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 18, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 30}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 17, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 30}, {"columns": ["col1_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 30}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 27, "histo_col_type": "", "name": "__auto__", "null_count": 3, "row_count": 30}]':::JSONB; ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 249, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8000}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5885, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8000}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 56, "histo_col_type": "", "name": "__auto__", "null_count": 5991, "row_count": 8000}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6676, "histo_buckets": [{"distinct_range": 0, "num_eq": 784430676625093406, "num_range": 0, "upper_bound": "00000000-0000-0000-0000-000000000000"}, {"distinct_range": 0, "num_eq": 2000000000, "num_range": 8418219926204913703, "upper_bound": "0ba82d75-668f-441b-8feb-cf83952cc76e"}, {"distinct_range": 15158.157549811503, "num_eq": 1163598316501124151, "num_range": 40000, "upper_bound": "1ca5bb8d-9a00-4fee-94a8-06386b51561e"}, {"distinct_range": 666256046.7900729, "num_eq": 4607038285621191317, "num_range": 3000000000, "upper_bound": "4a844102-e00b-4582-82dc-aecd0c5a3afd"}, {"distinct_range": 70, "num_eq": 10000, "num_range": 70, "upper_bound": "6d9562de-5d80-4adb-b46b-3d96ea15222f"}, {"distinct_range": 0, "num_eq": 5993686361359867093, "num_range": 6765910918100378372, "upper_bound": "852ed4e8-4848-4ff4-a360-ddcd6c684bc8"}, {"distinct_range": 0, "num_eq": 319201697604860372, "num_range": 80000, "upper_bound": "8a7d4c01-5290-4927-8f65-6f08d882f1b8"}, {"distinct_range": 0, "num_eq": 200000000, "num_range": 6581389967974760551, "upper_bound": "f6f2f41a-642a-4c3b-8e93-f75de1f53d42"}], "histo_col_type": "UUID", "name": "__auto__", "null_count": 674, "row_count": 8000}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1082, "histo_buckets": [{"distinct_range": 0, "num_eq": 8798773655413010571, "num_range": 0, "upper_bound": "03:13:26.897475"}, {"distinct_range": 0, "num_eq": 90000000, "num_range": 2570989751475793026, "upper_bound": "05:27:53.988339"}, {"distinct_range": 0, "num_eq": 7000, "num_range": 1000, "upper_bound": "12:45:01.176007"}, {"distinct_range": 254939679677935800, "num_eq": 5990103079935296104, "num_range": 1328446498910571607, "upper_bound": "12:45:34.506375"}, {"distinct_range": 718500318580357000, "num_eq": 8937068798118558242, "num_range": 3932063071558832230, "upper_bound": "23:55:00.097413"}, {"distinct_range": 525.8884698260114, "num_eq": 1494214840668247959, "num_range": 3000, "upper_bound": "23:58:04.886726"}], "histo_col_type": "TIME", "name": "__auto__", "null_count": 0, "row_count": 8000}, {"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7498, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8000}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4137, "histo_col_type": "", "name": "__auto__", "null_count": 4461, "row_count": 8000}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2535, "histo_col_type": "", "name": "__auto__", "null_count": 6376, "row_count": 8000}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 686, "histo_buckets": [{"distinct_range": 0, "num_eq": 4000, "num_range": 0, "upper_bound": "33.101.249.41/11"}, {"distinct_range": 165621408.98043588, "num_eq": 70000, "num_range": 400000000, "upper_bound": "13.109.129.185/15"}, {"distinct_range": 8294044781623235000, "num_eq": 90, "num_range": 8294044781623234065, "upper_bound": "111.166.61.90/16"}, {"distinct_range": 870192.7865018863, "num_eq": 40000000000, "num_range": 2000000, "upper_bound": "2567:8fc9:7775:1f4f:9568:83ab:16f0:5061/10"}, {"distinct_range": 1000000000, "num_eq": 2583565038040066088, "num_range": 1000000000, "upper_bound": "fa01:fa04:86b9:e430:7cf8:fe48:1256:e840/16"}, {"distinct_range": 60, "num_eq": 6745855278975951123, "num_range": 60, "upper_bound": "6311:ccdb:c0a:d04b:f69d:a7ed:e245:123f/29"}, {"distinct_range": 0, "num_eq": 6287572677541240460, "num_range": 600, "upper_bound": "e4f1:4e61:8954:4757:3daa:e397:52ea:154e/47"}, {"distinct_range": 0, "num_eq": 60000000000, "num_range": 5577635148088969286, "upper_bound": "2671:50ef:271e:5a20:e6d:1fb2:3c35:a092/59"}, {"distinct_range": 0, "num_eq": 7000000, "num_range": 5582403969148348297, "upper_bound": "400:724b:d677:58f1:a25f:e3c2:d31c:ed35/73"}], "histo_col_type": "INET", "name": "__auto__", "null_count": 585, "row_count": 8000}]':::JSONB; ALTER TABLE table3 INJECT STATISTICS '[{"columns": ["col3_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1935415013649845549, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6637427249367752735}, {"columns": ["col3_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1284205670965741603, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6637427249367752735}, {"columns": ["col3_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2675152810537599929, "histo_col_type": "", "name": "__auto__", "null_count": 2756580786961036150, "row_count": 6637427249367752735}, {"columns": ["col3_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6384155828785707944, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6637427249367752735}, {"columns": ["col3_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2313693028545367136, "histo_col_type": "", "name": "__auto__", "null_count": 288192948289153668, "row_count": 6637427249367752735}, {"columns": ["col3_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5100123063711357735, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6637427249367752735}, {"columns": ["col3_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 861785024109863883, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6637427249367752735}, {"columns": ["col3_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3481668839862337719, "histo_col_type": "", "name": "__auto__", "null_count": 4428157053888971437, "row_count": 6637427249367752735}, {"columns": ["col3_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4528134268450903242, "histo_col_type": "", "name": "__auto__", "null_count": 2349838022751646336, "row_count": 6637427249367752735}, {"columns": ["col3_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2675115321112736696, "histo_col_type": "", "name": "__auto__", "null_count": 3046270157528153217, "row_count": 6637427249367752735}, {"columns": ["col3_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5944633843177973379, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6637427249367752735}, {"columns": ["col3_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3344401487733246969, "histo_col_type": "", "name": "__auto__", "null_count": 2447121887552644896, "row_count": 6637427249367752735}]':::JSONB; ALTER TABLE table4 INJECT STATISTICS e'[{"columns": ["col4_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 612951152, "histo_col_type": "", "name": "__auto__", "null_count": 748644658, "row_count": 1000000000}, {"columns": ["col4_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 21571772, "histo_col_type": "", "name": "__auto__", "null_count": 18231847, "row_count": 1000000000}, {"columns": ["col4_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 757168778, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000000000}, {"columns": ["col4_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 442633215, "histo_col_type": "", "name": "__auto__", "null_count": 478531444, "row_count": 1000000000}, {"columns": ["col4_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 39183339, "histo_col_type": "", "name": "__auto__", "null_count": 9751888, "row_count": 1000000000}, {"columns": ["col4_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 627811856, "histo_buckets": [{"distinct_range": 0, "num_eq": 3000000000, "num_range": 0, "upper_bound": "\\u0006_"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 0, "row_count": 1000000000}, {"columns": ["col4_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 544566687, "histo_col_type": "", "name": "__auto__", "null_count": 473412660, "row_count": 1000000000}, {"columns": ["col4_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1326289, "histo_buckets": [{"distinct_range": 0, "num_eq": 0, "num_range": 0, "upper_bound": "0"}, {"distinct_range": 3000, "num_eq": 8507246854292573695, "num_range": 3000, "upper_bound": "729300980"}, {"distinct_range": 7500957854570047000, "num_eq": 1718916149961330903, "num_range": 7500957854570047706, "upper_bound": "1486372117"}, {"distinct_range": 2521710221740427000, "num_eq": 3865483019830826658, "num_range": 2521710221740426891, "upper_bound": "3136854035"}, {"distinct_range": 5312595952506097000, "num_eq": 60, "num_range": 7025814499862795230, "upper_bound": "3483952777"}], "histo_col_type": "REGTYPE", "name": "__auto__", "null_count": 0, "row_count": 1000000000}, {"columns": ["col4_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 418198357, "histo_col_type": "", "name": "__auto__", "null_count": 372873207, "row_count": 1000000000}, {"columns": ["col4_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 203231777, "histo_col_type": "", "name": "__auto__", "null_count": 543621337, "row_count": 1000000000}, {"columns": ["col4_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 266126814, "histo_col_type": "", "name": "__auto__", "null_count": 192977890, "row_count": 1000000000}]':::JSONB; ALTER TABLE table5 INJECT STATISTICS '[{"columns": ["col5_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 707747286554839775, "histo_buckets": [{"distinct_range": 0, "num_eq": 10000000, "num_range": 0, "upper_bound": "1979-08-10"}, {"distinct_range": 0, "num_eq": 80, "num_range": 0, "upper_bound": "1989-09-11"}, {"distinct_range": 3172055523888305000, "num_eq": 5639100041530074118, "num_range": 3172055523888305095, "upper_bound": "1994-09-24"}], "histo_col_type": "DATE", "name": "__auto__", "null_count": 0, "row_count": 6387399933721424758}, {"columns": ["col5_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1903455530459753089, "histo_buckets": [{"distinct_range": 0, "num_eq": 2891734071196841656, "num_range": 0, "upper_bound": "11"}], "histo_col_type": "BIT(2)", "name": "__auto__", "null_count": 0, "row_count": 6387399933721424758}]':::JSONB; ALTER TABLE table5 ADD FOREIGN KEY (col5_1) REFERENCES table3 (col3_0) ON UPDATE RESTRICT; ALTER TABLE table4 ADD FOREIGN KEY (col4_2) REFERENCES table2 (col2_5); CREATE TYPE rand_typ_0 AS ENUM ('ios', 'vsfgp', 'frgscc', 'bqlwce', 'ypvjy'); CREATE TYPE rand_typ_1 AS ENUM ('bbvn', 'iziccm', 'gxpmc'); CREATE TYPE rand_typ_2 AS ENUM ('aqpe', 'icmnlt'); ; rsg_test.go:548: SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true; SET enable_drop_enum_value = true; CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning'); CREATE TABLE IF NOT EXISTS seed AS SELECT g::INT2 AS _int2, g::INT4 AS _int4, g::INT8 AS _int8, g::FLOAT4 AS _float4, g::FLOAT8 AS _float8, '2001-01-01'::DATE + g AS _date, '2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp, '2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz, g * '1 day'::INTERVAL AS _interval, g % 2 = 1 AS _bool, g::DECIMAL AS _decimal, g::STRING AS _string, g::STRING::BYTES AS _bytes, substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid, '0.0.0.0'::INET + g AS _inet, g::STRING::JSONB AS _jsonb, enum_range('hello'::greeting)[g] as _enum FROM generate_series(1, 5) AS g; INSERT INTO seed DEFAULT VALUES; CREATE INDEX on seed (_int8, _float8, _date); CREATE INVERTED INDEX on seed (_jsonb); ; ```
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-experience rafiss
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ eb7f3fe2991992472a68d701d65543f7a9c7fb56:
Random syntax error:
rsg_test.go:763: Crash detected: server panic: pq: internal error: could not find overload for st_intersects
Query:
WITH
with_325590 (col_1752452)
AS (
SELECT
*
FROM
(
VALUES
('{"9]Z:SG.": [0.6175157849187067, {}, null]}':::JSONB),
('true':::JSONB),
('[true]':::JSONB),
('[[[]], true, null, "foobar", [{"baz": []}], true]':::JSONB),
('{"test": "json"}':::JSONB),
(
crdb_internal.pb_to_json(e'\'':::STRING::STRING, '\xf2670e78e1af':::BYTES::BYTES, ((0.0:::FLOAT8 = st_distance(st_geographyfromtext('"':::STRING::STRING)::GEOGRAPHY::GEOGRAPHY, '0105000020E610000003000000010200000006000000ACE8E56F4034564001E5B167892347C004250707FFAC60404086E88062D100402CBE02D03042624030B0A2E27001524040D4D78FD3ED1C40503EB904B04655409461920E1E6353C064F93F37E2E63C40860D80E6D9FD61C010FE5FBCDCFD4F4001020000000800000014AB992A603343C0F02E0DCABEA950C0BC0026081D554440B5FA75A07D544EC0FC44234B291A4B403ADD1E84AD9754C020A93F2B2DBC6040B8B76DC74BE530C0F22991025E3064404006137DFF38F1BFB80F136C55085B40CE6372D6537451405C0F219D02F250403070CFC13CF94640404F29A1CFD442C070D6518DF3F44540010200000002000000A87B6AC385A03BC0188C8056AF0B4F40CF7BE455759A60C0ACF151945B3B5440':::GEOGRAPHY::GEOGRAPHY, true::BOOL)::FLOAT8) AND NULL)::BOOL)::JSONB
)
)
AS tab_796639 (col_1752452)
)
SELECT
e'\x19':::STRING AS col_1752453, 0.775984525680542:::FLOAT8 AS col_1752454
LIMIT
48:::INT8;
Schema:
rsg_test.go:580: To reproduce, use schema:
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
CREATE TABLE table1 (col1_0 REGNAMESPACE NOT NULL, col1_1 INT4 NOT NULL, PRIMARY KEY (col1_1), INDEX (col1_0) WHERE table1.col1_1 = 1:::INT8, INDEX (col1_0 ASC, col1_1) WHERE table1.col1_1 < 32767:::INT8, INDEX (col1_0 DESC) WHERE table1.col1_1 < (-1):::INT8, UNIQUE (col1_0 DESC, col1_1 DESC), INDEX (col1_1) WHERE table1.col1_1 <= (-2147483648):::INT8, INDEX (col1_0 ASC, col1_1) WHERE table1.col1_1 = (-32768):::INT8, UNIQUE (col1_0 DESC, col1_1 DESC) WHERE table1.col1_1 < 2147483647:::INT8, UNIQUE (col1_0 ASC), FAMILY (col1_0, col1_1));
CREATE TABLE table2 (col2_0 "char"[] NULL, col2_1 BIT(32), col2_2 REGTYPE NULL, col2_3 BIT(19) NOT NULL, col2_4 DECIMAL NOT NULL, col2_5 DECIMAL NOT NULL AS (col2_4 + (-4.882884437289807965E+19):::DECIMAL) STORED, col2_6 STRING AS (lower(CAST(col2_1 AS STRING))) STORED, col2_7 STRING NULL AS (lower(CAST(col2_2 AS STRING))) VIRTUAL, col2_8 DECIMAL NOT NULL AS (col2_4 + (-2.782814081785602627E+28):::DECIMAL) STORED, INDEX (col2_5, col2_6, col2_4 ASC) WHERE ((((table2.col2_7 >= e'\'':::STRING) AND (table2.col2_4 < (-1.234E+401):::DECIMAL)) OR (table2.col2_5 >= 'Infinity':::DECIMAL)) OR (table2.col2_6 > e'\U00002603':::STRING)) AND (table2.col2_8 = (-1):::DECIMAL), INDEX (col2_2 ASC, col2_5 DESC), UNIQUE (col2_3 DESC, col2_5), INDEX (col2_5, col2_1) STORING (col2_0, col2_2) WHERE ((((table2.col2_5 <= 0:::DECIMAL) OR (table2.col2_7 != '':::STRING)) AND (table2.col2_4 <= 'NaN':::DECIMAL)) AND (table2.col2_8 <= 'Infinity':::DECIMAL)) OR (table2.col2_6 < e'\x00':::STRING), UNIQUE (col2_2, col2_8 ASC, col2_6 ASC));
ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2026, "histo_buckets": [{"distinct_range": 0, "num_eq": 2764590188932919797, "num_range": 0, "upper_bound": "0"}, {"distinct_range": 5874716989533460000, "num_eq": 4000000000, "num_range": 6252199546816627823, "upper_bound": "918181767"}, {"distinct_range": 0, "num_eq": 30, "num_range": 2029524477899324751, "upper_bound": "2724261227"}, {"distinct_range": 42.437643054597615, "num_eq": 0, "num_range": 60, "upper_bound": "3619908917"}], "histo_col_type": "REGNAMESPACE", "name": "__auto__", "null_count": 0, "row_count": 4000}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 740, "histo_buckets": [{"distinct_range": 0, "num_eq": 60000000000, "num_range": 0, "upper_bound": "-1878169741"}, {"distinct_range": 0, "num_eq": 3000000, "num_range": 2328248623507708651, "upper_bound": "-1274515872"}, {"distinct_range": 1183358167136928800, "num_eq": 800000000, "num_range": 1183358167136928665, "upper_bound": "-151804946"}, {"distinct_range": 8154864740070474000, "num_eq": 4000000000, "num_range": 8154864740070473651, "upper_bound": "4356399"}, {"distinct_range": 3698374422508391400, "num_eq": 0, "num_range": 4293461261475027134, "upper_bound": "1567463861"}], "histo_col_type": "INT4", "name": "__auto__", "null_count": 0, "row_count": 4000}]':::JSONB;
ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1588964255761424028, "histo_col_type": "", "name": "__auto__", "null_count": 1843641834600546169, "row_count": 7747022179860420026}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 346583748542473976, "histo_buckets": [{"distinct_range": 0, "num_eq": 50000000, "num_range": 0, "upper_bound": "0010001100110101111"}, {"distinct_range": 40000000, "num_eq": 4934036824624435917, "num_range": 40000000, "upper_bound": "0010100001111111000"}, {"distinct_range": 1468949915821171700, "num_eq": 1000, "num_range": 2676262625704842035, "upper_bound": "0010110111010001011"}, {"distinct_range": 0, "num_eq": 6000000, "num_range": 600000, "upper_bound": "0101110100001011101"}], "histo_col_type": "BIT(19)", "name": "__auto__", "null_count": 0, "row_count": 7747022179860420026}, {"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5938940225617269286, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7747022179860420026}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3357676354219061016, "histo_col_type": "", "name": "__auto__", "null_count": 5588887676480512954, "row_count": 7747022179860420026}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2590578937786572831, "histo_buckets": [{"distinct_range": 0, "num_eq": 700, "num_range": 0, "upper_bound": "0"}, {"distinct_range": 100, "num_eq": 400, "num_range": 100, "upper_bound": "108057528"}, {"distinct_range": 1000000000, "num_eq": 5957224214778956553, "num_range": 1000000000, "upper_bound": "1042372086"}, {"distinct_range": 5289030916258472000, "num_eq": 8180016571984543095, "num_range": 5289030916258471894, "upper_bound": "1818169226"}, {"distinct_range": 0, "num_eq": 7805556715544168080, "num_range": 5086444055566532624, "upper_bound": "1867618139"}, {"distinct_range": 4687953341168651000, "num_eq": 30, "num_range": 4687953341168651581, "upper_bound": "1947709715"}, {"distinct_range": 0, "num_eq": 400, "num_range": 0, "upper_bound": "3272248595"}, {"distinct_range": 8440998219661764000, "num_eq": 3000000000, "num_range": 8440998219661763144, "upper_bound": "4075479620"}, {"distinct_range": 0, "num_eq": 8774356278762603378, "num_range": 4427727372563476431, "upper_bound": "4202919248"}], "histo_col_type": "REGTYPE", "name": "__auto__", "null_count": 5907660299997911207, "row_count": 7747022179860420026}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6366740178320099466, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7747022179860420026}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3036697680169238810, "histo_buckets": [{"distinct_range": 0, "num_eq": 8857976937413606028, "num_range": 0, "upper_bound": "1"}, {"distinct_range": 0, "num_eq": 0, "num_range": 800000000, "upper_bound": "14568.00845189237129"}, {"distinct_range": 500000000, "num_eq": 6000000, "num_range": 500000000, "upper_bound": "2.798395720076929843E+20"}, {"distinct_range": 3626539836544344600, "num_eq": 50, "num_range": 3626539836544344511, "upper_bound": "4.543084703790922984E+35"}], "histo_col_type": "DECIMAL", "name": "__auto__", "null_count": 0, "row_count": 7747022179860420026}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6460900928649541738, "histo_col_type": "", "name": "__auto__", "null_count": 5370383958673664182, "row_count": 7747022179860420026}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3118526492138208720, "histo_col_type": "", "name": "__auto__", "null_count": 314567048317531175, "row_count": 7747022179860420026}]':::JSONB;
CREATE TYPE rand_typ_0 AS ENUM ('cut', 'rpd', 'pqk');
CREATE TYPE rand_typ_1 AS ENUM ('kejsv', 'r');
CREATE TYPE rand_typ_2 AS ENUM ('wi', 'knb', 'uc', 'xjc', 'xupsj', 'xrdoys');
CREATE TYPE rand_typ_3 AS ENUM ('fwz', 'lxtw', 'dj', 'fcm', 'yej', 'q');
CREATE TYPE rand_typ_4 AS ENUM ('rfa', 'qjyflk', 'bplfdj', 'of', 'dmg', 'smq');
;
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
SELECT
g::INT2 AS _int2,
g::INT4 AS _int4,
g::INT8 AS _int8,
g::FLOAT4 AS _float4,
g::FLOAT8 AS _float8,
'2001-01-01'::DATE + g AS _date,
'2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
'2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
g * '1 day'::INTERVAL AS _interval,
g % 2 = 1 AS _bool,
g::DECIMAL AS _decimal,
g::STRING AS _string,
g::STRING::BYTES AS _bytes,
substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
'0.0.0.0'::INET + g AS _inet,
g::STRING::JSONB AS _jsonb,
enum_range('hello'::greeting)[g] as _enum
FROM
generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);
;
rsg_test.go:584:
rsg_test.go:585: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith594246026
--- FAIL: TestRandomSyntaxSQLSmith (300.85s)
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-experience rafiss
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ 7121f6d80505801cc432a178ad8b6dacbaac1448:
Random syntax error:
rsg_test.go:763: Crash detected: server panic: statement exec timeout
Query:
SELECT
tab_15761._int4 AS col_34881,
'\x':::BYTES AS col_34882,
1551604574:::OID AS col_34883,
tab_15763.col2_8 AS col_34884,
(-1.234E+401):::DECIMAL AS col_34885,
(-5.472823646931238646E+20):::DECIMAL AS col_34886,
COALESCE(tab_15761._uuid, tab_15761._uuid) AS col_34887,
tab_15767.col4_0 AS col_34888,
(-4671230664668143745):::INT8 AS col_34889,
jsonb_set('[null, [{}]]':::JSONB::JSONB, ARRAY['':::STRING,'b>wKn':::STRING]::STRING[], '[{"baz": [], "foobar": {}}, {"b": {"M~^;1H_N": [], "baz": [0.8910335550378738, false, 0.7928690721882607], "foobar": []}}, {"(f%a1sq": [], "@#U5C3L%w": []}, false, false]':::JSONB::JSONB)::JSONB
AS col_34890,
tab_15767.col4_0 AS col_34891,
'53 years 10 mons 441 days 03:23:53.845146':::INTERVAL AS col_34892,
tab_15766.col3_3 AS col_34893,
tab_15762.col2_5 AS col_34894,
'\xa8e9b986a1f0a9':::BYTES AS col_34895,
NULL AS col_34896
FROM
defaultdb.public.seed@[0] AS tab_15761
JOIN defaultdb.public.table2@table2_col2_2_col2_7_col2_12_col2_10_col2_6_col2_9_col2_17_col2_16_col2_18_col2_8_col2_0_idx
AS tab_15762
RIGHT JOIN defaultdb.public.table2@table2_col2_7_key AS tab_15763 ON false
JOIN defaultdb.public.table3@[0] AS tab_15764
JOIN defaultdb.public.table3@table3_col3_0_col3_2_col3_3_key AS tab_15765 ON
(tab_15764.tableoid) = (tab_15765.col3_0)
JOIN defaultdb.public.table3@table3_col3_0_col3_2_col3_3_key AS tab_15766 ON
(tab_15765.crdb_internal_mvcc_timestamp) = (tab_15766.crdb_internal_mvcc_timestamp)
AND (tab_15764.tableoid) = (tab_15766.tableoid)
AND (tab_15765.col3_1) = (tab_15766.col3_1)
AND (tab_15765.tableoid) = (tab_15766.tableoid)
AND (tab_15764.tableoid) = (tab_15766.col3_0)
AND (tab_15764.col3_1) = (tab_15766.col3_1)
JOIN defaultdb.public.table4@table4_col4_1_col4_2_col4_3_col4_0_key AS tab_15767
JOIN defaultdb.public.table1@[0] AS tab_15768 ON (tab_15767.col4_0) = (tab_15768.tableoid) ON
(tab_15766.col3_0) = (tab_15767.tableoid) ON
(tab_15763.col2_8) = (tab_15768.tableoid) AND (tab_15762.tableoid) = (tab_15764.col3_0) ON
(tab_15761._float4) = (tab_15763.col2_18)
AND (tab_15761._decimal) = (tab_15765.crdb_internal_mvcc_timestamp)
AND (tab_15761._int4) = (tab_15763.col2_6)
AND (tab_15761._int2) = (tab_15767.col4_3)
AND (tab_15761._decimal) = (tab_15768.crdb_internal_mvcc_timestamp)
AND (tab_15761.tableoid) = (tab_15763.col2_7)
AND (tab_15761._float8) = (tab_15762.col2_17)
AND (tab_15761._float4) = (tab_15762.col2_18)
AND (tab_15761._float8) = (tab_15762.col2_18)
AND (tab_15761.crdb_internal_mvcc_timestamp) = (tab_15765.crdb_internal_mvcc_timestamp)
LIMIT
53:::INT8;
Schema:
rsg_test.go:580: To reproduce, use schema:
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
CREATE TABLE table1 (col1_0 BIT(32), col1_1 GEOMETRY, col1_2 INET NULL, INVERTED INDEX (col1_0 ASC, col1_1 DESC), INVERTED INDEX (col1_0 DESC, col1_1 DESC), INVERTED INDEX (col1_0 ASC, col1_2 ASC, col1_1 ASC), INDEX (col1_2 ASC) STORING (col1_1), INDEX (col1_0 ASC, col1_2 ASC), INVERTED INDEX (col1_2 ASC, col1_0 DESC, col1_1 ASC), UNIQUE (col1_2 ASC));
CREATE TABLE table2 (col2_0 FLOAT4 NULL, col2_1 DECIMAL NOT NULL, col2_2 INT2, col2_3 CHAR NOT NULL, col2_4 GEOMETRY NOT NULL, col2_5 BIT(36) NOT NULL, col2_6 INT2 NULL, col2_7 REGPROC NOT NULL, col2_8 REGCLASS NOT NULL, col2_9 FLOAT8, col2_10 INT2, col2_11 INTERVAL NOT NULL, col2_12 TIME NULL, col2_13 REGCLASS, col2_14 BOX2D NOT NULL, col2_15 BYTES, PRIMARY KEY (col2_3 ASC, col2_11, col2_7 ASC, col2_14, col2_1 ASC), col2_16 STRING NOT NULL AS (lower(CAST(col2_8 AS STRING))) VIRTUAL, col2_17 FLOAT4 NULL AS (col2_0 + 0.4378741383552551:::FLOAT8) VIRTUAL, col2_18 FLOAT4 NULL AS (col2_0 + col2_9) VIRTUAL, INDEX (col2_1 ASC, col2_10 DESC, col2_6 ASC, col2_17 ASC, col2_18, col2_9, col2_3 ASC, col2_12) WHERE (((((((((((table2.col2_16 >= '"':::STRING) OR (table2.col2_15 > '\x58':::BYTES)) OR (table2.col2_17 < 0.0:::FLOAT8)) AND (table2.col2_2 != 127:::INT8)) OR (table2.col2_0 < 1.401298464324817e-45:::FLOAT8)) AND (table2.col2_18 != 3.4028234663852886e+38:::FLOAT8)) AND (table2.col2_1 > 1:::DECIMAL)) AND (table2.col2_12 > '00:00:00':::TIME)) OR (table2.col2_6 > (-1):::INT8)) OR (table2.col2_3 < 'X':::STRING)) OR (table2.col2_10 >= 127:::INT8)) AND (table2.col2_9 = (-1.0):::FLOAT8), INDEX (col2_18 ASC, col2_11 DESC, col2_14, col2_15 ASC, col2_9) WHERE (((((((((((table2.col2_3 != 'X':::STRING) AND (table2.col2_16 <= '"':::STRING)) AND (table2.col2_15 != '\x':::BYTES)) OR (table2.col2_6 >= 127:::INT8)) AND (table2.col2_17 != '-Inf':::FLOAT8)) AND (table2.col2_1 > '-Infinity':::DECIMAL)) AND (table2.col2_12 != '24:00:00':::TIME)) OR (table2.col2_0 > 3.4028234663852886e+38:::FLOAT8)) OR (table2.col2_10 > (-32768):::INT8)) AND (table2.col2_2 <= (-32768):::INT8)) OR (table2.col2_9 < 'NaN':::FLOAT8)) OR (table2.col2_18 = 0.0:::FLOAT8), INDEX (col2_2, col2_7 ASC, col2_12 ASC, col2_10 ASC, col2_6, col2_9, col2_17, col2_16, col2_18 DESC, col2_8, col2_0 ASC) STORING (col2_4, col2_5, col2_13) WHERE (((((((((table2.col2_12 > '00:00:00':::TIME) AND (table2.col2_9 > 0.0:::FLOAT8)) OR (table2.col2_16 < e'\x00':::STRING)) OR (table2.col2_15 != '\xff':::BYTES)) OR (table2.col2_2 > (-1):::INT8)) OR (table2.col2_1 <= '-Infinity':::DECIMAL)) OR (table2.col2_10 != (-1):::INT8)) AND (table2.col2_18 >= 'NaN':::FLOAT8)) OR (table2.col2_6 < (-1):::INT8)) OR (table2.col2_0 != '-Inf':::FLOAT8), FAMILY (col2_10), FAMILY (col2_2, col2_9), FAMILY (col2_8, col2_3, col2_7, col2_12, col2_14, col2_11), FAMILY (col2_6, col2_4), FAMILY (col2_1), FAMILY (col2_13, col2_15, col2_5, col2_0), UNIQUE (col2_7));
CREATE TABLE table3 (col3_0 REGPROCEDURE NOT NULL, col3_1 INTERVAL NOT NULL, col3_2 BIT(8) NOT NULL, PRIMARY KEY (col3_1, col3_2 ASC), col3_3 STRING NOT NULL AS (lower(CAST(col3_0 AS STRING))) VIRTUAL, UNIQUE (col3_0, col3_2, col3_3));
CREATE TABLE table4 (col4_0 REGCLASS NOT NULL, col4_1 "char" NOT NULL, col4_2 INT4 NOT NULL, col4_3 INT4 NOT NULL, PRIMARY KEY (col4_1, col4_2 DESC, col4_3 ASC), UNIQUE (col4_1 DESC), INDEX (col4_3 ASC) STORING (col4_0) WHERE ((table4.col4_3 >= (-1):::INT8) AND (table4.col4_2 = (-128):::INT8)) AND (table4.col4_1 >= e'\U00002603':::STRING), UNIQUE (col4_1, col4_2 ASC, col4_3, col4_0 DESC), UNIQUE (col4_0, col4_2 DESC, col4_3 ASC) WHERE table4.col4_1 = e'\'':::STRING);
ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 963582855, "histo_col_type": "BIT(32)", "name": "__auto__", "null_count": 3345605513, "row_count": 5000000000}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1968313472, "histo_col_type": "", "name": "__auto__", "null_count": 2301149665, "row_count": 5000000000}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 926971317, "histo_buckets": [{"distinct_range": 0, "num_eq": 7000000, "num_range": 0, "upper_bound": "177.249.123.54/0"}, {"distinct_range": 30000, "num_eq": 0, "num_range": 30000, "upper_bound": "99.252.24.147/10"}, {"distinct_range": 8426260965784404000, "num_eq": 900, "num_range": 8426260965784403463, "upper_bound": "240.143.90.99/11"}, {"distinct_range": 0, "num_eq": 0, "num_range": 30000000, "upper_bound": "118.250.6.75/14"}, {"distinct_range": 70, "num_eq": 5007921241894341646, "num_range": 70, "upper_bound": "43.142.67.234/28"}, {"distinct_range": 5000000, "num_eq": 201035967152224893, "num_range": 5000000, "upper_bound": "c69a:68b6:48f4:185c:d402:fb8f:2954:1cf9/12"}, {"distinct_range": 37372342320417520, "num_eq": 40000, "num_range": 186736595767360868, "upper_bound": "a203:2f1a:d470:944:7ae6:d83c:2c5:79a3/40"}, {"distinct_range": 47439.334223351514, "num_eq": 200000, "num_range": 70000, "upper_bound": "1a60:fe5:81ad:4dec:4113:c1fa:527c:40ed/79"}], "histo_col_type": "INET", "name": "__auto__", "null_count": 572422875, "row_count": 5000000000}]':::JSONB;
ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6837611, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 20000000}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 834592, "histo_col_type": "", "name": "__auto__", "null_count": 18286602, "row_count": 20000000}, {"columns": ["col2_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 16492451, "histo_col_type": "", "name": "__auto__", "null_count": 10155900, "row_count": 20000000}, {"columns": ["col2_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2485155, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 20000000}, {"columns": ["col2_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 10017971, "histo_col_type": "", "name": "__auto__", "null_count": 18687914, "row_count": 20000000}, {"columns": ["col2_18"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3848317, "histo_buckets": [{"distinct_range": 0, "num_eq": 7000, "num_range": 0, "upper_bound": "-0.2260100394487381"}, {"distinct_range": 4062080106473456000, "num_eq": 100, "num_range": 4062080106473456322, "upper_bound": "0.3797610402107239"}], "histo_col_type": "FLOAT4", "name": "__auto__", "null_count": 2097727, "row_count": 20000000}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 16001517, "histo_col_type": "", "name": "__auto__", "null_count": 9301927, "row_count": 20000000}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 11178326, "histo_buckets": [{"distinct_range": 0, "num_eq": 0, "num_range": 0, "upper_bound": "-347156.720539600593"}, {"distinct_range": 40.58394145766478, "num_eq": 1000000000, "num_range": 70, "upper_bound": "37.5466973299788746"}, {"distinct_range": 0, "num_eq": 6240180766385297726, "num_range": 2810190770375532518, "upper_bound": "526090338495284408"}], "histo_col_type": "DECIMAL", "name": "__auto__", "null_count": 0, "row_count": 20000000}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3881564, "histo_col_type": "INT2", "name": "__auto__", "null_count": 18191730, "row_count": 20000000}, {"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 16757022, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 20000000}, {"columns": ["col2_17"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6473722, "histo_col_type": "", "name": "__auto__", "null_count": 14271463, "row_count": 20000000}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 11694127, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 20000000}, {"columns": ["col2_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 17034039, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 20000000}, {"columns": ["col2_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 18484077, "histo_col_type": "", "name": "__auto__", "null_count": 19923422, "row_count": 20000000}, {"columns": ["col2_16"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 14474247, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 20000000}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 15172843, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 20000000}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 19616115, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 20000000}, {"columns": ["col2_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1034224, "histo_col_type": "", "name": "__auto__", "null_count": 9823662, "row_count": 20000000}, {"columns": ["col2_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 15645222, "histo_col_type": "", "name": "__auto__", "null_count": 5288973, "row_count": 20000000}]':::JSONB;
ALTER TABLE table3 INJECT STATISTICS '[{"columns": ["col3_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 348316409859896944, "histo_buckets": [{"distinct_range": 0, "num_eq": 500000, "num_range": 0, "upper_bound": "-24 years -798 days -20:12:52.682591"}, {"distinct_range": 8000000, "num_eq": 4000, "num_range": 8000000, "upper_bound": "-20 years -2 mons -269 days -07:22:12.697546"}, {"distinct_range": 5000000000, "num_eq": 500000000, "num_range": 5000000000, "upper_bound": "00:00:00"}, {"distinct_range": 0, "num_eq": 90000, "num_range": 90000, "upper_bound": "11 years 6 mons 371 days 14:47:27.2798"}], "histo_col_type": "INTERVAL", "name": "__auto__", "null_count": 0, "row_count": 2373702793760829648}, {"columns": ["col3_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1611541343020968918, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2373702793760829648}, {"columns": ["col3_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 156536038574846976, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2373702793760829648}, {"columns": ["col3_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1665825528587820062, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2373702793760829648}]':::JSONB;
ALTER TABLE table4 INJECT STATISTICS e'[{"columns": ["col4_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4669821403988433839, "histo_buckets": [{"distinct_range": 0, "num_eq": 30000000, "num_range": 0, "upper_bound": "-21217312"}, {"distinct_range": 0, "num_eq": 1909599079365510118, "num_range": 1314626460273030978, "upper_bound": "234844244"}], "histo_col_type": "INT4", "name": "__auto__", "null_count": 0, "row_count": 8042389494670372894}, {"columns": ["col4_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 157378240485793062, "histo_col_type": "REGCLASS", "name": "__auto__", "null_count": 0, "row_count": 8042389494670372894}, {"columns": ["col4_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2907475638688475914, "histo_buckets": [{"distinct_range": 0, "num_eq": 6686574657942813630, "num_range": 0, "upper_bound": "\\u0008"}, {"distinct_range": 1442783562735008800, "num_eq": 4701127890417226349, "num_range": 1442783562735008832, "upper_bound": "\\u0016"}, {"distinct_range": 0, "num_eq": 7332129916733214025, "num_range": 6835916853255778868, "upper_bound": "\'"}, {"distinct_range": 800000000, "num_eq": 700000, "num_range": 800000000, "upper_bound": "C"}, {"distinct_range": 15.637708818777872, "num_eq": 8381106643046514676, "num_range": 60, "upper_bound": "D"}, {"distinct_range": 0, "num_eq": 600000, "num_range": 40, "upper_bound": "E"}, {"distinct_range": 20, "num_eq": 200, "num_range": 20, "upper_bound": "\\\\"}, {"distinct_range": 5000, "num_eq": 20000, "num_range": 5000, "upper_bound": "s"}, {"distinct_range": 40, "num_eq": 1000, "num_range": 40, "upper_bound": "u"}], "histo_col_type": "\\"char\\"", "name": "__auto__", "null_count": 0, "row_count": 8042389494670372894}, {"columns": ["col4_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5305311779786681329, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8042389494670372894}]':::JSONB;
ALTER TABLE table4 ADD FOREIGN KEY (col4_0) REFERENCES table2 (col2_7);
CREATE TYPE rand_typ_0 AS ENUM ('ovnvzr');
CREATE TYPE rand_typ_1 AS ENUM ('otih', 'rr', 'nzn');
CREATE TYPE rand_typ_2 AS ENUM ('krh', 'cyz');
;
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
SELECT
g::INT2 AS _int2,
g::INT4 AS _int4,
g::INT8 AS _int8,
g::FLOAT4 AS _float4,
g::FLOAT8 AS _float8,
'2001-01-01'::DATE + g AS _date,
'2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
'2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
g * '1 day'::INTERVAL AS _interval,
g % 2 = 1 AS _bool,
g::DECIMAL AS _decimal,
g::STRING AS _string,
g::STRING::BYTES AS _bytes,
substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
'0.0.0.0'::INET + g AS _inet,
g::STRING::JSONB AS _jsonb,
enum_range('hello'::greeting)[g] as _enum
FROM
generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);
;
rsg_test.go:584:
rsg_test.go:585: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith865399297
--- FAIL: TestRandomSyntaxSQLSmith (301.04s)
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-experience rafiss
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ 84ec89c77841016da0b9c4c71772a4304bad45a5:
Random syntax error:
rsg_test.go:763: Crash detected: server panic: statement exec timeout
Query:
SELECT
tab_51335._interval AS col_125426,
'-Infinity':::DECIMAL AS col_125427,
tab_51332.col1_11 AS col_125428,
NULL AS col_125429,
'2005-03-02 04:36:23.000195+00:00':::TIMESTAMPTZ AS col_125430,
e'a\n':::STRING:::NAME AS col_125431,
503532832610.8883326:::DECIMAL AS col_125432,
NULL AS col_125433,
tab_51336.tableoid AS col_125434,
tab_51330.col1_12 AS col_125435
FROM
defaultdb.public.table1@primary AS tab_51330,
defaultdb.public.table1 AS tab_51331
JOIN defaultdb.public.table1 AS tab_51332 ON
(tab_51331.col1_8) = (tab_51332.col1_8) AND (tab_51331.col1_6) = (tab_51332.col1_6)
JOIN defaultdb.public.table1 AS tab_51333
JOIN defaultdb.public.table1 AS tab_51334 ON (tab_51333.col1_6) = (tab_51334.col1_6) ON
(tab_51331.col1_11) = (tab_51334.col1_11)
AND (tab_51331.col1_11) = (tab_51334.col1_11)
AND (tab_51331.col1_11) = (tab_51334.col1_11)
AND (tab_51332.col1_11) = (tab_51333.col1_11)
JOIN defaultdb.public.seed@[0] AS tab_51335
JOIN defaultdb.public.table1@[0] AS tab_51336 ON
(tab_51335._string) = (tab_51336.col1_13) AND (tab_51335._bool) = (tab_51336.col1_8) ON
(tab_51332.col1_11) = (tab_51336.col1_11)
AND (tab_51332.col1_11) = (tab_51336.col1_12)
AND (tab_51334.col1_11) = (tab_51336.col1_12)
AND (tab_51331.col1_11) = (tab_51336.col1_12)
JOIN defaultdb.public.table1 AS tab_51337
JOIN defaultdb.public.table1 AS tab_51338 ON (tab_51337.col1_6) = (tab_51338.col1_6) ON
(tab_51331.col1_11) = (tab_51337.col1_11)
AND (tab_51332.col1_11) = (tab_51338.col1_11)
AND (tab_51336.col1_13) = (tab_51338.col1_11)
AND (tab_51333.col1_11) = (tab_51337.col1_11)
WHERE
tab_51330.col1_11 ILIKE tab_51338.col1_11;
Schema:
rsg_test.go:580: To reproduce, use schema:
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
CREATE TABLE table1 (col1_0 BIT(4) NULL, col1_1 DATE, col1_2 DECIMAL, col1_3 REGPROC, col1_4 FLOAT8, col1_5 NAME[] NOT NULL, col1_6 NAME NOT NULL, col1_7 BIT(39), col1_8 BOOL NOT NULL, col1_9 BIT(8) NOT NULL, col1_10 TIMESTAMPTZ NOT NULL, col1_11 NAME NOT NULL, PRIMARY KEY (col1_6 ASC, col1_11 DESC, col1_8 ASC), col1_12 STRING NOT NULL AS (lower(CAST(col1_8 AS STRING))) VIRTUAL, col1_13 STRING NOT NULL AS (CASE WHEN col1_10 IS NULL THEN 'zh2':::STRING ELSE 'fCf@':::STRING END) VIRTUAL, INDEX (col1_8, col1_11, col1_12 DESC, col1_0 DESC) WHERE table1.col1_11 <= 'X':::STRING);
ALTER TABLE table1 INJECT STATISTICS e'[{"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_buckets": [{"distinct_range": 0, "num_eq": 0, "num_range": 0, "upper_bound": "\\""}, {"distinct_range": 2594611738.7512226, "num_eq": 40000000000, "num_range": 4000000000, "upper_bound": "\'"}, {"distinct_range": 4412956030239902700, "num_eq": 40, "num_range": 4412956030239902580, "upper_bound": "X"}], "histo_col_type": "NAME", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}]':::JSONB;
CREATE TYPE rand_typ_0 AS ENUM ('pgsb', 'osvu', 'jirug', 'mruql', 'jpnh');
;
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
SELECT
g::INT2 AS _int2,
g::INT4 AS _int4,
g::INT8 AS _int8,
g::FLOAT4 AS _float4,
g::FLOAT8 AS _float8,
'2001-01-01'::DATE + g AS _date,
'2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
'2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
g * '1 day'::INTERVAL AS _interval,
g % 2 = 1 AS _bool,
g::DECIMAL AS _decimal,
g::STRING AS _string,
g::STRING::BYTES AS _bytes,
substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
'0.0.0.0'::INET + g AS _inet,
g::STRING::JSONB AS _jsonb,
enum_range('hello'::greeting)[g] as _enum
FROM
generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);
;
rsg_test.go:584:
rsg_test.go:585: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith988924273
--- FAIL: TestRandomSyntaxSQLSmith (312.21s)
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-experience rafiss
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ 7d0fd136a538b22cbf9bfff03b2885b7783711aa:
Random syntax error:
rsg_test.go:763: Crash detected: server panic: driver: bad connection
Query:
SELECT
tab_42894._inet AS col_89006,
tab_42894._timestamptz AS col_89007,
tab_42894._enum AS col_89008,
(
WITH
with_17473 (col_89009, col_89010)
AS (
SELECT
*
FROM
(
VALUES
('01030000E0E610000000000000':::GEOGRAPHY, NULL),
(
'01030000A0E6100000010000000A000000479ADD658C0C57C0D4D8DB70C64044C038E4B5D286A0EAC1047A2AE8476B41C0F6FA6B3196CA43C0500ECBC9CFC0E8C18CB0E69142654FC066C3DAED223553C0DA053886DCC8FCC18C135790F0E65D400F597BFFD92954C094AE3483BEB5FD417063552C0DDA6440715450C7D00B54C0AE4BC3325D8D0242C0A29880DBAA5F400055F0DD0A3C4840B15861CEABFDF0C1427A4673FBAF504008303212A3894F40F2721D0C9086F74120AD7756EA9814C040A1BA3ADFEB11C05A91133F7547F04143FC7EE9F9B25CC0E860F777A7A827409AF9CEE52A01EEC1479ADD658C0C57C0D4D8DB70C64044C038E4B5D286A0EAC1':::GEOGRAPHY,
e'\x16\x07%\x06=+\x17':::STRING:::NAME
),
(
st_segmentize('01070000E0E61000000400000001060000E0E61000000100000001030000C001000000070000007E0C7D914BD955C01866F7C3A8CA29C0E07DDC160D19EC4128A250D21AF2DB4130288204791A2440568769A1106556C00009067FC321FFC140BCDA44AF8AD741701BC468A65A6140AC41622093843FC0203FF7464736D441A17D9EFFF4FCFDC156FE0F5E10554AC0900EDF177EE84B403A855E30E5DC0042ECF0B65A507E0042A417DB6107C24EC05847C00875CB3E40D0EC5D24216EFFC1B8D8CEDB800CEF41693B8ADC16BA60C04295D34932AE55406421BA4CCB3DDAC1BA7073BC864FF2417E0C7D914BD955C01866F7C3A8CA29C0E07DDC160D19EC4128A250D21AF2DB4101050000E0E61000000400000001020000C00300000098457FEA02AE604018000AA2905224C09C8F738DC427F3415CD9382FE26FFC41D052570B8DD0544030871DDFAB452B40B705DD597FD9FEC1504247728558EC416E727D0202236240B864A3E892924A40B45DF4E1378EDBC1150222ECDF0102C201020000C002000000405468F1BCC74CC0489B7E7B104B51405274562A657EF0411B2D3A120EF7F1C1F2D1C73765975DC01CF9D237385B4B40C497E12396E4FA41B0BD3C8336A1C8C101020000C002000000367691D88F3B63C096615CDFC81E50C0DE742E0A1766F0C1CCC699672C18FAC1CBEE95D39E9D53C0F3F4A5724B484EC0B4DEB8A6D766FF41C6ACBDC50D61024201020000C004000000D4E70F51360456405CF677C89A8E4440388688C572C3F641C427D36C637BE9C1DCD723CBD7245E4072F37943437C5140D236A312F9B3F641A0A576A2E5A5DD4160C7C7CCE3292EC090C635C088734A4000BC895E9D71E8C1F71034CE24D1F0C1129595793EB95EC0541FE7718CDA3E4092BD37440973F34166BFC37C32CEF34101040000E0E61000000700000001010000C001957770903763C0500D48F82AFE48407060839044AAD6411704EC2053C1F0C101010000C08C419A41DF7F61C05860075C642D55C0063D5524200FE8C1DECCD0EF1102F74101010000C0829D850ADBFF6540B8E95A9391CC4040E43020A199B7E941CC63BB1B1DB0FE4101010000C010D5B065229559C08CBFD839454F4C4006FAEF43E814F441BEB1BE3A29D7F7C101010000C0281CF56349CD5A40A221DCC8128550C05C5E44AA6AA6FB41A4F7E0E3FCE4E84101010000C0ACE60EFDA9C158403641D6A4AADD5440101F0FD13A81CA41AE16E7C6399EE9C101010000C000A578BD2154E1BF5C21E7A58730534036C87E291FA0E1C1B4965C549491EAC101050000E0E61000000100000001020000C002000000B0181DB285F855404CF9413129FD5240239488524F2EF2C196907551309AFBC1E74FDBE42AA965C0C0642100FBE30FC0C87BC0F5C425FB41702610A2DE47E4C1':::GEOGRAPHY::GEOGRAPHY, (-0.13970351069077025):::FLOAT8::FLOAT8)::GEOGRAPHY,
e'\\*t4':::STRING:::NAME
),
(
'01020000A0E610000003000000ECEC1E428416554050EE9725543F494058680CF6A0E4E0C1A4AB2F44BE7F4DC0B499DB436F10424028B950D409AADE4149B3A2769E4E5BC0A0FA14BB8A5622401A249D8C6F22F641':::GEOGRAPHY,
e'\t':::STRING:::NAME
)
)
AS tab_42895 (col_89009, col_89010)
INTERSECT
SELECT
*
FROM
(
VALUES
(
st_buffer('0106000060E610000000000000':::GEOGRAPHY::GEOGRAPHY, (-0.3540442574068864):::FLOAT8::FLOAT8, 5014798030256513330:::INT8::INT8)::GEOGRAPHY,
(SELECT NULL AS col_89011 LIMIT 1:::INT8)
),
(
'01040000E0E61000000700000001010000C07CC372700439504094AC1B42AF9452407EF79CEBEBCEEEC12D822D768084F1C101010000C07AFC50F10EC16440BAF9855AA2A055C0C659464B45D9004210B171165EE8CCC101010000C0F8F1A9C52C8448C0B860E1471DCC3DC094CD380AD1B4ED4150444EE4866EC04101010000C0949F461E448751C050DADCD3CD3B5540FEABD75DBECBF44160DEFB4385D0FEC101010000C0889923A55D274C40AAD16F7E07BC50404080D5FE4DB5A7C1F9D76D2637FEFDC101010000C0527388EA3B5266403609FDE6F5324CC04EFF791270DE0142E4F3DB782E03EC4101010000C0405369FDE0F80D40E8AB1144BC994D40A9E426239E8B00C29670D2ADBFEDF4C1':::GEOGRAPHY,
'':::STRING:::NAME
),
(
'0101000020E610000032CD0436A10C6440103E1BC876324F40':::GEOGRAPHY,
'M':::STRING:::NAME
),
(NULL, e'\x1e)\x0e':::STRING:::NAME),
(
'0101000020E6100000C08E1531874846C0B1766E1B409348C0':::GEOGRAPHY,
'a':::STRING:::NAME
)
)
AS tab_42896 (col_89012, col_89013)
EXCEPT ALL
SELECT
NULL AS col_89014, e'\x1a&u](\x1dD\x18q':::STRING:::NAME AS col_89015
FROM
defaultdb.public.seed@seed__int8__float8__date_idx AS tab_42897
)
SELECT
(tab_42894._int2::INT8 // tab_42894._int2::INT8)::INT8 AS col_89016
FROM
with_17473 AS cte_ref_4975
ORDER BY
cte_ref_4975.col_89009 ASC,
cte_ref_4975.col_89010 ASC,
cte_ref_4975.col_89010 ASC,
cte_ref_4975.col_89010 DESC,
cte_ref_4975.col_89009 ASC
LIMIT
1:::INT8
)
AS col_89017,
tab_42894._uuid AS col_89018,
tab_42894._int2 AS col_89019,
11129:::INT8 AS col_89020,
0.2103301598085320660:::DECIMAL AS col_89021,
(-0.39187407825952447):::FLOAT8 AS col_89022,
tab_42894._jsonb AS col_89023,
tab_42894._bool AS col_89024
FROM
defaultdb.public.seed@seed__int8__float8__date_idx AS tab_42894
WHERE
tab_42894._bool
LIMIT
57:::INT8;
Schema:
rsg_test.go:580: To reproduce, use schema:
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
CREATE TABLE table1 (col1_0 TIME NOT NULL, INDEX (col1_0 ASC) WHERE table1.col1_0 < '24:00:00':::TIME, UNIQUE (col1_0) WHERE table1.col1_0 < '24:00:00':::TIME, UNIQUE (col1_0 DESC));
ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 600575268179176000, "histo_buckets": [{"distinct_range": 0, "num_eq": 9000000000, "num_range": 0, "upper_bound": "06:59:50.225305"}, {"distinct_range": 5063435711174475000, "num_eq": 3983072276509508510, "num_range": 8917332506045811076, "upper_bound": "07:11:32.061182"}, {"distinct_range": 7135202999568431000, "num_eq": 500000000, "num_range": 7343602135768443414, "upper_bound": "10:18:08.17639"}, {"distinct_range": 0, "num_eq": 4057636639828069607, "num_range": 0, "upper_bound": "15:10:18.205971"}, {"distinct_range": 0, "num_eq": 400000000, "num_range": 3955672025227555253, "upper_bound": "15:17:12.926968"}, {"distinct_range": 50000, "num_eq": 60000000, "num_range": 50000, "upper_bound": "19:52:47.338217"}, {"distinct_range": 3815654350470298600, "num_eq": 4827982289867960479, "num_range": 4333888165977903203, "upper_bound": "24:00:00"}], "histo_col_type": "TIME", "name": "__auto__", "null_count": 0, "row_count": 4651523376230557080}]':::JSONB;
CREATE TYPE rand_typ_0 AS ENUM ('lcvty');
;
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
SELECT
g::INT2 AS _int2,
g::INT4 AS _int4,
g::INT8 AS _int8,
g::FLOAT4 AS _float4,
g::FLOAT8 AS _float8,
'2001-01-01'::DATE + g AS _date,
'2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
'2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
g * '1 day'::INTERVAL AS _interval,
g % 2 = 1 AS _bool,
g::DECIMAL AS _decimal,
g::STRING AS _string,
g::STRING::BYTES AS _bytes,
substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
'0.0.0.0'::INET + g AS _inet,
g::STRING::JSONB AS _jsonb,
enum_range('hello'::greeting)[g] as _enum
FROM
generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);
;
rsg_test.go:584:
rsg_test.go:585: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith433074694
--- FAIL: TestRandomSyntaxSQLSmith (300.72s)
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-experience rafiss
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ fa1da4ac2872533007e4ed4c70127f85040ecb25:
Random syntax error:
rsg_test.go:763: Crash detected: server panic: pq: internal error: unexpectedly found decreasing offsets: [0 1 2 3 4 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
Query:
SELECT
'1984-11-25':::DATE AS col_93561,
e'^\x0f``$V\x027\x7f':::STRING AS col_93562,
(-1):::INT8 AS col_93563,
(-231):::INT8 AS col_93564,
NULL AS col_93565,
NULL AS col_93566,
'good day':::greeting AS col_93567,
CASE WHEN tab_39661._bool THEN tab_39661._bytes ELSE tab_39661._bytes END AS col_93568,
true AS col_93569,
tab_39661._interval AS col_93570,
tab_39661._timestamp AS col_93571,
'NaN':::DECIMAL AS col_93572
FROM
defaultdb.public.seed@[0] AS tab_39661
LIMIT
90:::INT8;
Schema:
rsg_test.go:580: To reproduce, use schema:
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
CREATE TABLE table1 (col1_0 DECIMAL NOT NULL, col1_1 FLOAT8, col1_2 GEOMETRY, col1_3 JSONB NOT NULL, col1_4 VARCHAR, col1_5 INTERVAL NOT NULL, col1_6 CHAR NULL, col1_7 TIME NULL, col1_8 FLOAT4 NULL, col1_9 FLOAT8 NULL, col1_10 STRING NOT NULL AS (lower(CAST(col1_5 AS STRING))) STORED, col1_11 STRING NULL AS (lower(col1_6)) STORED);
CREATE TABLE table2 (col2_0 BYTES, col2_1 FLOAT8 NULL, col2_2 FLOAT8 NOT NULL, col2_3 CHAR NOT NULL, col2_4 FLOAT4 NOT NULL, col2_5 JSONB NULL, col2_6 REGNAMESPACE NOT NULL, col2_7 BOOL NULL, col2_8 STRING NULL AS (lower(CAST(col2_5 AS STRING))) VIRTUAL, col2_9 FLOAT8 NOT NULL AS (col2_2 + (-0.7259082721993243):::FLOAT8) VIRTUAL, UNIQUE (col2_2 ASC, col2_0 DESC, col2_1 ASC, col2_9 DESC, col2_6, col2_7 ASC, col2_3, col2_8, col2_4), INDEX (col2_9 ASC, col2_2 DESC, col2_1 ASC, col2_4, col2_0, col2_7, col2_3 DESC), UNIQUE (col2_2 ASC, col2_8 DESC, col2_7 ASC, col2_4), UNIQUE (col2_4) WHERE table2.col2_7 AND (table2.col2_1 < 0.0:::FLOAT8));
CREATE TABLE table3 (col3_0 VARCHAR NOT NULL, col3_1 BOX2D NOT NULL, col3_2 REGPROCEDURE NULL, col3_3 UUID, col3_4 FLOAT4 NOT NULL, PRIMARY KEY (col3_4 DESC, col3_0), col3_5 FLOAT4 NOT NULL AS (col3_4 + (-0.47279787063598633):::FLOAT8) VIRTUAL, col3_6 STRING NULL AS (lower(CAST(col3_2 AS STRING))) VIRTUAL, UNIQUE (col3_4 ASC, col3_2, col3_5, col3_3 DESC) WHERE (table3.col3_0 <= '"':::STRING) OR (table3.col3_5 = 0.0:::FLOAT8), FAMILY (col3_2, col3_1, col3_0, col3_3, col3_4));
CREATE TABLE table4 (col4_0 INT8, col4_1 INTERVAL NULL, col4_2 OID NULL, col4_3 TIMESTAMP NOT NULL, col4_4 JSONB, col4_5 UUID, col4_6 BIT(17) NULL, col4_7 TIMESTAMP NULL, col4_8 CHAR NULL, col4_9 TIMESTAMPTZ NOT NULL, col4_10 FLOAT8 NOT NULL, col4_11 STRING NOT NULL AS (CASE WHEN col4_9 IS NULL THEN '':::STRING ELSE ' ':::STRING END) VIRTUAL, col4_12 STRING NULL AS (lower(col4_8)) VIRTUAL, col4_13 STRING NULL AS (lower(CAST(col4_2 AS STRING))) VIRTUAL, col4_14 STRING NULL AS (lower(CAST(col4_7 AS STRING))) STORED, UNIQUE (col4_5 ASC) WHERE (((((((((table4.col4_12 < e'\'':::STRING) AND (table4.col4_11 <= e'\x00':::STRING)) AND (table4.col4_0 != 127:::INT8)) AND (table4.col4_8 <= '':::STRING)) OR (table4.col4_14 != e'\U00002603':::STRING)) OR (table4.col4_13 <= e'\U00002603':::STRING)) OR (table4.col4_10 >= 0.0:::FLOAT8)) AND (table4.col4_7 != '294276-12-31 23:59:59.999999':::TIMESTAMP)) AND (table4.col4_3 <= '-2000-01-01 00:00:00':::TIMESTAMP)) OR (table4.col4_9 >= '3000-01-01 00:00:00+00:00':::TIMESTAMPTZ));
ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4738899705983924605, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 9221453941533458086}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4226374864035721767, "histo_col_type": "", "name": "__auto__", "null_count": 2563801286373714842, "row_count": 9221453941533458086}, {"columns": ["col1_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2136827450734931629, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 9221453941533458086}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1800270292462114567, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 9221453941533458086}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 8344117031195591477, "histo_col_type": "", "name": "__auto__", "null_count": 5457195577002618100, "row_count": 9221453941533458086}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3713267807326158128, "histo_col_type": "", "name": "__auto__", "null_count": 1736327623417356714, "row_count": 9221453941533458086}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7873426810657082800, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 9221453941533458086}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2002911935451503162, "histo_col_type": "", "name": "__auto__", "null_count": 4523434887195312028, "row_count": 9221453941533458086}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1136457353300987473, "histo_col_type": "", "name": "__auto__", "null_count": 3028885834112352120, "row_count": 9221453941533458086}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1411410816034103853, "histo_col_type": "", "name": "__auto__", "null_count": 1503538327389011729, "row_count": 9221453941533458086}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5244955829573517787, "histo_col_type": "", "name": "__auto__", "null_count": 2307318358630661540, "row_count": 9221453941533458086}, {"columns": ["col1_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5844116640439429471, "histo_col_type": "", "name": "__auto__", "null_count": 1011367714330343496, "row_count": 9221453941533458086}]':::JSONB;
ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1446779054156940135, "histo_col_type": "", "name": "__auto__", "null_count": 2109553367417003596, "row_count": 3088568627760811158}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2424199510401682339, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 3088568627760811158}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1557295215474577809, "histo_col_type": "", "name": "__auto__", "null_count": 2996712985363452401, "row_count": 3088568627760811158}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1653959703105177279, "histo_buckets": [{"distinct_range": 0, "num_eq": 900000, "num_range": 0, "upper_bound": "-1.825646092939342"}, {"distinct_range": 0, "num_eq": 0, "num_range": 70, "upper_bound": "-0.8399032160793136"}, {"distinct_range": 8000, "num_eq": 7239129797511104070, "num_range": 8000, "upper_bound": "-0.12647392636145283"}, {"distinct_range": 0, "num_eq": 861127908344730949, "num_range": 0, "upper_bound": "-0.08738757043241341"}, {"distinct_range": 0, "num_eq": 4885955999732860547, "num_range": 8000, "upper_bound": "0.3446849741514671"}, {"distinct_range": 0, "num_eq": 100000000000, "num_range": 2550663456828963098, "upper_bound": "0.3759500915816097"}, {"distinct_range": 0, "num_eq": 40000000000, "num_range": 10000000000, "upper_bound": "0.9481107781555056"}], "histo_col_type": "FLOAT8", "name": "__auto__", "null_count": 0, "row_count": 3088568627760811158}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2059142982562858561, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 3088568627760811158}, {"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2499183559670780799, "histo_col_type": "", "name": "__auto__", "null_count": 120050392661212475, "row_count": 3088568627760811158}, {"columns": ["col2_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2943411308144201421, "histo_col_type": "FLOAT8", "name": "__auto__", "null_count": 0, "row_count": 3088568627760811158}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2651569394906040931, "histo_col_type": "", "name": "__auto__", "null_count": 2661600650423327688, "row_count": 3088568627760811158}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2743866041860775967, "histo_buckets": [{"distinct_range": 0, "num_eq": 7040755867880577362, "num_range": 0, "upper_bound": "-0.07112147659063339"}, {"distinct_range": 0, "num_eq": 70000000, "num_range": 9000, "upper_bound": "1.1008074283599854"}, {"distinct_range": 4000, "num_eq": 6636213858159360176, "num_range": 4000, "upper_bound": "1.1404885053634644"}], "histo_col_type": "FLOAT4", "name": "__auto__", "null_count": 0, "row_count": 3088568627760811158}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1055830828277783634, "histo_col_type": "", "name": "__auto__", "null_count": 2955356280576538575, "row_count": 3088568627760811158}]':::JSONB;
ALTER TABLE table3 INJECT STATISTICS '[{"columns": ["col3_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 13789273240, "histo_col_type": "", "name": "__auto__", "null_count": 72068767216, "row_count": 100000000000}, {"columns": ["col3_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6327093633, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 100000000000}, {"columns": ["col3_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 81005176588, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 100000000000}, {"columns": ["col3_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 50355201704, "histo_col_type": "", "name": "__auto__", "null_count": 72323930443, "row_count": 100000000000}, {"columns": ["col3_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 73821691155, "histo_col_type": "", "name": "__auto__", "null_count": 89726626804, "row_count": 100000000000}, {"columns": ["col3_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 83332895396, "histo_buckets": [{"distinct_range": 0, "num_eq": 4335871973479107608, "num_range": 0, "upper_bound": "-0.825177788734436"}, {"distinct_range": 32331581243.566734, "num_eq": 2000000, "num_range": 70000000000, "upper_bound": "-0.5047558546066284"}, {"distinct_range": 0, "num_eq": 7179998192617619918, "num_range": 0, "upper_bound": "-0.3046923875808716"}, {"distinct_range": 800, "num_eq": 80000000, "num_range": 800, "upper_bound": "-0.13461454212665558"}, {"distinct_range": 0, "num_eq": 6254773501228515353, "num_range": 8980940571042075947, "upper_bound": "-0.01209606509655714"}, {"distinct_range": 7096011557306334000, "num_eq": 4000000000, "num_range": 7096011557306334328, "upper_bound": "0.0"}, {"distinct_range": 3.2826230398220453, "num_eq": 3018174912701181072, "num_range": 20, "upper_bound": "0.16057537496089935"}, {"distinct_range": 0, "num_eq": 0, "num_range": 900, "upper_bound": "0.30731359124183655"}, {"distinct_range": 7000000, "num_eq": 40000000000, "num_range": 7000000, "upper_bound": "0.44047465920448303"}], "histo_col_type": "FLOAT4", "name": "__auto__", "null_count": 0, "row_count": 100000000000}, {"columns": ["col3_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 79570249398, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 100000000000}]':::JSONB;
ALTER TABLE table4 INJECT STATISTICS '[{"columns": ["col4_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 380893586935585349, "histo_col_type": "", "name": "__auto__", "null_count": 427772067700268402, "row_count": 1954093395952842524}, {"columns": ["col4_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 796651971476276097, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1954093395952842524}, {"columns": ["col4_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1140356917613815176, "histo_col_type": "", "name": "__auto__", "null_count": 117753474282430490, "row_count": 1954093395952842524}, {"columns": ["col4_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1564828567052730886, "histo_col_type": "", "name": "__auto__", "null_count": 1302061918343294195, "row_count": 1954093395952842524}, {"columns": ["col4_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 215216145084112274, "histo_col_type": "", "name": "__auto__", "null_count": 983533936501896398, "row_count": 1954093395952842524}, {"columns": ["col4_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 81816391735996445, "histo_buckets": [{"distinct_range": 0, "num_eq": 80000000000, "num_range": 0, "upper_bound": "557c20bd-fd77-4de6-a3c2-ee42ede7c69e"}, {"distinct_range": 260281797.9483047, "num_eq": 1000000, "num_range": 300000000, "upper_bound": "66738f8d-e82b-4717-b90c-1e8081a0434e"}, {"distinct_range": 4660788573962397000, "num_eq": 500, "num_range": 4660788573962396795, "upper_bound": "6bd8a0d0-e39d-4adf-8c8e-01691abdc4c3"}, {"distinct_range": 400000000, "num_eq": 1000000000, "num_range": 400000000, "upper_bound": "8da4b0ee-cfdb-4699-b1a4-e901a4d2c488"}, {"distinct_range": 3351615013533892600, "num_eq": 7000, "num_range": 3594732301475570354, "upper_bound": "d6c8b5a4-ad2e-4c05-891c-2d85ab104912"}], "histo_col_type": "UUID", "name": "__auto__", "null_count": 1659657756528835141, "row_count": 1954093395952842524}, {"columns": ["col4_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1561032711439613172, "histo_col_type": "", "name": "__auto__", "null_count": 1342147061026018749, "row_count": 1954093395952842524}, {"columns": ["col4_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1215104771087482016, "histo_col_type": "", "name": "__auto__", "null_count": 516362756066461309, "row_count": 1954093395952842524}, {"columns": ["col4_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1299752218504357139, "histo_col_type": "", "name": "__auto__", "null_count": 1077939050530371974, "row_count": 1954093395952842524}, {"columns": ["col4_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1691493659638982366, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1954093395952842524}, {"columns": ["col4_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 342787240166139862, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1954093395952842524}, {"columns": ["col4_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1844260354808299157, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1954093395952842524}, {"columns": ["col4_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1854521753159212551, "histo_col_type": "", "name": "__auto__", "null_count": 487034123406003941, "row_count": 1954093395952842524}, {"columns": ["col4_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1233454107960151802, "histo_col_type": "", "name": "__auto__", "null_count": 1059528501156845159, "row_count": 1954093395952842524}, {"columns": ["col4_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 366490109886728691, "histo_col_type": "", "name": "__auto__", "null_count": 1354190972957096452, "row_count": 1954093395952842524}]':::JSONB;
CREATE TYPE rand_typ_0 AS ENUM ('kkvhtn', 'dc', 'xykith', 'r');
CREATE TYPE rand_typ_1 AS ENUM ('xe', 'ewxcvp', 'gbqi', 'wxe', 'oft', 'ryskq');
CREATE TYPE rand_typ_2 AS ENUM ('lx', 'y', 'rnbur', 'djwy', 'fsh');
;
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
SELECT
g::INT2 AS _int2,
g::INT4 AS _int4,
g::INT8 AS _int8,
g::FLOAT4 AS _float4,
g::FLOAT8 AS _float8,
'2001-01-01'::DATE + g AS _date,
'2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
'2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
g * '1 day'::INTERVAL AS _interval,
g % 2 = 1 AS _bool,
g::DECIMAL AS _decimal,
g::STRING AS _string,
g::STRING::BYTES AS _bytes,
substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
'0.0.0.0'::INET + g AS _inet,
g::STRING::JSONB AS _jsonb,
enum_range('hello'::greeting)[g] as _enum
FROM
generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);
;
rsg_test.go:584:
rsg_test.go:585: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith337848044
--- FAIL: TestRandomSyntaxSQLSmith (300.82s)
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-experience rafiss
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ 5a5b3dc446fcfc2d3e28b6775ae9bb1a63376210:
Random syntax error:
rsg_test.go:763: Crash detected: server panic: pq: internal error: unexpectedly found decreasing offsets: [0 1 2 3 4 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
Query:
SELECT
CASE WHEN tab_138902._bool THEN tab_138902._bytes ELSE tab_138902._bytes END AS col_323354,
tab_138902._enum AS col_323355
FROM
defaultdb.public.seed@[0] AS tab_138902
LIMIT
35:::INT8;
Schema:
rsg_test.go:580: To reproduce, use schema:
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
CREATE TABLE table1 (col1_0 "char", col1_1 REGPROC NOT NULL, col1_2 TIMETZ NULL, col1_3 DECIMAL NOT NULL, col1_4 GEOMETRY NOT NULL, col1_5 UUID NOT NULL, col1_6 JSONB NOT NULL, col1_7 STRING NOT NULL AS (lower(CAST(col1_1 AS STRING))) STORED, col1_8 DECIMAL NOT NULL AS (col1_3 + (-124090324051269.8090):::DECIMAL) STORED, INDEX (col1_5, col1_1 ASC, col1_7, col1_0 DESC, col1_3 DESC, col1_8 DESC) STORING (col1_2, col1_4, col1_6) WHERE table1.col1_7 < e'\'':::STRING, FAMILY (col1_5), FAMILY (col1_0, col1_8, col1_7, col1_1), FAMILY (col1_6), FAMILY (col1_3, col1_4, col1_2));
CREATE TABLE table2 (col2_0 NAME NOT NULL, col2_1 CHAR, col2_2 BIT(22), col2_3 CHAR NOT NULL, PRIMARY KEY (col2_3 ASC, col2_0 ASC), col2_4 STRING NOT NULL AS (lower(col2_0)) VIRTUAL, col2_5 STRING NOT NULL AS (lower(col2_0)) VIRTUAL, INDEX (col2_4 ASC, col2_0 ASC, col2_1 ASC, col2_2 DESC) WHERE table2.col2_5 >= '':::STRING, UNIQUE (col2_2 ASC, col2_3 ASC, col2_4 ASC, col2_1, col2_0 DESC), INDEX (col2_2 DESC) STORING (col2_1) WHERE table2.col2_5 > '"':::STRING, UNIQUE (col2_1, col2_4, col2_3 DESC, col2_2 DESC, col2_5 DESC, col2_0 ASC), INDEX (col2_0 DESC, col2_3), UNIQUE (col2_3 ASC, col2_4 DESC, col2_0, col2_1 ASC, col2_2 ASC, col2_5 DESC), UNIQUE (col2_4 ASC) STORING (col2_2) WHERE ((((table2.col2_3 != e'\x00':::STRING) OR (table2.col2_5 <= e'\U00002603':::STRING)) OR (table2.col2_0 > 'X':::STRING)) OR (table2.col2_4 > e'\U00002603':::STRING)) AND (table2.col2_1 < e'\U00002603':::STRING), UNIQUE (col2_0, col2_2 DESC, col2_1 ASC, col2_3) WHERE ((((table2.col2_5 = '"':::STRING) OR (table2.col2_4 >= e'\'':::STRING)) OR (table2.col2_1 = 'X':::STRING)) AND (table2.col2_0 <= e'\x00':::STRING)) OR (table2.col2_3 >= e'\x00':::STRING), UNIQUE (col2_3 DESC, col2_5 DESC, col2_4 DESC), FAMILY (col2_1, col2_0), FAMILY (col2_3, col2_2));
CREATE TABLE table3 (col2_3 CHAR NOT NULL, col2_0 NAME NOT NULL, col3_2 NAME, col3_3 INET, col3_4 DATE NOT NULL, col3_5 STRING NOT NULL, col3_6 OID NULL, col3_7 REGNAMESPACE NOT NULL, col3_8 BOX2D NOT NULL, PRIMARY KEY (col2_3 ASC, col2_0 ASC, col3_3, col3_6 DESC, col3_2, col3_7), INDEX (col3_3 DESC, col3_5, col3_4 DESC, col3_8 ASC, col3_2 ASC, col3_6, col3_7 DESC, col2_0, col2_3), INDEX (col3_6 ASC, col3_4) WHERE ((((table3.col2_0 <= e'\'':::STRING) OR (table3.col3_5 <= '"':::STRING)) OR (table3.col2_3 = 'X':::STRING)) AND (table3.col3_2 != '':::STRING)) AND (table3.col3_4 >= '4714-11-24 BC':::DATE), UNIQUE (col3_5 ASC, col3_3 ASC, col3_4 ASC, col3_2, col3_7 DESC, col2_0, col3_8 ASC, col3_6 ASC, col2_3), UNIQUE (col2_3 DESC, col3_3 DESC, col3_4 ASC, col3_5 ASC), UNIQUE (col3_5 ASC) STORING (col3_8) WHERE ((((table3.col2_0 <= 'X':::STRING) OR (table3.col3_5 > 'X':::STRING)) AND (table3.col2_3 < e'\'':::STRING)) OR (table3.col3_2 = '"':::STRING)) OR (table3.col3_4 > '4714-11-24 BC':::DATE)) INTERLEAVE IN PARENT table2 (col2_3, col2_0);
ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7120335568604684961, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8879440267955287069}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3266579717484662561, "histo_buckets": [{"distinct_range": 0, "num_eq": 5157373051282158123, "num_range": 0, "upper_bound": "270dec07-371d-4179-8326-465493675fc5"}, {"distinct_range": 7159222495630235000, "num_eq": 100000000, "num_range": 7159222495630234414, "upper_bound": "9b6aabe6-698b-4fbe-a2fa-2fd916f624e8"}], "histo_col_type": "UUID", "name": "__auto__", "null_count": 0, "row_count": 8879440267955287069}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1102832774666900265, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8879440267955287069}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 8567168634796155300, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8879440267955287069}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 241793036114688202, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8879440267955287069}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1131472881203791838, "histo_col_type": "", "name": "__auto__", "null_count": 1225270940888789087, "row_count": 8879440267955287069}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4802545710554737316, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8879440267955287069}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5856106357344079413, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8879440267955287069}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4102354886079796334, "histo_col_type": "", "name": "__auto__", "null_count": 293800686170686965, "row_count": 8879440267955287069}]':::JSONB;
ALTER TABLE table2 INJECT STATISTICS e'[{"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 14710, "histo_col_type": "CHAR", "name": "__auto__", "null_count": 0, "row_count": 20000}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6123, "histo_buckets": [{"distinct_range": 0, "num_eq": 200000000, "num_range": 0, "upper_bound": ""}, {"distinct_range": 4995753085649877000, "num_eq": 6962795281474744054, "num_range": 4995753085649876495, "upper_bound": ")Q\\u00068"}, {"distinct_range": 1563.3102733590315, "num_eq": 4248080818864826469, "num_range": 8000, "upper_bound": "X\\u000fgsvg\\u001d"}, {"distinct_range": 1164058018939199000, "num_eq": 8828629602693852273, "num_range": 1164058018939198955, "upper_bound": "b"}, {"distinct_range": 50.146298297784526, "num_eq": 3349678225944831015, "num_range": 80, "upper_bound": "pZ=}b_\\u0019"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 0, "row_count": 20000}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 15782, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 20000}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 16038, "histo_buckets": [{"distinct_range": 0, "num_eq": 166897363517400192, "num_range": 0, "upper_bound": "\\u001b9\\rF\\u0004"}], "histo_col_type": "NAME", "name": "__auto__", "null_count": 0, "row_count": 20000}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5365, "histo_buckets": [{"distinct_range": 0, "num_eq": 30000, "num_range": 0, "upper_bound": ""}, {"distinct_range": 3592483698552726000, "num_eq": 100000000, "num_range": 4086908787622294389, "upper_bound": "\\u0012"}, {"distinct_range": 241824310657759870, "num_eq": 2000, "num_range": 2299325605869770755, "upper_bound": "+"}, {"distinct_range": 0, "num_eq": 2173512724499960188, "num_range": 5000, "upper_bound": "j"}, {"distinct_range": 30, "num_eq": 6965720726844177374, "num_range": 30, "upper_bound": "r"}], "histo_col_type": "CHAR", "name": "__auto__", "null_count": 2941, "row_count": 20000}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 19370, "histo_buckets": [{"distinct_range": 0, "num_eq": 2000000000, "num_range": 0, "upper_bound": "1001110110101000001110"}, {"distinct_range": 0, "num_eq": 7055749930931513917, "num_range": 90000000, "upper_bound": "1011001011100001111101"}, {"distinct_range": 10000, "num_eq": 40000, "num_range": 10000, "upper_bound": "1011011110101110001010"}, {"distinct_range": 403052844415418000, "num_eq": 5941812508922439834, "num_range": 1381571867085490915, "upper_bound": "1111011001111011000111"}], "histo_col_type": "BIT(22)", "name": "__auto__", "null_count": 19839, "row_count": 20000}]':::JSONB;
ALTER TABLE table3 INJECT STATISTICS '[{"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 106, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 200}, {"columns": ["col3_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 64, "histo_buckets": [{"distinct_range": 0, "num_eq": 9140295296510307921, "num_range": 0, "upper_bound": "8195:4ed6:ebb4:46eb:572e:4f5d:7935:a697/105"}], "histo_col_type": "INET", "name": "__auto__", "null_count": 65, "row_count": 200}, {"columns": ["col3_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 95, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 200}, {"columns": ["col3_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 43, "histo_buckets": [{"distinct_range": 0, "num_eq": 3575014024307238654, "num_range": 0, "upper_bound": "205497700"}], "histo_col_type": "OID", "name": "__auto__", "null_count": 34, "row_count": 200}, {"columns": ["col3_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 79, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 200}, {"columns": ["col3_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 145, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 200}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 170, "histo_buckets": [{"distinct_range": 0, "num_eq": 0, "num_range": 0, "upper_bound": "0"}, {"distinct_range": 0, "num_eq": 10000, "num_range": 8467195330326552597, "upper_bound": "6"}, {"distinct_range": 82134.16270760946, "num_eq": 5422464750300485077, "num_range": 200000, "upper_bound": "<"}, {"distinct_range": 0, "num_eq": 9000, "num_range": 6418679191415069370, "upper_bound": "e"}], "histo_col_type": "CHAR", "name": "__auto__", "null_count": 0, "row_count": 200}, {"columns": ["col3_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 118, "histo_col_type": "", "name": "__auto__", "null_count": 133, "row_count": 200}, {"columns": ["col3_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 89, "histo_col_type": "STRING", "name": "__auto__", "null_count": 0, "row_count": 200}]':::JSONB;
CREATE TYPE rand_typ_0 AS ENUM ('u', 'uuue', 'hs', 'w', 'j', 'rq');
CREATE TYPE rand_typ_1 AS ENUM ('lehkpi', 'geroqc', 'b', 'evr', 'irxcrz');
CREATE TYPE rand_typ_2 AS ENUM ('udy', 'tlwvp', 'oh', 'tcwen');
CREATE TYPE rand_typ_3 AS ENUM ('j');
;
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
SELECT
g::INT2 AS _int2,
g::INT4 AS _int4,
g::INT8 AS _int8,
g::FLOAT4 AS _float4,
g::FLOAT8 AS _float8,
'2001-01-01'::DATE + g AS _date,
'2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
'2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
g * '1 day'::INTERVAL AS _interval,
g % 2 = 1 AS _bool,
g::DECIMAL AS _decimal,
g::STRING AS _string,
g::STRING::BYTES AS _bytes,
substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
'0.0.0.0'::INET + g AS _inet,
g::STRING::JSONB AS _jsonb,
enum_range('hello'::greeting)[g] as _enum
FROM
generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);
;
rsg_test.go:584:
rsg_test.go:585: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith519611613
--- FAIL: TestRandomSyntaxSQLSmith (300.82s)
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-experience rafiss
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ efb4fd2b406cd47b505b4f1a1d5700fc79841469:
Random syntax error:
rsg_test.go:763: Crash detected: server panic: pq: internal error: unexpectedly found decreasing offsets: [0 8 9 17 18 26 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
Query:
SELECT
tab_3233._int8 AS col_7417,
'null':::JSONB AS col_7418,
'howdy':::greeting AS col_7419,
NULL AS col_7420,
CASE WHEN tab_3233._bool THEN e'\x07``w9]zno':::STRING ELSE tab_3233._string END AS col_7421
FROM
defaultdb.public.seed@[0] AS tab_3233
LIMIT
55:::INT8;
Schema:
rsg_test.go:580: To reproduce, use schema:
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
CREATE TABLE table1 (col1_0 INT4, col1_1 TIMESTAMPTZ NOT NULL, col1_2 REGPROCEDURE, col1_3 CHAR NOT NULL, col1_4 REGPROC NOT NULL, col1_5 REGTYPE NOT NULL, col1_6 TIMESTAMP, col1_7 BOOL NULL, col1_8 REGPROC NOT NULL, col1_9 BYTES NULL, col1_10 FLOAT4, col1_11 TIMESTAMP NULL, col1_12 JSONB NOT NULL, col1_13 CHAR, col1_14 TIMESTAMPTZ, col1_15 FLOAT4 AS (col1_10 + 1.270900011062622:::FLOAT8) VIRTUAL, col1_16 FLOAT4 AS (col1_10 + 1.3506039381027222:::FLOAT8) VIRTUAL, UNIQUE (col1_8 DESC) WHERE ((table1.col1_14 = '3000-01-01 00:00:00+00:00':::TIMESTAMPTZ) OR (table1.col1_0 < (-1):::INT8)) AND (table1.col1_13 != '"':::STRING), INDEX (col1_16, col1_13, col1_10 DESC, col1_0 DESC) STORING (col1_2, col1_3, col1_7));
CREATE TABLE table2 (col2_0 BOX2D NULL, col2_1 FLOAT4 NULL, col2_2 GEOMETRY);
ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2156520908860787422, "histo_col_type": "", "name": "__auto__", "null_count": 752974411784581609, "row_count": 4891193586248839506}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1133570084557342893, "histo_col_type": "", "name": "__auto__", "null_count": 2729600417633821173, "row_count": 4891193586248839506}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1919837513329489519, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4891193586248839506}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4053355667427817854, "histo_col_type": "", "name": "__auto__", "null_count": 1843441972451342370, "row_count": 4891193586248839506}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1936544169158921445, "histo_col_type": "", "name": "__auto__", "null_count": 2005557140480818902, "row_count": 4891193586248839506}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1369988342183560718, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4891193586248839506}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 271287682315877109, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4891193586248839506}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3050184286098979493, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4891193586248839506}, {"columns": ["col1_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3080741187143343086, "histo_col_type": "", "name": "__auto__", "null_count": 1006771773328930414, "row_count": 4891193586248839506}, {"columns": ["col1_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 89678889437480157, "histo_col_type": "", "name": "__auto__", "null_count": 1475818187854486874, "row_count": 4891193586248839506}, {"columns": ["col1_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3278673441610009635, "histo_col_type": "", "name": "__auto__", "null_count": 541786788351957398, "row_count": 4891193586248839506}, {"columns": ["col1_16"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2002534522559793358, "histo_col_type": "FLOAT4", "name": "__auto__", "null_count": 2326188909554276287, "row_count": 4891193586248839506}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2312800128007489888, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4891193586248839506}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1729897693053809965, "histo_col_type": "", "name": "__auto__", "null_count": 4871148360466106796, "row_count": 4891193586248839506}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 451740065565414916, "histo_col_type": "", "name": "__auto__", "null_count": 2080539954886647006, "row_count": 4891193586248839506}, {"columns": ["col1_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 384082133387801600, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4891193586248839506}, {"columns": ["col1_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1712318578056142496, "histo_col_type": "", "name": "__auto__", "null_count": 2500067724596146314, "row_count": 4891193586248839506}]':::JSONB;
ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2846927641864170174, "histo_col_type": "", "name": "__auto__", "null_count": 1813973199855298255, "row_count": 7291311516129713907}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4840761749277771199, "histo_col_type": "", "name": "__auto__", "null_count": 3160321167600217563, "row_count": 7291311516129713907}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2244171959934222151, "histo_col_type": "", "name": "__auto__", "null_count": 3875415931302918568, "row_count": 7291311516129713907}]':::JSONB;
CREATE TYPE rand_typ_0 AS ENUM ('icra', 'rlyn');
CREATE TYPE rand_typ_1 AS ENUM ('ldrqhc', 'fy', 'dxmu');
CREATE TYPE rand_typ_2 AS ENUM ('j', 'a', 'jbznwp', 'tx', 'bb', 'k');
;
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
SELECT
g::INT2 AS _int2,
g::INT4 AS _int4,
g::INT8 AS _int8,
g::FLOAT4 AS _float4,
g::FLOAT8 AS _float8,
'2001-01-01'::DATE + g AS _date,
'2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
'2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
g * '1 day'::INTERVAL AS _interval,
g % 2 = 1 AS _bool,
g::DECIMAL AS _decimal,
g::STRING AS _string,
g::STRING::BYTES AS _bytes,
substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
'0.0.0.0'::INET + g AS _inet,
g::STRING::JSONB AS _jsonb,
enum_range('hello'::greeting)[g] as _enum
FROM
generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);
;
rsg_test.go:584:
rsg_test.go:585: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith808723612
--- FAIL: TestRandomSyntaxSQLSmith (300.72s)
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-experience rafiss
I assigned @yuzefovich because I figured Radu was just assigned at random, but if that was on purpose sorry and please ignore!
Based on this comment Radu was assigned to look into some stuff, but the latest several occurrences are because of minor omission in the case operator refactor (which I'll address shortly), so I'm assigning back to Radu.
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ 5fd1dda1cde0a91643d39209c6458dcefcbfc180:
Random syntax error:
rsg_test.go:763: Crash detected: server panic: pq: internal error: unexpected error from the vectorized engine: unhandled cast float4 -> float
Query:
SELECT
'1994-04-03':::DATE AS col_10756,
B'1000000011000000001100010111111111111001101' AS col_10757,
tab_4606.col4_4 AS col_10758,
43365383992414.09774:::DECIMAL AS col_10759
FROM
defaultdb.public.table5@[0] AS tab_4603
JOIN defaultdb.public.table4@[0] AS tab_4604
JOIN defaultdb.public.seed@seed__int8__float8__date_idx AS tab_4605
JOIN defaultdb.public.table4@table4_col4_5_key AS tab_4606 ON
(tab_4605.crdb_internal_mvcc_timestamp) = (tab_4606.crdb_internal_mvcc_timestamp)
AND (tab_4605._float4) = (tab_4606.col4_4) ON
(tab_4604.col4_4) = (tab_4605._float8) AND (tab_4604.col4_6) = (tab_4606.col4_4) ON
(tab_4603.col5_9) = (tab_4604.col4_7) AND (tab_4603.tableoid) = (tab_4604.tableoid)
WHERE
tab_4605._bool
ORDER BY
tab_4604.col4_2
LIMIT
64:::INT8;
Schema:
rsg_test.go:580: To reproduce, use schema:
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
CREATE TABLE table1 (col1_0 REGNAMESPACE NOT NULL, col1_1 DATE NOT NULL, col1_2 BOOL NOT NULL, col1_3 REGNAMESPACE NOT NULL, col1_4 INTERVAL, col1_5 "char", col1_6 TIMESTAMP NOT NULL, col1_7 INT4 NOT NULL, col1_8 VARCHAR NOT NULL, col1_9 REGCLASS NOT NULL, PRIMARY KEY (col1_8, col1_9, col1_0 DESC, col1_2 ASC), col1_10 STRING NOT NULL AS (lower(CAST(col1_9 AS STRING))) VIRTUAL, col1_11 STRING NOT NULL AS (lower(CAST(col1_9 AS STRING))) STORED, FAMILY (col1_0), FAMILY (col1_5), FAMILY (col1_7, col1_4, col1_8), FAMILY (col1_6), FAMILY (col1_2), FAMILY (col1_11, col1_1), FAMILY (col1_9, col1_3));
CREATE TABLE table2 (col2_0 BIT(4), col2_1 CHAR, col2_2 JSONB NOT NULL, col2_3 GEOMETRY, col2_4 TIME NOT NULL, col2_5 STRING[] NULL, col2_6 BYTES NULL, col2_7 JSONB NOT NULL, col2_8 REGTYPE NOT NULL, col2_9 BOOL NOT NULL, col2_10 STRING NULL AS (CASE WHEN col2_5 IS NULL THEN e'\r ^\x1dx':::STRING ELSE e'\n':::STRING END) VIRTUAL, col2_11 STRING NOT NULL AS (lower(CAST(col2_4 AS STRING))) STORED, col2_12 STRING NOT NULL AS (lower(CAST(col2_9 AS STRING))) STORED, col2_13 STRING AS (lower(col2_1)) VIRTUAL, col2_14 STRING NOT NULL AS (lower(CAST(col2_2 AS STRING))) STORED, col2_15 STRING NOT NULL AS (lower(CAST(col2_4 AS STRING))) VIRTUAL, col2_16 STRING AS (lower(CAST(col2_3 AS STRING))) STORED, INDEX (col2_14) STORING (col2_0, col2_3, col2_4, col2_5, col2_7, col2_8, col2_11, col2_16) WHERE (((((((((table2.col2_9 AND (table2.col2_4 != '24:00:00':::TIME)) OR (table2.col2_1 >= e'\'':::STRING)) AND (table2.col2_13 < 'X':::STRING)) AND (table2.col2_15 = 'X':::STRING)) AND (table2.col2_14 >= 'X':::STRING)) OR (table2.col2_6 < '\x27':::BYTES)) OR (table2.col2_10 < e'\x00':::STRING)) OR (table2.col2_12 != e'\x00':::STRING)) OR (table2.col2_11 < '':::STRING)) OR (table2.col2_16 != e'\'':::STRING), INVERTED INDEX (col2_9 ASC, col2_5 DESC) WHERE ((((((((((table2.col2_6 != '\x':::BYTES) AND (table2.col2_15 = e'\x00':::STRING)) AND (table2.col2_13 < e'\U00002603':::STRING)) AND (NOT table2.col2_9)) OR (table2.col2_1 = e'\'':::STRING)) OR (table2.col2_12 = 'X':::STRING)) OR (table2.col2_14 >= e'\x00':::STRING)) AND (table2.col2_4 <= '00:00:00':::TIME)) OR (table2.col2_11 <= '':::STRING)) OR (table2.col2_10 > e'\x00':::STRING)) AND (table2.col2_16 >= '':::STRING), FAMILY (col2_1, col2_4, col2_12), FAMILY (col2_9), FAMILY (col2_8), FAMILY (col2_7), FAMILY (col2_2, col2_0, col2_11), FAMILY (col2_14, col2_16), FAMILY (col2_6), FAMILY (col2_5, col2_3), UNIQUE (col2_8));
CREATE TABLE table3 (col3_0 STRING NOT NULL, col3_1 REGTYPE NOT NULL, col3_2 UUID NOT NULL, col3_3 INT4 NOT NULL, col3_4 REGPROCEDURE NOT NULL, col3_5 CHAR NOT NULL, col3_6 REGPROC NOT NULL, col3_7 TIMESTAMPTZ, PRIMARY KEY (col3_4 ASC, col3_6 DESC, col3_0 DESC), col3_8 STRING NOT NULL AS (lower(CAST(col3_2 AS STRING))) VIRTUAL, col3_9 INT4 NOT NULL AS (col3_3 + (-1350017167):::INT8) STORED, UNIQUE (col3_0 ASC, col3_9 DESC, col3_8 ASC, col3_1, col3_2, col3_6, col3_4, col3_3, col3_5 DESC, col3_7 ASC) WHERE ((((table3.col3_3 >= (-1):::INT8) OR (table3.col3_7 >= '-4713-11-24 00:00:00+00:00':::TIMESTAMPTZ)) OR (table3.col3_0 != e'\'':::STRING)) AND (table3.col3_9 = 0:::INT8)) AND (table3.col3_8 > e'\x00':::STRING), INDEX (col3_3) STORING (col3_1, col3_5, col3_7) WHERE (((((table3.col3_5 != '"':::STRING) AND (table3.col3_8 > '"':::STRING)) OR (table3.col3_3 != (-2147483648):::INT8)) AND (table3.col3_0 != e'\U00002603':::STRING)) OR (table3.col3_7 < '0001-01-01 00:00:00+00:00':::TIMESTAMPTZ)) OR (table3.col3_9 != 1:::INT8), UNIQUE (col3_1 DESC, col3_6 DESC, col3_8, col3_3 DESC, col3_0 ASC, col3_9 ASC) STORING (col3_2, col3_7) WHERE table3.col3_7 >= '294276-12-31 23:59:59.999999+00:00':::TIMESTAMPTZ, UNIQUE (col3_4 DESC, col3_9) WHERE (((((table3.col3_7 != '3000-01-01 00:00:00+00:00':::TIMESTAMPTZ) AND (table3.col3_9 <= (-32768):::INT8)) OR (table3.col3_8 != 'X':::STRING)) AND (table3.col3_5 <= e'\'':::STRING)) AND (table3.col3_3 = 127:::INT8)) OR (table3.col3_0 = '':::STRING), UNIQUE (col3_9 ASC, col3_3, col3_2 ASC, col3_7, col3_5 ASC, col3_8, col3_0 DESC, col3_4 ASC, col3_6, col3_1), INDEX (col3_4, col3_5, col3_6 DESC) STORING (col3_1, col3_2, col3_3, col3_7));
CREATE TABLE table4 (col4_0 INT4 NULL, col4_1 BYTES NOT NULL, col4_2 TIMESTAMP[] NULL, col4_3 INT8, col4_4 FLOAT8 NULL, col4_5 REGTYPE NULL, col4_6 FLOAT8 NULL AS (col4_4 + (-0.37241799896380146):::FLOAT8) VIRTUAL, col4_7 STRING NULL AS (lower(CAST(col4_5 AS STRING))) VIRTUAL, UNIQUE (col4_5));
CREATE TABLE table5 (col1_8 VARCHAR NOT NULL, col1_9 REGCLASS NOT NULL, col1_0 REGNAMESPACE NOT NULL, col1_2 BOOL NOT NULL, col5_4 INET NOT NULL, col5_5 BOX2D, col5_6 BOOL NULL, col5_7 BOOL, col5_8 INET NOT NULL, col5_9 CHAR NULL, col5_10 BOOL NOT NULL, col5_11 DATE, col5_12 DATE NULL, col5_13 REGTYPE NOT NULL, col5_14 DECIMAL NOT NULL, col5_15 BYTES, col5_16 BIT(43) NOT NULL, PRIMARY KEY (col1_8, col1_9, col1_0 DESC, col1_2 ASC, col5_5 ASC, col5_12 ASC, col5_4 ASC, col5_16 ASC, col5_6), UNIQUE (col5_5 DESC) STORING (col5_8, col5_10, col5_13, col5_14) WHERE ((((((((table5.col5_15 <= '\x58':::BYTES) AND table5.col5_7) OR table5.col5_6) AND (table5.col5_14 >= (-1.234E+401):::DECIMAL)) OR (NOT table5.col5_10)) AND (table5.col5_12 = '5874897-12-31':::DATE)) AND table5.col1_2) AND (table5.col5_9 != e'\U00002603':::STRING)) OR (table5.col5_11 = '5874897-12-31':::DATE), UNIQUE (col1_9, col1_2)) INTERLEAVE IN PARENT table1 (col1_8, col1_9, col1_0, col1_2);
ALTER TABLE table1 INJECT STATISTICS e'[{"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 140440, "histo_col_type": "", "name": "__auto__", "null_count": 744909, "row_count": 1000000}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 498541, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000000}, {"columns": ["col1_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 281175, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000000}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 382408, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000000}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 318989, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000000}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 969151, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000000}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 23916, "histo_col_type": "", "name": "__auto__", "null_count": 76693, "row_count": 1000000}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 867170, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000000}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 898832, "histo_buckets": [{"distinct_range": 0, "num_eq": 4099089415118945438, "num_range": 0, "upper_bound": "$\\u001fE\\u00076"}, {"distinct_range": 0, "num_eq": 221891473432813902, "num_range": 5895879785810058211, "upper_bound": "Co"}, {"distinct_range": 0, "num_eq": 7000000000, "num_range": 0, "upper_bound": "M\\u0016qF"}], "histo_col_type": "VARCHAR", "name": "__auto__", "null_count": 0, "row_count": 1000000}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 404094, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000000}, {"columns": ["col1_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 170954, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000000}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 238529, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000000}]':::JSONB;
ALTER TABLE table2 INJECT STATISTICS e'[{"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3018, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4000}, {"columns": ["col2_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 407, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4000}, {"columns": ["col2_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1585, "histo_col_type": "", "name": "__auto__", "null_count": 714, "row_count": 4000}, {"columns": ["col2_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2859, "histo_buckets": [{"distinct_range": 0, "num_eq": 7970780139189881688, "num_range": 0, "upper_bound": "i/W$uR\\u0015uq"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 0, "row_count": 4000}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 818, "histo_col_type": "", "name": "__auto__", "null_count": 2487, "row_count": 4000}, {"columns": ["col2_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1839, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4000}, {"columns": ["col2_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1270, "histo_col_type": "", "name": "__auto__", "null_count": 1349, "row_count": 4000}, {"columns": ["col2_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 598, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4000}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 401, "histo_col_type": "", "name": "__auto__", "null_count": 850, "row_count": 4000}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3663, "histo_col_type": "", "name": "__auto__", "null_count": 1443, "row_count": 4000}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1889, "histo_col_type": "", "name": "__auto__", "null_count": 3358, "row_count": 4000}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 501, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4000}, {"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 433, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4000}, {"columns": ["col2_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3638, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4000}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3413, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4000}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 719, "histo_col_type": "", "name": "__auto__", "null_count": 353, "row_count": 4000}, {"columns": ["col2_16"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 584, "histo_col_type": "", "name": "__auto__", "null_count": 2723, "row_count": 4000}]':::JSONB;
ALTER TABLE table3 INJECT STATISTICS e'[{"columns": ["col3_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 13, "histo_col_type": "", "name": "__auto__", "null_count": 10, "row_count": 40}, {"columns": ["col3_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 8, "histo_buckets": [{"distinct_range": 0, "num_eq": 0, "num_range": 0, "upper_bound": "560087711"}, {"distinct_range": 3412424183924977700, "num_eq": 806325261699864377, "num_range": 6636337114260128585, "upper_bound": "867033246"}, {"distinct_range": 1246760712280190000, "num_eq": 600000000, "num_range": 1246760712280189842, "upper_bound": "1733761153"}, {"distinct_range": 90000, "num_eq": 0, "num_range": 90000, "upper_bound": "1751769509"}], "histo_col_type": "INT4", "name": "__auto__", "null_count": 0, "row_count": 40}, {"columns": ["col3_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 38, "histo_buckets": [{"distinct_range": 0, "num_eq": 900000, "num_range": 0, "upper_bound": ""}, {"distinct_range": 0, "num_eq": 6000, "num_range": 700000, "upper_bound": "\\u0000"}, {"distinct_range": 800000, "num_eq": 694733873900709230, "num_range": 800000, "upper_bound": "KR*-\\u001c\\u0012"}, {"distinct_range": 0, "num_eq": 10000000000, "num_range": 8000000000, "upper_bound": "N y3+\x7f"}, {"distinct_range": 0, "num_eq": 800000000, "num_range": 1289651271533576946, "upper_bound": "W"}, {"distinct_range": 100000000000, "num_eq": 7130406094143013258, "num_range": 100000000000, "upper_bound": "d\\n\\u0008\\u001cz"}, {"distinct_range": 0, "num_eq": 0, "num_range": 3140600772460140348, "upper_bound": "j$?/M"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 0, "row_count": 40}, {"columns": ["col3_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 23, "histo_col_type": "REGTYPE", "name": "__auto__", "null_count": 0, "row_count": 40}, {"columns": ["col3_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 28, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 40}, {"columns": ["col3_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 24, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 40}, {"columns": ["col3_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 25, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 40}, {"columns": ["col3_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 39, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 40}, {"columns": ["col3_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 13, "histo_buckets": [{"distinct_range": 0, "num_eq": 7380397752798900401, "num_range": 0, "upper_bound": "-1594842644"}, {"distinct_range": 170723014.02896243, "num_eq": 9000, "num_range": 600000000, "upper_bound": "-1268452495"}, {"distinct_range": 10000, "num_eq": 6920765684279200764, "num_range": 10000, "upper_bound": "-803765603"}, {"distinct_range": 0, "num_eq": 8243738182375008301, "num_range": 6000, "upper_bound": "-367448946"}, {"distinct_range": 8541059903592140000, "num_eq": 800000000, "num_range": 8557337858698362820, "upper_bound": "-1"}, {"distinct_range": 1559839.2001829352, "num_eq": 100000, "num_range": 20000000, "upper_bound": "21529738"}, {"distinct_range": 0, "num_eq": 100, "num_range": 800, "upper_bound": "769243354"}, {"distinct_range": 3.2932822974816456, "num_eq": 5000000, "num_range": 10, "upper_bound": "1318983033"}, {"distinct_range": 0, "num_eq": 5938640466777329407, "num_range": 200000000, "upper_bound": "1958855838"}], "histo_col_type": "INT4", "name": "__auto__", "null_count": 0, "row_count": 40}, {"columns": ["col3_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7, "histo_buckets": [{"distinct_range": 0, "num_eq": 80000, "num_range": 0, "upper_bound": "0"}, {"distinct_range": 70330940.64035305, "num_eq": 0, "num_range": 80000000, "upper_bound": "210836216"}, {"distinct_range": 4534352573461333000, "num_eq": 70, "num_range": 5420973432301592439, "upper_bound": "524624669"}, {"distinct_range": 145.68486640755938, "num_eq": 8000, "num_range": 600, "upper_bound": "1827261627"}, {"distinct_range": 0, "num_eq": 4576506133908589258, "num_range": 3722338008094821895, "upper_bound": "3555643448"}, {"distinct_range": 713898088.9401333, "num_eq": 800000, "num_range": 800000000, "upper_bound": "3891156952"}, {"distinct_range": 0, "num_eq": 400000, "num_range": 50, "upper_bound": "4222983533"}], "histo_col_type": "REGPROCEDURE", "name": "__auto__", "null_count": 0, "row_count": 40}]':::JSONB;
ALTER TABLE table4 INJECT STATISTICS '[{"columns": ["col4_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 143533694397932608, "histo_col_type": "", "name": "__auto__", "null_count": 192545153032849220, "row_count": 205670454377153759}, {"columns": ["col4_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 188625702068461903, "histo_col_type": "", "name": "__auto__", "null_count": 135492481522328562, "row_count": 205670454377153759}, {"columns": ["col4_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 89172322127768483, "histo_col_type": "", "name": "__auto__", "null_count": 128199691352588250, "row_count": 205670454377153759}, {"columns": ["col4_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 67479883099721330, "histo_col_type": "", "name": "__auto__", "null_count": 82035581461793907, "row_count": 205670454377153759}, {"columns": ["col4_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 64161219252245127, "histo_col_type": "", "name": "__auto__", "null_count": 91174388249746304, "row_count": 205670454377153759}, {"columns": ["col4_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 14157002351547752, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 205670454377153759}, {"columns": ["col4_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 49125568081446025, "histo_col_type": "", "name": "__auto__", "null_count": 146717427330894171, "row_count": 205670454377153759}, {"columns": ["col4_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 145236225990398823, "histo_col_type": "", "name": "__auto__", "null_count": 32720831955924609, "row_count": 205670454377153759}]':::JSONB;
ALTER TABLE table5 INJECT STATISTICS '[{"columns": ["col5_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3619849404750931893, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4087231202501780528}, {"columns": ["col5_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2363244566412087692, "histo_col_type": "", "name": "__auto__", "null_count": 475616820078969944, "row_count": 4087231202501780528}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 476519577114224227, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4087231202501780528}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 734515572407197332, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4087231202501780528}, {"columns": ["col5_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3153290311275862949, "histo_buckets": [{"distinct_range": 0, "num_eq": 845683316289295498, "num_range": 0, "upper_bound": "BOX(-0.2574664918648955 -0.9086308024601819,0.3087639084216409 0.7994135350911638)"}, {"distinct_range": 7251419591670147000, "num_eq": 4036953378134787998, "num_range": 7251419591670147173, "upper_bound": "BOX(0.24549809597169786 -3.071725607741571,0.36498127527756663 -0.876214473410668)"}], "histo_col_type": "BOX2D", "name": "__auto__", "null_count": 952201459636876516, "row_count": 4087231202501780528}, {"columns": ["col5_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 890669438701419945, "histo_col_type": "", "name": "__auto__", "null_count": 1745936829193998629, "row_count": 4087231202501780528}, {"columns": ["col5_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2881260872695003854, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4087231202501780528}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1786827075173736829, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4087231202501780528}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 184228494053689219, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4087231202501780528}, {"columns": ["col5_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1487477370147114809, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4087231202501780528}, {"columns": ["col5_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2388053758168068230, "histo_col_type": "", "name": "__auto__", "null_count": 159545792390923531, "row_count": 4087231202501780528}, {"columns": ["col5_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3957588607943514669, "histo_col_type": "", "name": "__auto__", "null_count": 3481351463878013139, "row_count": 4087231202501780528}, {"columns": ["col5_16"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3050620978047485675, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4087231202501780528}, {"columns": ["col5_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3227389842068342428, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4087231202501780528}, {"columns": ["col5_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3013151551661899719, "histo_col_type": "", "name": "__auto__", "null_count": 3153008809615962916, "row_count": 4087231202501780528}, {"columns": ["col5_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2353066382370696517, "histo_col_type": "", "name": "__auto__", "null_count": 438583773077670034, "row_count": 4087231202501780528}, {"columns": ["col5_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2893762886608466476, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4087231202501780528}]':::JSONB;
ALTER TABLE table3 ADD FOREIGN KEY (col3_1) REFERENCES table4 (col4_5);
ALTER TABLE table2 ADD FOREIGN KEY (col2_8, col2_9) REFERENCES table5 (col1_9, col1_2);
ALTER TABLE table1 ADD FOREIGN KEY (col1_3) REFERENCES table2 (col2_8);
CREATE TYPE rand_typ_0 AS ENUM ('pzgya', 'fj', 'k', 'x', 'osy');
CREATE TYPE rand_typ_1 AS ENUM ('hp', 'vlxxm', 'qfgyd', 'rh');
;
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
SELECT
g::INT2 AS _int2,
g::INT4 AS _int4,
g::INT8 AS _int8,
g::FLOAT4 AS _float4,
g::FLOAT8 AS _float8,
'2001-01-01'::DATE + g AS _date,
'2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
'2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
g * '1 day'::INTERVAL AS _interval,
g % 2 = 1 AS _bool,
g::DECIMAL AS _decimal,
g::STRING AS _string,
g::STRING::BYTES AS _bytes,
substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
'0.0.0.0'::INET + g AS _inet,
g::STRING::JSONB AS _jsonb,
enum_range('hello'::greeting)[g] as _enum
FROM
generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);
;
rsg_test.go:584:
rsg_test.go:585: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith999020915
--- FAIL: TestRandomSyntaxSQLSmith (301.22s)
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-experience rafiss
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ 9baaa282b3a09977b96bd3e5ae6e2346adfa2c16:
Random syntax error:
rsg_test.go:763: Crash detected: server panic: statement exec timeout
Query:
WITH
with_121707 (col_692430)
AS (
SELECT
*
FROM
(
VALUES
((-0.19099748134613037):::FLOAT8),
(0.9743397235870361:::FLOAT8),
((-1.6944892406463623):::FLOAT8)
)
AS tab_297691 (col_692430)
)
SELECT
'-35 years -11 mons -571 days -08:18:57.001029':::INTERVAL AS col_692441
FROM
defaultdb.public.table1@table1_col1_8_col1_11_col1_3_col1_7_col1_6_col1_4_col1_1_key AS tab_297692
JOIN defaultdb.public.table2@table2_col2_0_col2_1_col2_2_key AS tab_297693
JOIN defaultdb.public.table1@[0] AS tab_297694
JOIN defaultdb.public.seed@seed__int8__float8__date_idx AS tab_297695
RIGHT JOIN defaultdb.public.table2@[0] AS tab_297696
JOIN defaultdb.public.table3@table3_col3_10_col3_3_col2_1_col3_9_key AS tab_297697 ON
(tab_297696.col2_0) = (tab_297697.col3_3)
CROSS JOIN defaultdb.public.table3@[0] AS tab_297698
JOIN defaultdb.public.table2@table2_col2_2_col2_0_key AS tab_297699 ON
(tab_297698.col2_0) = (tab_297699.col2_0) ON true
JOIN defaultdb.public.table3@[0] AS tab_297700 ON (tab_297697.col3_12) = (tab_297700.col3_8) ON
(tab_297694.tableoid) = (tab_297695.tableoid)
AND (tab_297694.col1_5) = (tab_297698.col3_8)
AND (tab_297694.tableoid) = (tab_297698.col3_2)
AND (tab_297694.col1_5) = (tab_297697.col3_12) ON
(tab_297693.col2_2) = (tab_297700.col3_3)
AND (tab_297693.col2_1) = (tab_297698.col2_1)
AND (tab_297693.tableoid) = (tab_297699.tableoid)
AND (tab_297693.col2_1) = (tab_297697.col2_1)
AND (tab_297693.tableoid) = (tab_297694.col1_1)
AND (tab_297693.col2_2) = (tab_297695._string)
AND (tab_297693.col2_2) = (tab_297696.col2_0)
AND (tab_297693.col2_2) = (tab_297698.col3_3) ON (tab_297692.col1_11) = (tab_297694.col1_11)
ORDER BY
tab_297695._enum DESC
LIMIT
57:::INT8;
Schema:
rsg_test.go:580: To reproduce, use schema:
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
CREATE TABLE table1 (col1_0 "char" NOT NULL, col1_1 OID NOT NULL, col1_2 BIT(38) NOT NULL, col1_3 BIT(18) NOT NULL, col1_4 BYTES NOT NULL, col1_5 INT8 NOT NULL, col1_6 INTERVAL NOT NULL, col1_7 BIT(33) NOT NULL, col1_8 INTERVAL NULL, col1_9 GEOMETRY NOT NULL, col1_10 BOOL NOT NULL, col1_11 INT2, PRIMARY KEY (col1_4 ASC, col1_7 DESC, col1_1 ASC, col1_2 ASC, col1_10 ASC, col1_5, col1_0 ASC, col1_3, col1_6), UNIQUE (col1_8 DESC, col1_11, col1_3 DESC, col1_7, col1_6 DESC, col1_4 ASC, col1_1 DESC));
CREATE TABLE table2 (col2_0 NAME NOT NULL, col2_1 TIMETZ NOT NULL, PRIMARY KEY (col2_0 ASC, col2_1), col2_2 STRING NOT NULL AS (lower(col2_0)) VIRTUAL, UNIQUE (col2_0 DESC, col2_2 DESC, col2_1) WHERE (table2.col2_2 > e'\U00002603':::STRING) OR (table2.col2_0 != '"':::STRING), UNIQUE (col2_1 ASC, col2_2, col2_0), UNIQUE (col2_0 DESC, col2_1, col2_2), INDEX (col2_1 DESC), UNIQUE (col2_2 DESC, col2_0 ASC) WHERE table2.col2_2 = '"':::STRING);
CREATE TABLE table3 (col2_0 NAME NOT NULL, col2_1 TIMETZ NOT NULL, col3_2 REGPROC NOT NULL, col3_3 "char", col3_4 BOX2D, col3_5 INT8 NULL, col3_6 TIMESTAMP NOT NULL, col3_7 FLOAT8, col3_8 INT4 NULL, col3_9 INET NULL, col3_10 UUID NOT NULL, col3_11 UUID NULL, col3_12 INT2 NOT NULL, col3_13 BIT(34), col3_14 REGPROCEDURE NULL, col3_15 FLOAT8 NULL, PRIMARY KEY (col2_0 ASC, col2_1, col3_11 DESC, col3_13, col3_6, col3_3 DESC, col3_15 ASC, col3_2 ASC, col3_4 ASC, col3_9 DESC, col3_12 ASC, col3_8 ASC, col3_5, col3_14 ASC), UNIQUE (col3_2, col3_8 ASC) WHERE ((((table3.col3_5 < 0:::INT8) AND (table3.col3_3 != '':::STRING)) AND (table3.col2_1 < '00:00:00+15:59:00':::TIMETZ)) AND (table3.col3_12 > 0:::INT8)) AND (table3.col3_15 <= 1.7976931348623157e+308:::FLOAT8), UNIQUE (col3_10 DESC, col3_3 ASC, col2_1 DESC, col3_9 ASC)) INTERLEAVE IN PARENT table2 (col2_0, col2_1);
ALTER TABLE table1 INJECT STATISTICS e'[{"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 555518688, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 800000000}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 68437669, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 800000000}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 661816419, "histo_buckets": [{"distinct_range": 0, "num_eq": 30000000, "num_range": 0, "upper_bound": "-2 years -7 mons -962 days -15:47:44.487953"}, {"distinct_range": 50000000000, "num_eq": 0, "num_range": 50000000000, "upper_bound": "44 years 4 mons 743 days 24:05:44.943335"}, {"distinct_range": 16576643756.184994, "num_eq": 2278857000687019333, "num_range": 20000000000, "upper_bound": "55 years 10 mons 259 days 07:00:02.89863"}], "histo_col_type": "INTERVAL", "name": "__auto__", "null_count": 262467076, "row_count": 800000000}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 189733233, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 800000000}, {"columns": ["col1_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 413701802, "histo_col_type": "", "name": "__auto__", "null_count": 535760019, "row_count": 800000000}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 138064148, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 800000000}, {"columns": ["col1_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 719158158, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 800000000}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 328908328, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 800000000}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 282032246, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 800000000}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 656224253, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 800000000}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 248818850, "histo_buckets": [{"distinct_range": 0, "num_eq": 1000, "num_range": 0, "upper_bound": "\\\\x1377"}], "histo_col_type": "BYTES", "name": "__auto__", "null_count": 0, "row_count": 800000000}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 370004488, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 800000000}]':::JSONB;
ALTER TABLE table2 INJECT STATISTICS e'[{"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 40381464433533574, "histo_buckets": [{"distinct_range": 0, "num_eq": 90000000000, "num_range": 0, "upper_bound": "00:00:00+15:59:00"}, {"distinct_range": 625150599914996600, "num_eq": 0, "num_range": 1071621907561525249, "upper_bound": "02:13:28.989028+12:14:00"}, {"distinct_range": 4000000, "num_eq": 6895828156118146024, "num_range": 4000000, "upper_bound": "09:07:55.058902+09:24:00"}], "histo_col_type": "TIMETZ", "name": "__auto__", "null_count": 0, "row_count": 148419118336749247}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 53663942080801567, "histo_buckets": [{"distinct_range": 0, "num_eq": 7506411851905703863, "num_range": 0, "upper_bound": "\\u0000"}, {"distinct_range": 1432652.9115002765, "num_eq": 60000000000, "num_range": 10000000, "upper_bound": "&~|\\u0003N^\\u0011\\u001d>"}, {"distinct_range": 600000000, "num_eq": 1706455548763229340, "num_range": 600000000, "upper_bound": ".\\u0012\\u000cO!_\\u0017"}, {"distinct_range": 0, "num_eq": 70, "num_range": 300, "upper_bound": "^e.m]"}, {"distinct_range": 0, "num_eq": 2271897774497726388, "num_range": 3005075386032777408, "upper_bound": "\U00002603"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 0, "row_count": 148419118336749247}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 113408437834052826, "histo_col_type": "NAME", "name": "__auto__", "null_count": 0, "row_count": 148419118336749247}]':::JSONB;
ALTER TABLE table3 INJECT STATISTICS '[{"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4724371, "histo_buckets": [{"distinct_range": 0, "num_eq": 2350393201740362798, "num_range": 0, "upper_bound": "4L"}, {"distinct_range": 0, "num_eq": 80000000, "num_range": 70000000000, "upper_bound": "l"}], "histo_col_type": "NAME", "name": "__auto__", "null_count": 0, "row_count": 6000000}, {"columns": ["col3_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2786543, "histo_col_type": "", "name": "__auto__", "null_count": 4900074, "row_count": 6000000}, {"columns": ["col3_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2379230, "histo_col_type": "", "name": "__auto__", "null_count": 98624, "row_count": 6000000}, {"columns": ["col3_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1561750, "histo_col_type": "", "name": "__auto__", "null_count": 602919, "row_count": 6000000}, {"columns": ["col3_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4868167, "histo_col_type": "", "name": "__auto__", "null_count": 5740757, "row_count": 6000000}, {"columns": ["col3_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5372593, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6000000}, {"columns": ["col3_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5683845, "histo_col_type": "", "name": "__auto__", "null_count": 2166675, "row_count": 6000000}, {"columns": ["col3_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 995371, "histo_col_type": "", "name": "__auto__", "null_count": 1568746, "row_count": 6000000}, {"columns": ["col3_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4777566, "histo_col_type": "", "name": "__auto__", "null_count": 1250274, "row_count": 6000000}, {"columns": ["col3_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4719688, "histo_col_type": "", "name": "__auto__", "null_count": 1116985, "row_count": 6000000}, {"columns": ["col3_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5752166, "histo_col_type": "", "name": "__auto__", "null_count": 1332632, "row_count": 6000000}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2922416, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6000000}, {"columns": ["col3_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3953931, "histo_col_type": "", "name": "__auto__", "null_count": 3443735, "row_count": 6000000}, {"columns": ["col3_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 535491, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6000000}, {"columns": ["col3_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1742180, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6000000}, {"columns": ["col3_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 764487, "histo_buckets": [{"distinct_range": 0, "num_eq": 90000000000, "num_range": 0, "upper_bound": "a0a1387c-dd92-48b2-b98b-65deb8187ce0"}], "histo_col_type": "UUID", "name": "__auto__", "null_count": 0, "row_count": 6000000}]':::JSONB;
CREATE TYPE rand_typ_0 AS ENUM ('ljvgwo', 'qizc', 'xy');
CREATE TYPE rand_typ_1 AS ENUM ('fx', 'phvpvg', 'mz', 'ua', 'ft');
CREATE TYPE rand_typ_2 AS ENUM ('u');
CREATE TYPE rand_typ_3 AS ENUM ('u');
CREATE TYPE rand_typ_4 AS ENUM ('bkjhk', 'fxgwm', 'twa');
;
rsg_test.go:582:
SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
SET enable_drop_enum_value = true;
CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
SELECT
g::INT2 AS _int2,
g::INT4 AS _int4,
g::INT8 AS _int8,
g::FLOAT4 AS _float4,
g::FLOAT8 AS _float8,
'2001-01-01'::DATE + g AS _date,
'2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
'2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
g * '1 day'::INTERVAL AS _interval,
g % 2 = 1 AS _bool,
g::DECIMAL AS _decimal,
g::STRING AS _string,
g::STRING::BYTES AS _bytes,
substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
'0.0.0.0'::INET + g AS _inet,
g::STRING::JSONB AS _jsonb,
enum_range('hello'::greeting)[g] as _enum
FROM
generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);
;
rsg_test.go:584:
rsg_test.go:585: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith312113763
--- FAIL: TestRandomSyntaxSQLSmith (300.90s)
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-experience rafiss
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ 6b8d59327add74cf1342345fb3eaffc3a3e765d2:
crypto/tls.(*atLeastReader).Read(0xc01e3d9cc8, 0xc021d9a000, 0x773, 0x773, 0x76e, 0xc010d52000, 0x0)
/usr/local/go/src/crypto/tls/conn.go:776 +0x63
bytes.(*Buffer).ReadFrom(0xc035232278, 0x66ed560, 0xc01e3d9cc8, 0x450545, 0x4a2cfa0, 0x4e57880)
/usr/local/go/src/bytes/buffer.go:204 +0xbe
crypto/tls.(*Conn).readFromUntil(0xc035232000, 0x7f4507a3c008, 0xc0337ea080, 0x5, 0xc0337ea080, 0x11)
/usr/local/go/src/crypto/tls/conn.go:798 +0xf3
crypto/tls.(*Conn).readRecordOrCCS(0xc035232000, 0x0, 0x0, 0xaebe5e)
/usr/local/go/src/crypto/tls/conn.go:605 +0x115
crypto/tls.(*Conn).readRecord(...)
/usr/local/go/src/crypto/tls/conn.go:573
crypto/tls.(*Conn).Read(0xc035232000, 0xc00189a000, 0x8000, 0x8000, 0x0, 0x0, 0x0)
/usr/local/go/src/crypto/tls/conn.go:1276 +0x165
bufio.(*Reader).Read(0xc014f96300, 0xc015492498, 0x9, 0x9, 0x14, 0x7f452ffc1878, 0x18)
/usr/local/go/src/bufio/bufio.go:227 +0x222
io.ReadAtLeast(0x66ed320, 0xc014f96300, 0xc015492498, 0x9, 0x9, 0x9, 0xacf2e5, 0xc003929ac4, 0xc010bd9a78)
/usr/local/go/src/io/io.go:328 +0x87
io.ReadFull(...)
/usr/local/go/src/io/io.go:347
golang.org/x/net/http2.readFrameHeader(0xc015492498, 0x9, 0x9, 0x66ed320, 0xc014f96300, 0x0, 0x0, 0xc003929ab8, 0x0)
/go/src/github.com/cockroachdb/cockroach/vendor/golang.org/x/net/http2/frame.go:237 +0x89
golang.org/x/net/http2.(*Framer).ReadFrame(0xc015492460, 0xc003929ab8, 0x8e9f200, 0x0, 0x0)
/go/src/github.com/cockroachdb/cockroach/vendor/golang.org/x/net/http2/frame.go:492 +0xa5
google.golang.org/grpc/internal/transport.(*http2Server).HandleStreams(0xc0017cc600, 0xc01c6db6b0, 0x57fa6d0)
/go/src/github.com/cockroachdb/cockroach/vendor/google.golang.org/grpc/internal/transport/http2_server.go:473 +0x9b
google.golang.org/grpc.(*Server).serveStreams(0xc021d0e1c0, 0x67f39f8, 0xc0017cc600)
/go/src/github.com/cockroachdb/cockroach/vendor/google.golang.org/grpc/server.go:918 +0x103
google.golang.org/grpc.(*Server).handleRawConn.func1(0xc021d0e1c0, 0x67f39f8, 0xc0017cc600, 0x512c1e6, 0x8)
/go/src/github.com/cockroachdb/cockroach/vendor/google.golang.org/grpc/server.go:868 +0x3f
created by google.golang.org/grpc.(*Server).handleRawConn
/go/src/github.com/cockroachdb/cockroach/vendor/google.golang.org/grpc/server.go:867 +0x555
goroutine 7180465 [select]:
github.com/cockroachdb/cockroach/pkg/server.(*Server).refreshSettings.func1(0x678a490, 0xc0023cacc0)
/go/src/github.com/cockroachdb/cockroach/pkg/server/settingsworker.go:78 +0xc5
github.com/cockroachdb/cockroach/pkg/util/stop.(*Stopper).RunAsyncTaskEx.func2(0xc032788280, 0x678a490, 0xc0023cacc0, 0x0, 0x0, 0xc009ee5760)
/go/src/github.com/cockroachdb/cockroach/pkg/util/stop/stopper.go:442 +0xf3
created by github.com/cockroachdb/cockroach/pkg/util/stop.(*Stopper).RunAsyncTaskEx
/go/src/github.com/cockroachdb/cockroach/pkg/util/stop/stopper.go:434 +0x22b
goroutine 7180529 [sync.Cond.Wait]:
sync.runtime_notifyListWait(0xc004b46110, 0xc00000051b)
/usr/local/go/src/runtime/sema.go:513 +0xf8
sync.(*Cond).Wait(0xc004b46100)
/usr/local/go/src/sync/cond.go:56 +0x99
github.com/cockroachdb/cockroach/pkg/kv/kvserver.(*raftScheduler).worker(0xc016646140, 0x678a490, 0xc018516d50)
/go/src/github.com/cockroachdb/cockroach/pkg/kv/kvserver/scheduler.go:251 +0x8b
github.com/cockroachdb/cockroach/pkg/util/stop.(*Stopper).RunAsyncTaskEx.func2(0xc032788280, 0x678a490, 0xc018516d50, 0x0, 0x0, 0xc011e9a230)
/go/src/github.com/cockroachdb/cockroach/pkg/util/stop/stopper.go:442 +0xf3
created by github.com/cockroachdb/cockroach/pkg/util/stop.(*Stopper).RunAsyncTaskEx
/go/src/github.com/cockroachdb/cockroach/pkg/util/stop/stopper.go:434 +0x22b
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-experience rafiss
sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ dee0558010170d938ead781d82514fd0bb3b0b88:
Random syntax error:
Query:
Schema:
Reproduce
To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```
Same failure on other branches
- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
Internal log
``` mjibson marked as alumn{us/a}; resolving to rafiss instead ```
/cc @cockroachdb/sql-queries @rafiss
This test on roachdash | Improve this report!
Jira issue: CRDB-7250