cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
29.87k stars 3.77k forks source link

sql/tests: TestRandomSyntaxSQLSmith failed [lookup join with columns that are not required] #129386

Closed cockroach-teamcity closed 2 weeks ago

cockroach-teamcity commented 3 weeks ago

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-24.1 @ 317fee473f12c233df08ca2ed031023deb821c29:

Random syntax error:

    rsg_test.go:965: Crash detected: server panic: pq: internal error: lookup join with columns (9,29,33) that are not required; required: (9,33)

Query:

        SELECT
            'xJ8Qy b':::STRING AS col_366889, tab_160855.col1_8 AS col_366890
        FROM
            defaultdb.public.table̼_1 AS tab_160855
            JOIN defaultdb.public.table̼_1 AS tab_160856 ON (tab_160855.col1_8) = (tab_160856.col1_9)
        WHERE
            tab_160855.col1_8::STRING
            IN (
                    SELECT
                        "%p
taB_160857".col1_8::STRING AS col_366888
                    FROM
                        defaultdb.public.table̼_1@"table̼_1_col1_8_ćol1""_0_idx" AS "%p
taB_160857"
                    WHERE
                        "%p
taB_160857"."col 1_4"
                    ORDER BY
                        "%p
taB_160857".col1_8 ASC NULLS FIRST
                    LIMIT
                        84:::INT8
                )
        ORDER BY
            tab_160856.col1_9, tab_160855.col1_8 ASC NULLS FIRST
        LIMIT
            30:::INT8;

Schema:

    rsg_test.go:768: To reproduce, use schema:
    rsg_test.go:770: SET sql_safe_updates = false;;
    rsg_test.go:770: SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;;
    rsg_test.go:770: SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;;
    rsg_test.go:770: CREATE TABLE table̼_1 ("ćol1""_0" STRING COLLATE en_US NOT NULL, "c)�ol1_1" INTERVAL NOT NULL, col̂1_2 GEOGRAPHY NOT NULL, col1_3 PG_LSN NOT NULL, "col 1_4" BOOL NOT NULL, "😺col""1_5" INT2, col1_6 STRING COLLATE da_DK NOT NULL, col1_7 INT2 AS (abs("😺col""1_5")) STORED, col1_8 STRING NOT NULL AS (lower(CAST(col1_6 AS STRING))) STORED, col1_9 STRING AS (lower(CAST("col 1_4" AS STRING))) STORED, PRIMARY KEY ("col 1_4" ASC), UNIQUE (col1_9 DESC), UNIQUE ("col 1_4" DESC, col1_9 ASC, col1_3, col1_7 DESC, col1_6 DESC, "c)�ol1_1"), INDEX (col1_8 DESC, "ćol1""_0" ASC) STORING ("c)�ol1_1", "😺col""1_5", col1_7, col1_9) WHERE table̼_1."col 1_4", FAMILY ("😺col""1_5"), FAMILY (col1_8), FAMILY (col1_9, "col 1_4", "ćol1""_0", col1_3, col1_6), FAMILY ("c)�ol1_1"), FAMILY (col1_7, col̂1_2));
    rsg_test.go:770: CREATE TABLE table_2 ("c'ol2_0" INTERVAL NOT NULL, "c_o̚ l̖2_1" TIMETZ NOT NULL, "c    ol)2_2" NAME NOT NULL, cǒl2_3 INT4 NOT NULL, col2_4 FLOAT8 NOT NULL, col2_5 INT2, col2͜_6 REFCURSOR NOT NULL, col2_7 TSVECTOR, col2_8 INT4 NULL, col2_9 TSVECTOR NOT NULL, col2_10 STRING COLLATE de_DE NOT NULL, col2_11 INT2 NULL, "col%2_12" INT8 NOT NULL, col2_13 TSQUERY NOT NULL, col2_14 PG_LSN NOT NULL, c😷ol2͑_15 PG_LSN NOT NULL, "'col2_16" INT8 NULL AS (col2_11 + col2_5) VIRTUAL, col2_17 INT8 NOT NULL AS (cǒl2_3 + col2_5) STORED, PRIMARY KEY (col2_17, col2_10), UNIQUE (c😷ol2͑_15 ASC) STORING ("c'ol2_0", "c_o̚ l̖2_1", "c ol)2_2", cǒl2_3, col2_4, col2͜_6, col2_8, col2_9, col2_11, "col%2_12"), INDEX ("col%2_12" DESC) STORING ("c'ol2_0", cǒl2_3, col2_4, col2_7, col2_9, col2_13, col2_14) PARTITION BY LIST ("col%2_12") (PARTITION table_2_part_0 VALUES IN ((2909667306765500594:::INT8,), ((-4226156575742153433):::INT8,), (2792059082020185510:::INT8,), (127:::INT8,), ((-3313429784868685552):::INT8,), ((-5280162477999295132):::INT8,), ((-323747628515713487):::INT8,)), PARTITION "DEFAULT" VALUES IN ((DEFAULT,))), INDEX ("c   ol)2_2" ASC), FAMILY (col2_9, col2_10, col2_17, "c  ol)2_2", col2_5, col2_13, col2_8), FAMILY (cǒl2_3), FAMILY (col2_14, col2_7), FAMILY ("c_o̚ l̖2_1", c😷ol2͑_15, col2͜_6), FAMILY ("c'ol2_0"), FAMILY (col2_4, "col%2_12", col2_11));
    rsg_test.go:770: CREATE TABLE table_3 ("%pcol3_0" TSVECTOR NOT NULL, "co%ql3%85_1" REFCURSOR NULL, col3_2 BIT(21) NOT NULL, "col%q3_3" VARCHAR NULL, col3_4 CHAR, col3_5 INET NOT NULL, "c o\\x76l3_6" BOX2D NULL, "�col3_7" REGTYPE NULL, col3_8 BOOL[] NOT NULL, col3_9 INT4, col3_10 STRING NOT NULL, col3_11 DATE NULL, col3_12 STRING NULL AS (lower(CAST("c o\\x76l3_6" AS STRING))) STORED, col😫3_13 INT4 AS (abs(col3_9)) STORED, "Col3_14" STRING NULL AS (lower(CAST("c o\\x76l3_6" AS STRING))) STORED, "%pcol3_15" STRING NULL AS (CASE WHEN "�col3_7" IS NULL THEN e'\x1bUh$zEH':::STRING ELSE '"':::STRING END) STORED, "c\\xc1ol3_16" STRING NULL AS (lower(CAST("co%ql3%85_1" AS STRING))) STORED, c😅ol3_17 STRING NULL AS (lower(CAST("co%ql3%85_1" AS STRING))) VIRTUAL, PRIMARY KEY (col3_5), INDEX (lower(CAST("%pcol3_0" AS STRING))) STORING ("%pcol3_0", col3_2, col3_4, col3_9, col3_10, col3_11, col😫3_13), UNIQUE (col3_10 ASC, "�col3_7" ASC, col3_5) STORING (col3_2, col3_9, col3_11, "Col3_14", "%pcol3_15", "c\\xc1ol3_16"), INDEX (col3_9 DESC) STORING ("%pcol3_0", "co%ql3%85_1", col3_2, col3_4, "�col3_7", col3_12, col😫3_13, "%pcol3_15"), INDEX (col3_9, col3_5 DESC, (CASE WHEN col3_11 IS NULL THEN e'\x03\x1e\'\x7fHHGj':::STRING ELSE e'\nO``\t``\x12c':::STRING END)) STORING ("co%ql3%85_1", col3_2, "col%q3_3", "c o\\x76l3_6", "�col3_7", col3_10, "%pcol3_15", "c\\xc1ol3_16") NOT VISIBLE, UNIQUE (col3_9), INDEX ("c o\\x76l3_6" ASC, col3_11 DESC), UNIQUE (col3_8, col3_2 DESC, col3_10 ASC), INVERTED INDEX (c😅ol3_17 gin_trgm_ops), UNIQUE (col3_11));
    rsg_test.go:770: CREATE TABLE table_4 (col4_0 "char" NOT NULL, col4_1 TIMETZ, col4_2 CHAR NULL, col4_3 REGROLE NULL, "co l4-_4" NAME NOT NULL, "'co%pl4_5" BIT(24) NOT NULL, "col 4\\U00027190_6" DECIMAL NULL, "co\\uDA15l4_7" REFCURSOR NOT NULL, "col4\\x69_8" GEOMETRY NOT NULL, col4_9 FLOAT8 NOT NULL, "c�ol4_10" TIME NULL, PRIMARY KEY (col4_9 DESC), INDEX ("col 4\\U00027190_6" ASC, abs("col 4\\U00027190_6") DESC, col4_1 ASC) STORING (col4_3, "co\\uDA15l4_7", "c�ol4_10") PARTITION BY LIST ("col 4\\U00027190_6") (PARTITION table_4_part_0 VALUES IN (((-0.7664076637930248496):::DECIMAL,)), PARTITION table_4_part_1 VALUES IN (((-1.0):::DECIMAL,)), PARTITION table_4_part_2 VALUES IN ((47887.62543624669163:::DECIMAL,)), PARTITION "%vtable_4_part_3" VALUES IN ((655432517808.1623368:::DECIMAL,)), PARTITION table_4_part_4 VALUES IN ((5512305455.377977786:::DECIMAL,)), PARTITION table_4_part_5 VALUES IN ((4386406.733463160161:::DECIMAL,)), PARTITION table_4_part_6 VALUES IN ((9.179069908822954396E+20:::DECIMAL,)), PARTITION "DEFAULT" VALUES IN ((DEFAULT,))) WHERE ((((table_4.col4_2 > 'X':::STRING) AND (table_4.col4_0 != e'\'':::STRING)) AND (table_4."co l4-_4" <= e'\U00002603':::STRING:::NAME)) OR (table_4.col4_9 = 3.4028234663852886e+38:::FLOAT8)) OR (table_4."c�ol4_10" > '24:00:00':::TIME), UNIQUE (col4_1 ASC) WHERE ((((((table_4."co l4-_4" > e'\U00002603':::STRING:::NAME) AND (table_4."col 4\\U00027190_6" > 0:::DECIMAL)) AND (table_4."c�ol4_10" <= '24:00:00':::TIME)) OR (table_4.col4_0 <= e'\U00002603':::STRING)) AND (table_4.col4_2 <= '"':::STRING)) AND (table_4.col4_9 <= (-1.0):::FLOAT8)) AND (table_4.col4_1 = '24:00:00-15:59':::TIMETZ), UNIQUE ("co l4-_4") STORING (col4_0, col4_1, "'co%pl4_5", "col4\\x69_8", "c�ol4_10") PARTITION BY LIST ("co l4-_4") (PARTITION "table_4_""p😡art_0" VALUES IN ((e'oWx\x1fa':::STRING:::NAME,)), PARTITION "tabl'e_4_part_1" VALUES IN ((e'I&,^\x06\x126':::STRING:::NAME,)), PARTITION table_4_part_2 VALUES IN (('':::STRING:::NAME,)), PARTITION table_4_part_3 VALUES IN ((e'\t\x1fwe&':::STRING:::NAME,)), PARTITION "table_4_parT_4" VALUES IN ((e'\U00002603':::STRING:::NAME,)), PARTITION "table_4_par t_5" VALUES IN ((e'k\nc\x169\x1c\x10':::STRING:::NAME,)), PARTITION "DEFAULT" VALUES IN ((DEFAULT,))) WHERE ((((((table_4."c�ol4_10" = '24:00:00':::TIME) AND (table_4.col4_9 != 1.7976931348623157e+308:::FLOAT8)) AND (table_4.col4_2 = e'\x00':::STRING)) AND (table_4."col 4\\U00027190_6" > (-1):::DECIMAL)) AND (table_4.col4_0 != e'\U00002603':::STRING)) AND (table_4."co l4-_4" > '"':::STRING:::NAME)) OR (table_4.col4_1 > '24:00:00-15:59':::TIMETZ), FAMILY ("co l4-_4"), FAMILY ("co\\uDA15l4_7"), FAMILY (col4_3), FAMILY (col4_9), FAMILY ("c�ol4_10"), FAMILY (col4_2, col4_1, "col 4\\U00027190_6", "'co%pl4_5"), FAMILY ("col4\\x69_8"), FAMILY (col4_0));
    rsg_test.go:770: CREATE TABLE "table�_5" (col5_0 DATE NOT NULL, PRIMARY KEY (col5_0));
    rsg_test.go:770: ALTER TABLE table̼_1 INJECT STATISTICS e'[{"avg_size": 19, "columns": ["\\"\u0107ol1\\"\\"_0\\""], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 15298612, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 20000000}, {"avg_size": 28, "columns": ["\\"c)\\u000col1_1\\""], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 13031482, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 20000000}, {"avg_size": 8, "columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 17265766, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 20000000}, {"avg_size": 19, "columns": ["\\"\U0001F63Acol\\"\\"1_5\\""], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 15366826, "histo_col_type": "", "name": "__auto__", "null_count": 14691529, "row_count": 20000000}, {"avg_size": 2, "columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 391646, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 20000000}, {"avg_size": 28, "columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 13259650, "histo_col_type": "", "name": "__auto__", "null_count": 12864690, "row_count": 20000000}, {"avg_size": 5, "columns": ["col\u03021_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 14917414, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 20000000}, {"avg_size": 12, "columns": ["\\"col 1_4\\""], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 12665428, "histo_buckets": [{"distinct_range": 0, "num_eq": 60000, "num_range": 0, "upper_bound": "true"}], "histo_col_type": "BOOL", "histo_version": 3, "name": "__auto__", "null_count": 0, "row_count": 20000000}, {"avg_size": 24, "columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 19110817, "histo_buckets": [{"distinct_range": 0, "num_eq": 8610797055899352107, "num_range": 0, "upper_bound": "("}, {"distinct_range": 0, "num_eq": 8857626570670225697, "num_range": 700000000, "upper_bound": "h"}, {"distinct_range": 50000000000, "num_eq": 60000000, "num_range": 50000000000, "upper_bound": " \\u0003S@r"}, {"distinct_range": 0, "num_eq": 4501385256103244280, "num_range": 50, "upper_bound": "sZ\\u00045\\u001f"}, {"distinct_range": 0, "num_eq": 1117482613357937605, "num_range": 6739515418986419725, "upper_bound": "~\\r &K"}, {"distinct_range": 7411186.416501976, "num_eq": 6442650851802070762, "num_range": 10000000, "upper_bound": "CD\\u000c\\u001dudB\\u0018"}, {"distinct_range": 0, "num_eq": 3520748283626298426, "num_range": 5000000000, "upper_bound": "{\\u001f \\u000fm\\u0011k?k"}], "histo_col_type": "STRING", "histo_version": 3, "name": "__auto__", "null_count": 0, "row_count": 20000000}, {"avg_size": 25, "columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 17627621, "histo_col_type": "", "name": "__auto__", "null_count": 8606406, "row_count": 20000000}]':::JSONB;
    rsg_test.go:770: ALTER TABLE table_2 INJECT STATISTICS e'[{"avg_size": 30, "columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 267, "histo_col_type": "", "name": "__auto__", "null_count": 533, "row_count": 700}, {"avg_size": 25, "columns": ["\\"\'col2_16\\""], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 160, "histo_col_type": "", "name": "__auto__", "null_count": 222, "row_count": 700}, {"avg_size": 13, "columns": ["\\"c_o\u031A l\u03162_1\\""], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 293, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 700}, {"avg_size": 13, "columns": ["\\"c\\tol)2_2\\""], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 672, "histo_buckets": [{"distinct_range": 0, "num_eq": 50000, "num_range": 0, "upper_bound": ""}, {"distinct_range": 0, "num_eq": 4497280070763544881, "num_range": 0, "upper_bound": "\\u0003-\\u001e\\u001d@3"}], "histo_col_type": "NAME", "histo_version": 3, "name": "__auto__", "null_count": 0, "row_count": 700}, {"avg_size": 28, "columns": ["col2_17"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 66, "histo_buckets": [{"distinct_range": 0, "num_eq": 684300316191756912, "num_range": 0, "upper_bound": "489622011687217364"}], "histo_col_type": "INT8", "histo_version": 3, "name": "__auto__", "null_count": 0, "row_count": 700}, {"avg_size": 5, "columns": ["c\u01D2l2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 74, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 700}, {"avg_size": 29, "columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 651, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 700}, {"avg_size": 15, "columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 543, "histo_col_type": "", "name": "__auto__", "null_count": 605, "row_count": 700}, {"avg_size": 22, "columns": ["col2_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 49, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 700}, {"avg_size": 9, "columns": ["col2_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 97, "histo_col_type": "", "name": "__auto__", "null_count": 292, "row_count": 700}, {"avg_size": 21, "columns": ["col2_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 383, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 700}, {"avg_size": 24, "columns": ["c\U0001F637ol2\u0351_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 309, "histo_buckets": [{"distinct_range": 0, "num_eq": 3925695519467911095, "num_range": 0, "upper_bound": "8D018A2C/14158837"}, {"distinct_range": 1147658069.4392474, "num_eq": 7000, "num_range": 3000000000, "upper_bound": "746F1CEB/61AC3ED7"}, {"distinct_range": 0, "num_eq": 700000, "num_range": 0, "upper_bound": "32910D9A/D5E96DDC"}, {"distinct_range": 30000000000, "num_eq": 2729855949153199757, "num_range": 30000000000, "upper_bound": "42B808BB/9BE41F1D"}, {"distinct_range": 7724063600207096000, "num_eq": 80000, "num_range": 7724063600207095969, "upper_bound": "CAD084E6/1D973D96"}, {"distinct_range": 3329598132939223000, "num_eq": 400000000, "num_range": 3329598132939222882, "upper_bound": "7FFFFFFF/FFFFFFFF"}], "histo_col_type": "PG_LSN", "histo_version": 3, "name": "__auto__", "null_count": 0, "row_count": 700}, {"avg_size": 21, "columns": ["\\"c\'ol2_0\\""], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 591, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 700}, {"avg_size": 24, "columns": ["col2\u035C_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 169, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 700}, {"avg_size": 3, "columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 37, "histo_col_type": "", "name": "__auto__", "null_count": 192, "row_count": 700}, {"avg_size": 22, "columns": ["col2_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 330, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 700}, {"avg_size": 13, "columns": ["\\"col%2_12\\""], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 368, "histo_buckets": [{"distinct_range": 0, "num_eq": 6000000, "num_range": 0, "upper_bound": "3177292009645217624"}, {"distinct_range": 10000000, "num_eq": 1842924945572846268, "num_range": 10000000, "upper_bound": "-5769956954107942553"}, {"distinct_range": 342.2808629617963, "num_eq": 40000, "num_range": 1000, "upper_bound": "-7418974372515945627"}, {"distinct_range": 1000000, "num_eq": 100, "num_range": 1000000, "upper_bound": "-3334480766087935589"}, {"distinct_range": 7640912574687157000, "num_eq": 100000, "num_range": 7640912574687156754, "upper_bound": "-1360583987027398070"}, {"distinct_range": 0, "num_eq": 5996341580679954052, "num_range": 0, "upper_bound": "-7826751780521205117"}], "histo_col_type": "INT8", "histo_version": 3, "name": "__auto__", "null_count": 0, "row_count": 700}, {"avg_size": 25, "columns": ["col2_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 445, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 700}]':::JSONB;
    rsg_test.go:770: ALTER TABLE table_3 INJECT STATISTICS e'[{"avg_size": 2, "columns": ["col3_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5336553, "histo_col_type": "", "name": "__auto__", "null_count": 5172712, "row_count": 7000000}, {"avg_size": 22, "columns": ["col3_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 297744, "histo_buckets": [{"distinct_range": 0, "num_eq": 792523808851906478, "num_range": 0, "upper_bound": "163.204.70.45/7"}, {"distinct_range": 0, "num_eq": 3000, "num_range": 200000, "upper_bound": "108.165.74.33/24"}, {"distinct_range": 999532542501011700, "num_eq": 100, "num_range": 7739031375440209375, "upper_bound": "202c:3b63:3248:f226:4e10:7c46:ac1f:a90e/40"}, {"distinct_range": 3000, "num_eq": 2180781158854302205, "num_range": 3000, "upper_bound": "3c10:1d97:85e9:e851:2c28:8c2c:9f50:69a6/56"}, {"distinct_range": 0, "num_eq": 900000000, "num_range": 0, "upper_bound": "4635:d91e:3e70:68ea:676f:51a1:a314:c749/60"}, {"distinct_range": 1444306763593693700, "num_eq": 200000000, "num_range": 8476674164410664666, "upper_bound": "f53f:b532:4230:be0f:177a:cad7:fd48:659f/81"}, {"distinct_range": 6377272527331464000, "num_eq": 40000000, "num_range": 6377272527331464535, "upper_bound": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"}], "histo_col_type": "INET", "histo_version": 3, "name": "__auto__", "null_count": 0, "row_count": 7000000}, {"avg_size": 19, "columns": ["\\"c o\\\\\\\\x76l3_6\\""], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3917268, "histo_col_type": "BOX2D", "histo_version": 3, "name": "__auto__", "null_count": 5873605, "row_count": 7000000}, {"avg_size": 25, "columns": ["col3_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4288773, "histo_col_type": "", "name": "__auto__", "null_count": 3748154, "row_count": 7000000}, {"avg_size": 7, "columns": ["\\"col%q3_3\\""], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5284507, "histo_col_type": "", "name": "__auto__", "null_count": 1619740, "row_count": 7000000}, {"avg_size": 21, "columns": ["\\"co%ql3%85_1\\""], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1544720, "histo_col_type": "", "name": "__auto__", "null_count": 6373181, "row_count": 7000000}, {"avg_size": 2, "columns": ["col3_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1869694, "histo_col_type": "STRING", "histo_version": 3, "name": "__auto__", "null_count": 0, "row_count": 7000000}, {"avg_size": 22, "columns": ["col\U0001F62B3_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4983856, "histo_col_type": "", "name": "__auto__", "null_count": 6611333, "row_count": 7000000}, {"avg_size": 13, "columns": ["\\"c\\\\\\\\xc1ol3_16\\""], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 870993, "histo_col_type": "", "name": "__auto__", "null_count": 3246755, "row_count": 7000000}, {"avg_size": 29, "columns": ["\\"%pcol3_0\\""], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 94278, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7000000}, {"avg_size": 12, "columns": ["\\"\\u000ccol3_7\\""], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6094899, "histo_col_type": "", "name": "__auto__", "null_count": 526706, "row_count": 7000000}, {"avg_size": 21, "columns": ["col3_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3219481, "histo_buckets": [{"distinct_range": 0, "num_eq": 4613445049118542788, "num_range": 0, "upper_bound": "-1623691458"}, {"distinct_range": 1595232035297844000, "num_eq": 7000000, "num_range": 2322375054342962051, "upper_bound": "-613336013"}, {"distinct_range": 6328144252168262000, "num_eq": 1893377924923714372, "num_range": 6328144252168261428, "upper_bound": "1933291301"}, {"distinct_range": 0, "num_eq": 900000000, "num_range": 7093337007416171732, "upper_bound": "-939706427"}, {"distinct_range": 0, "num_eq": 7655190133679845041, "num_range": 40, "upper_bound": "2048151804"}, {"distinct_range": 14658.276187078818, "num_eq": 30000, "num_range": 60000, "upper_bound": "-128"}], "histo_col_type": "INT4", "histo_version": 3, "name": "__auto__", "null_count": 6922746, "row_count": 7000000}, {"avg_size": 24, "columns": ["col3_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4184921, "histo_col_type": "", "name": "__auto__", "null_count": 3599765, "row_count": 7000000}, {"avg_size": 21, "columns": ["\\"Col3_14\\""], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5183264, "histo_col_type": "", "name": "__auto__", "null_count": 2149179, "row_count": 7000000}, {"avg_size": 7, "columns": ["col3_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3882098, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7000000}, {"avg_size": 24, "columns": ["\\"%pcol3_15\\""], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6049913, "histo_col_type": "", "name": "__auto__", "null_count": 4786853, "row_count": 7000000}, {"avg_size": 14, "columns": ["c\U0001F605ol3_17"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3434214, "histo_buckets": [{"distinct_range": 0, "num_eq": 60, "num_range": 0, "upper_bound": "r\\u0005~\\u00101"}], "histo_col_type": "STRING", "histo_version": 3, "name": "__auto__", "null_count": 2869064, "row_count": 7000000}, {"avg_size": 24, "columns": ["col3_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3997360, "histo_buckets": [{"distinct_range": 0, "num_eq": 1902905092496904610, "num_range": 0, "upper_bound": "ARRAY[]"}, {"distinct_range": 8152644.786962104, "num_eq": 3864707392185829082, "num_range": 40000000, "upper_bound": "ARRAY[true,true]"}, {"distinct_range": 1346459122418478000, "num_eq": 5283141204090527258, "num_range": 6019801991413029259, "upper_bound": "ARRAY[true,false]"}, {"distinct_range": 2574884036923521500, "num_eq": 6000, "num_range": 6957800390164187208, "upper_bound": "ARRAY[false,true]"}, {"distinct_range": 20000000, "num_eq": 8000, "num_range": 20000000, "upper_bound": "ARRAY[true,false,false]"}, {"distinct_range": 0, "num_eq": 7914680654350898169, "num_range": 0, "upper_bound": "ARRAY[false,false,false]"}, {"distinct_range": 2637784841773687300, "num_eq": 8436556978882208435, "num_range": 2637784841773687463, "upper_bound": "ARRAY[true,false,true,false]"}], "histo_col_type": "BOOL[]", "histo_version": 3, "name": "__auto__", "null_count": 0, "row_count": 7000000}]':::JSONB;
    rsg_test.go:770: ALTER TABLE table_4 INJECT STATISTICS e'[{"avg_size": 30, "columns": ["\\"col4\\\\\\\\x69_8\\""], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1231658356633153017, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1691307425945028835}, {"avg_size": 16, "columns": ["col4_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1567010679578992741, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1691307425945028835}, {"avg_size": 3, "columns": ["col4_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 270564909466356614, "histo_col_type": "", "name": "__auto__", "null_count": 25852605693697136, "row_count": 1691307425945028835}, {"avg_size": 12, "columns": ["\\"col 4\\\\\\\\U00027190_6\\""], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1233203830690869588, "histo_buckets": [{"distinct_range": 0, "num_eq": 0, "num_range": 0, "upper_bound": "-868.3019058140271940"}, {"distinct_range": 0, "num_eq": 3000000, "num_range": 500000000, "upper_bound": "-872030970014724.2028"}, {"distinct_range": 9223312.690385016, "num_eq": 3074100352016062811, "num_range": 90000000, "upper_bound": "7.692894174323540673E+30"}], "histo_col_type": "DECIMAL", "histo_version": 3, "name": "__auto__", "null_count": 324067161424293172, "row_count": 1691307425945028835}, {"avg_size": 0, "columns": ["\\"\'co%pl4_5\\""], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 115428896795318266, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1691307425945028835}, {"avg_size": 14, "columns": ["\\"co\\\\\\\\uDA15l4_7\\""], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 463466754984298408, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1691307425945028835}, {"avg_size": 9, "columns": ["col4_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 243078952158868228, "histo_buckets": [{"distinct_range": 0, "num_eq": 900000000, "num_range": 0, "upper_bound": "-0.16722494058744353"}, {"distinct_range": 0, "num_eq": 0, "num_range": 244443178818909926, "upper_bound": "-1.4034883211814257"}], "histo_col_type": "FLOAT8", "histo_version": 3, "name": "__auto__", "null_count": 0, "row_count": 1691307425945028835}, {"avg_size": 27, "columns": ["\\"c\\u000bol4_10\\""], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 539807684238473070, "histo_col_type": "", "name": "__auto__", "null_count": 940017606130877871, "row_count": 1691307425945028835}, {"avg_size": 21, "columns": ["col4_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1070788015466850420, "histo_col_type": "", "name": "__auto__", "null_count": 1143774091489718860, "row_count": 1691307425945028835}, {"avg_size": 22, "columns": ["col4_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 173081960415332433, "histo_col_type": "", "name": "__auto__", "null_count": 664539094363338911, "row_count": 1691307425945028835}, {"avg_size": 9, "columns": ["\\"co l4-_4\\""], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 72209622571855636, "histo_buckets": [{"distinct_range": 0, "num_eq": 40000, "num_range": 0, "upper_bound": "v"}, {"distinct_range": 23661088.510043714, "num_eq": 0, "num_range": 30000000, "upper_bound": "n\\\\\\n"}, {"distinct_range": 0, "num_eq": 400000000, "num_range": 0, "upper_bound": "<\\u001eo\\u00044"}], "histo_col_type": "NAME", "histo_version": 3, "name": "__auto__", "null_count": 0, "row_count": 1691307425945028835}]':::JSONB;
    rsg_test.go:770: ALTER TABLE "table�_5" INJECT STATISTICS '[{"avg_size": 17, "columns": ["col5_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3359040825013206049, "histo_buckets": [{"distinct_range": 0, "num_eq": 2000, "num_range": 0, "upper_bound": "1971-10-12"}, {"distinct_range": 600000, "num_eq": 8911181492390132673, "num_range": 600000, "upper_bound": "1991-08-25"}, {"distinct_range": 0, "num_eq": 3017267376046169098, "num_range": 5031914067485415418, "upper_bound": "1980-06-19"}, {"distinct_range": 20000, "num_eq": 3703955990238236595, "num_range": 20000, "upper_bound": "1995-03-24"}], "histo_col_type": "DATE", "histo_version": 3, "name": "__auto__", "null_count": 0, "row_count": 8044396026916306028}]':::JSONB;
    rsg_test.go:770: ALTER TABLE "table�_5" ADD FOREIGN KEY (col5_0) REFERENCES table_3 (col3_11) ON DELETE RESTRICT;
    rsg_test.go:770: CREATE TYPE rand_typ_0 AS ENUM ('hox', 'apr', 'awgljn', 'm');
    rsg_test.go:770: CREATE TYPE rand_typ_1 AS ENUM ('xey', 'kqjzx', 'w', 'hwzriq');
    rsg_test.go:770: CREATE TYPE rand_typ_2 AS ENUM ('enkyi', 'qzbrlq', 'wltss');
    rsg_test.go:770: SET sql_safe_updates = false;;
    rsg_test.go:770: 
        BEGIN; CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning'); COMMIT;
        BEGIN;
        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;
        COMMIT;

        INSERT INTO seed DEFAULT VALUES;
        CREATE INDEX on seed (_int8, _float8, _date);
        CREATE INVERTED INDEX on seed (_jsonb);
        ;
    rsg_test.go:770: ALTER TABLE seed SPLIT AT VALUES (2473687719459822241);
    rsg_test.go:770: ALTER TABLE seed SPLIT AT VALUES (6027672653150793997);
    rsg_test.go:770: ALTER TABLE seed SPLIT AT VALUES (528262868283847688);
    rsg_test.go:770: ALTER TABLE seed SCATTER;
    rsg_test.go:772: 
    rsg_test.go:773: -- test log scope end --
test logs left over in: /artifacts/tmp/_tmp/d437d2c847dfedbc4972f231c3331c8e/logTestRandomSyntaxSQLSmith2971187026
--- FAIL: TestRandomSyntaxSQLSmith (302.25s)
Help

See also: [How To Investigate a Go Test Failure \(internal\)](https://cockroachlabs.atlassian.net/l/c/HgfXfJgM)

Same failure on other branches

- #120970 sql/tests: TestRandomSyntaxSQLSmith failed [SIGSEGV in geos.LineMerge] [A-spatial C-bug C-test-failure O-robot P-3 T-sql-queries branch-release-23.1.18-rc]

/cc @cockroachdb/sql-foundations

This test on roachdash | Improve this report!

Jira issue: CRDB-41515

rytaft commented 3 weeks ago

Seems related to #120136

rytaft commented 3 weeks ago

Also related to https://github.com/cockroachdb/cockroach/issues/126988#issuecomment-2225918590

DrewKimball commented 2 weeks ago

I don't see a way to get any information about the failure beyond the initial message, and it looks like a dupe of #120136, so I'll just close.