cockroach icon indicating copy to clipboard operation
cockroach copied to clipboard

sql/tests: TestRandomSyntaxSQLSmith failed

Open cockroach-teamcity opened this issue 3 years ago • 54 comments

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-21.2 @ 8d1d2b688ceedb0e5577d1da789da74d060c92ad:

Random syntax error:

    rsg_test.go:779: Crash detected: server panic: statement exec timeout

Query:

        WITH
        	with_29952 (col_176772)
        		AS (
        			SELECT
        				*
        			FROM
        				(
        					VALUES
        						(age('1981-11-20 06:04:45.000481+00:00':::TIMESTAMPTZ::TIMESTAMPTZ)::INTERVAL),
        						('6 years 2 mons 296 days 02:19:27.904518':::INTERVAL)
        				)
        					AS tab_73188 (col_176772)
        		),
        	with_29953 (col_176773) AS (SELECT * FROM (VALUES ('ml':::rand_typ_0)) AS tab_73189 (col_176773)),
        	with_29954 (col_176774, col_176775, col_176776)
        		AS (
        			SELECT
        				*
        			FROM
        				(
        					VALUES
        						(0.0:::FLOAT8, (-0.3001647622587901):::FLOAT8, (-1609670775):::INT8),
        						(0.44505685567855835:::FLOAT8, (-1.0):::FLOAT8, 1743852771:::INT8),
        						((-0.40209004282951355):::FLOAT8, log(NULL::FLOAT8)::FLOAT8, 831633444:::INT8),
        						(3.4028234663852886e+38:::FLOAT8, 0.5203414080120765:::FLOAT8, (-1746080207):::INT8),
        						('-Inf':::FLOAT8, NULL, NULL),
        						(
        							NULL,
        							CASE
        							WHEN false THEN 0.9315171294159486:::FLOAT8
        							ELSE (-0.5226726522360137):::FLOAT8
        							END,
        							(-1007829436):::INT8
        						)
        				)
        					AS tab_73190 (col_176774, col_176775, col_176776)
        		)
        SELECT
        	NULL AS col_176791,
        	tab_73199._interval AS col_176792,
        	tab_73196.col1_7 AS col_176793,
        	NULL AS col_176794,
        	tab_73195.col4_4 AS col_176795,
        	'42 years 6 mons 290 days 03:10:14.734948':::INTERVAL AS col_176796,
        	tab_73197.col2_13 AS col_176797,
        	tab_73196.tableoid AS col_176798,
        	NULL AS col_176799,
        	tab_73191.col5_7 AS col_176800,
        	tab_73191.col5_8 AS col_176801,
        	tab_73199._float4 AS col_176802,
        	1763583339:::INT8 AS col_176803,
        	tab_73196.col1_13 AS col_176804,
        	tab_73197.crdb_internal_mvcc_timestamp AS col_176805,
        	NULL AS col_176806,
        	tab_73197.crdb_internal_mvcc_timestamp AS col_176807,
        	'1973-04-19':::DATE AS col_176808,
        	5.731862968817902899:::DECIMAL AS col_176809,
        	2552674164:::OID AS col_176810,
        	'01060000E0E61000000400000001030000C00100000008000000C746F49C0BA260C03FB2A409D4A651C078617FEA5686DF417A45F418219802427EBB95CD0DAD54C059590803D94254C0762701F389AAE2C124CE5F81A011F041E4C71359F6E85040196DF4EB294952C03E78784FF9BB0142985561A94B0AFC41C09BD96E86F00EC0E87A79DC615E3BC0243314DC29250242709B5DC2F59FF6413CE138FBD9BE514014320D64B5DC4640509671DA21CBC84118DACF11A77FF94160DCD9B19EF262C09A618B46D3FA544082F1BCF97F1DE1C130C2C194F19500C299C0B9BD47E564C00868F7D65C614D40C0340CADB095D841F0C45D069C2BF6C1C746F49C0BA260C03FB2A409D4A651C078617FEA5686DF417A45F4182198024201030000C00100000007000000809823CA9168194080A7E98D51BA52C00084B9FE41399AC18066189508B8AFC11C4EB98711AA584098B962155C73294080AB8FC1C512D541588FDBCCD597D641F8B06CBB956062404E2919FEA6594040348AF08D2DEFEFC1F22512B16ADCF64110543A6674AF5340C237DCBBBF9955408A237B70E723F7C1C09967A3C2DCE64118CE3F50D7FA5FC030DBCF76CE3A3340B6EE500AE779E9C1EA09749D3DB0F84122CCB1161BA656C0B88EBBE7FCCD2F402DDB7CD0E44E00C21023735E7173F4C1809823CA9168194080A7E98D51BA52C00084B9FE41399AC18066189508B8AFC101030000C00100000007000000EBDD6FB8C8C655C024122D120C0831C038180958FEC6EB4124D916E96371E241F0777476603036C0CE7A7FBB745642C096F643DAD30C00C2C49364281C2F014290DEE70AFD592540D82DD299A07228C0EC14C9792C12F641C80FE998C420F041463A7D9BFF1C6240247406AA44293B4030E329278AB6C141A0387E658257E941E654F3734ECF5240A0B4BE81F30F434058E067C791D500C200649A891B2270C150F5538AD3A945C0E4631473B3445140001A35531793A341C8A01A8E9E01FFC1EBDD6FB8C8C655C024122D120C0831C038180958FEC6EB4124D916E96371E24101030000C00100000005000000C851C826911F4C402D1A9345DC1843C0C07404E5F4A6F7410E45520707CDF4416085EC7A8FB45740193201219D684EC01894B9244722FEC18ABB8443DCD5E0C100E93BF628E82840B0DCD4A0064D3A4030B71348532FD24102A3480A877DF4414A9DE7D0527A4DC0A8C83CF009664340EE2A480690DCF441FB9DC6AE3D3F02C2C851C826911F4C402D1A9345DC1843C0C07404E5F4A6F7410E45520707CDF441':::GEOGRAPHY
        		AS col_176811,
        	tab_73199.tableoid AS col_176812
        FROM
        	with_29952 AS cte_ref_8711,
        	defaultdb.public.table5@table5_col5_8_col5_5_col5_3_col5_7_col5_4_col5_6_idx AS tab_73191,
        	defaultdb.public.table1@[0] AS tab_73192
        	JOIN defaultdb.public.table2@[0] AS tab_73193
        		JOIN defaultdb.public.seed@[0] AS tab_73194
        			JOIN defaultdb.public.table4@table4_col4_5_expr_expr1_col4_6_expr2_key AS tab_73195 ON
        					(tab_73194._int4) = (tab_73195.crdb_internal_idx_expr_2)
        					AND (tab_73194._decimal) = (tab_73195.crdb_internal_mvcc_timestamp)
        					AND (tab_73194._bytes) = (tab_73195.col4_3)
        			JOIN defaultdb.public.table1@[0] AS tab_73196 ON
        					(tab_73194.crdb_internal_mvcc_timestamp) = (tab_73196.col1_0)
        					AND (tab_73195.col4_5) = (tab_73196.col1_5) ON
        				(tab_73193.col2_12) = (tab_73194._int2) AND (tab_73193.col2_8) = (tab_73194._decimal) ON
        			(tab_73192.crdb_internal_mvcc_timestamp) = (tab_73196.col1_0)
        			AND (tab_73192.col1_14) = (tab_73193.crdb_internal_mvcc_timestamp)
        	JOIN defaultdb.public.table2@table2_col2_10_col2_7_col2_12_col2_6_idx AS tab_73197
        		JOIN defaultdb.public.table1@[0] AS tab_73198
        			FULL JOIN defaultdb.public.seed@seed__int8__float8__date_idx AS tab_73199 ON true ON
        				(tab_73197.col2_13) = (tab_73198.col1_10)
        				AND (tab_73197.col2_8) = (tab_73199._decimal)
        				AND (tab_73197.col2_8) = (tab_73198.col1_0)
        				AND (tab_73197.col2_0) = (tab_73198.col1_12)
        				AND (tab_73197.col2_11) = (tab_73198.col1_10) ON
        			(tab_73194._int2) = (tab_73198.col1_9) AND (tab_73193.col2_10) = (tab_73199._interval),
        	with_29953 AS cte_ref_8713
        WHERE
        	tab_73197.col2_9
        ORDER BY
        	tab_73196.col1_8,
        	tab_73199._inet ASC,
        	tab_73199._int2 ASC,
        	tab_73194._timestamptz ASC,
        	tab_73193.col2_13,
        	tab_73197.col2_10 ASC,
        	tab_73198.col1_10 DESC,
        	tab_73194._decimal ASC,
        	tab_73196.col1_0
        LIMIT

Schema:

    rsg_test.go:596: To reproduce, use schema:
    rsg_test.go:598: 
        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, col1_1 JSONB, col1_2 UUID NOT NULL, col1_3 TIMETZ NULL, col1_4 GEOGRAPHY NOT NULL, col1_5 NAME, col1_6 CHAR NOT NULL, col1_7 BIT(17) NOT NULL, col1_8 UUID NULL, col1_9 INT8, col1_10 TIMETZ NOT NULL, col1_11 CHAR, col1_12 STRING NOT NULL AS (lower(CAST(col1_4 AS STRING))) STORED, col1_13 STRING NOT NULL AS (lower(CAST(col1_10 AS STRING))) VIRTUAL, col1_14 DECIMAL AS (col1_0 + (-5.872376633060044449):::DECIMAL) VIRTUAL, FAMILY (col1_11), FAMILY (col1_10, col1_5), FAMILY (col1_12, col1_9), FAMILY (col1_8, col1_2, col1_3), FAMILY (col1_4), FAMILY (col1_0), FAMILY (col1_1), FAMILY (col1_6), FAMILY (col1_7));
        CREATE TABLE table2 (col2_0 NAME NULL, col2_1 UUID, col2_2 GEOGRAPHY, col2_3 FLOAT8 NOT NULL, col2_4 VARCHAR NOT NULL, col2_5 JSONB NOT NULL, col2_6 "char" NULL, col2_7 TIMESTAMPTZ, col2_8 DECIMAL, col2_9 BOOL NOT NULL, col2_10 INTERVAL NULL, col2_11 TIMETZ NOT NULL, col2_12 INT2 NOT NULL, col2_13 TIMETZ, col2_14 BIT(36), UNIQUE (col2_12 ASC, col2_8 ASC), UNIQUE (col2_8 DESC, col2_4 ASC, col2_6, col2_9, lower(CAST(col2_1 AS STRING)), col2_13 ASC) STORING (col2_1, col2_7, col2_11, col2_12), INDEX (col2_10, col2_7 DESC, col2_12, col2_6 ASC) WHERE (((table2.col2_4 <= '"':::STRING) AND table2.col2_9) OR (table2.col2_6 < e'\'':::STRING)) AND (table2.col2_7 < '0001-01-01 00:00:00+00:00':::TIMESTAMPTZ), FAMILY (col2_6), FAMILY (col2_12, col2_3, col2_5), FAMILY (col2_10), FAMILY (col2_2), FAMILY (col2_14, col2_1, col2_11), FAMILY (col2_8), FAMILY (col2_9), FAMILY (col2_13, col2_4), FAMILY (col2_7), FAMILY (col2_0));
        CREATE TABLE table3 (col3_0 TIME, col3_1 GEOGRAPHY, col3_2 BYTES NULL, col3_3 TIMESTAMPTZ, col3_4 DECIMAL NULL, col3_5 BOOL NOT NULL, col3_6 GEOMETRY NULL, col3_7 NAME NOT NULL, col3_8 FLOAT8 NULL, col3_9 BOX2D, col3_10 CHAR, col3_11 REGCLASS NOT NULL, col3_12 INT2 NOT NULL, col3_13 INTERVAL, col3_14 STRING NOT NULL AS (lower(CAST(col3_5 AS STRING))) STORED, col3_15 FLOAT8 NULL AS (col3_8 + 2.443710687564054:::FLOAT8) STORED, col3_16 STRING AS (lower(col3_10)) STORED, col3_17 STRING NOT NULL AS (lower(col3_7)) VIRTUAL, col3_18 STRING NULL AS (CASE WHEN col3_2 IS NULL THEN '|]SH':::STRING ELSE e'\bVBR``\\WDa':::STRING END) STORED, UNIQUE (col3_15 ASC, col3_18 ASC, col3_3), INVERTED INDEX (col3_3, (CASE WHEN col3_3 IS NULL THEN e'\x1d':::STRING ELSE e'\'\x7foo\x03.Q':::STRING END), col3_1 ASC), INDEX (col3_15, col3_3 ASC) STORING (col3_2, col3_5, col3_9, col3_10, col3_11, col3_16, col3_18), INDEX (col3_17 ASC, col3_12, lower(CAST(col3_6 AS STRING)) DESC, lower(CAST(col3_1 AS STRING)), col3_2 DESC, col3_14, col3_3, col3_0 ASC, col3_8 ASC, col3_15, col3_5, col3_13 DESC, col3_16, col3_9 ASC) STORING (col3_11, col3_18) WHERE (((((((((table3.col3_2 >= '\xff':::BYTES) OR (table3.col3_16 < e'\x00':::STRING)) AND (table3.col3_3 != '0001-01-01 00:00:00+00:00':::TIMESTAMPTZ)) OR (table3.col3_18 > e'\U00002603':::STRING)) OR (table3.col3_15 >= 1.401298464324817e-45:::FLOAT8)) OR (table3.col3_10 = e'\'':::STRING)) AND (table3.col3_7 >= e'\x00':::STRING)) OR (table3.col3_4 <= 'NaN':::DECIMAL)) OR (table3.col3_0 <= '24:00:00':::TIME)) OR (table3.col3_12 = (-128):::INT8), FAMILY (col3_0, col3_12), FAMILY (col3_18), FAMILY (col3_8, col3_11, col3_7, col3_5, col3_3), FAMILY (col3_15), FAMILY (col3_16, col3_4, col3_10, col3_6), FAMILY (col3_13), FAMILY (col3_14, col3_1, col3_9, col3_2));
        CREATE TABLE table4 (col4_0 UUID NOT NULL, col4_1 TIMESTAMP NOT NULL, col4_2 INT8 NOT NULL, col4_3 BYTES NOT NULL, col4_4 INT4 NOT NULL, col4_5 CHAR NOT NULL, PRIMARY KEY (col4_3 DESC, col4_2 DESC, col4_0, col4_5 ASC, col4_4 DESC, col4_1), col4_6 INT4 NOT NULL AS (col4_4 + col4_2) STORED, UNIQUE (col4_5, lower(col4_5), (col4_2 + col4_4) ASC, col4_6 DESC, (col4_4 + (-1710576940):::INT8) ASC), UNIQUE (col4_0 DESC, col4_5 DESC, col4_1 ASC, col4_6, col4_2, col4_3 ASC), INDEX (col4_5 ASC, col4_3 ASC, col4_0 DESC, col4_1 ASC, col4_6, col4_4, col4_2 DESC) WHERE ((table4.col4_2 > (-1):::INT8) AND (table4.col4_4 = (-2147483648):::INT8)) AND (table4.col4_3 < '\x27':::BYTES), INDEX (col4_3 ASC, col4_2) STORING (col4_6), INDEX (col4_6 DESC));
        CREATE TABLE table5 (col5_0 REGPROCEDURE, col5_1 FLOAT4, col5_2 INT8, col5_3 BIT(40) NOT NULL, col5_4 REGPROC NOT NULL, col5_5 CHAR, col5_6 TIMESTAMP NULL, col5_7 CHAR, col5_8 STRING AS (lower(CAST(col5_0 AS STRING))) VIRTUAL, col5_9 STRING NULL AS (lower(CAST(col5_6 AS STRING))) VIRTUAL, INDEX (col5_8 ASC, col5_5 DESC, col5_3 ASC, col5_7, col5_4 ASC, col5_6 ASC), UNIQUE ((col5_2 + 7366275680889321816:::INT8) ASC, (col5_1 + (-0.23182782530784607):::FLOAT8), col5_8 DESC, col5_0 ASC, col5_7, lower(CAST(col5_4 AS STRING)) ASC, col5_4 DESC, col5_2, col5_9, col5_3 DESC) STORING (col5_5), FAMILY (col5_0), FAMILY (col5_7), FAMILY (col5_6, col5_2), FAMILY (col5_4), FAMILY (col5_1, col5_5, col5_3));
        ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2581961560101794571, "histo_col_type": "", "name": "__auto__", "null_count": 814831659390802378, "row_count": 8706592332517044959}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2626460100126376932, "histo_col_type": "", "name": "__auto__", "null_count": 229678770183434887, "row_count": 8706592332517044959}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6370894020418468837, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8706592332517044959}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6835384533925425036, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8706592332517044959}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 153399353338768204, "histo_col_type": "", "name": "__auto__", "null_count": 5782646789694904418, "row_count": 8706592332517044959}, {"columns": ["col1_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2165482203704596666, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8706592332517044959}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 633066831461856760, "histo_col_type": "", "name": "__auto__", "null_count": 3318841199990171194, "row_count": 8706592332517044959}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3193447526024838698, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8706592332517044959}, {"columns": ["col1_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 8374712728146484511, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8706592332517044959}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5857934673352423389, "histo_col_type": "", "name": "__auto__", "null_count": 3632515247527947796, "row_count": 8706592332517044959}, {"columns": ["col1_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4200529120878471554, "histo_col_type": "", "name": "__auto__", "null_count": 1709657273085312173, "row_count": 8706592332517044959}, {"columns": ["col1_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7409740763644471347, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8706592332517044959}, {"columns": ["col1_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2152496445359764814, "histo_col_type": "", "name": "__auto__", "null_count": 801622346922235376, "row_count": 8706592332517044959}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5590846282524210367, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8706592332517044959}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2385144200813639924, "histo_col_type": "", "name": "__auto__", "null_count": 6366378312783566586, "row_count": 8706592332517044959}]':::JSONB;
        ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 8375839950, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 10000000000}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2008561372, "histo_col_type": "", "name": "__auto__", "null_count": 1218237670, "row_count": 10000000000}, {"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5023114278, "histo_buckets": [{"distinct_range": 0, "num_eq": 8000000000, "num_range": 0, "upper_bound": "-4.974297085906378182E+30"}, {"distinct_range": 803343244325082800, "num_eq": 1445274989090080056, "num_range": 2520113687591227805, "upper_bound": "-6.329168472099124785E+19"}, {"distinct_range": 0, "num_eq": 80000000, "num_range": 6004461259389403641, "upper_bound": "2.379186446072682017"}, {"distinct_range": 0, "num_eq": 5304750253789467116, "num_range": 5178309100968034556, "upper_bound": "49143.9153920760753"}, {"distinct_range": 258695.34390350906, "num_eq": 5432761338466361061, "num_range": 600000, "upper_bound": "122041537392.4853411"}, {"distinct_range": 2341492687557582.5, "num_eq": 2944420437892169616, "num_range": 5087444891801131667, "upper_bound": "49556549654471.8478"}, {"distinct_range": 0, "num_eq": 1482000653083934021, "num_range": 0, "upper_bound": "1.934549588167762027E+34"}], "histo_col_type": "DECIMAL", "name": "__auto__", "null_count": 3997412359, "row_count": 10000000000}, {"columns": ["col2_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1396741349, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 10000000000}, {"columns": ["col2_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3598385016, "histo_col_type": "", "name": "__auto__", "null_count": 4152157766, "row_count": 10000000000}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1338849405, "histo_col_type": "", "name": "__auto__", "null_count": 3156867789, "row_count": 10000000000}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7017353901, "histo_col_type": "", "name": "__auto__", "null_count": 9468710853, "row_count": 10000000000}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6402452747, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 10000000000}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2771098646, "histo_col_type": "", "name": "__auto__", "null_count": 4328955082, "row_count": 10000000000}, {"columns": ["col2_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 8077214227, "histo_buckets": [{"distinct_range": 0, "num_eq": 90000, "num_range": 0, "upper_bound": "-67 years -656 days -04:00:22.384217"}, {"distinct_range": 0, "num_eq": 400000, "num_range": 10000000, "upper_bound": "-8 years -2 mons -578 days -10:47:40.537252"}, {"distinct_range": 30000, "num_eq": 6842783341168972637, "num_range": 30000, "upper_bound": "7 years 506 days 03:56:34.457967"}, {"distinct_range": 20000000000, "num_eq": 0, "num_range": 20000000000, "upper_bound": "27 years 4 mons 368 days 01:17:53.287531"}, {"distinct_range": 0, "num_eq": 4261973815875417561, "num_range": 5000, "upper_bound": "33 years 9 mons 557 days 05:23:00.162522"}, {"distinct_range": 0, "num_eq": 5560183148690261041, "num_range": 50000, "upper_bound": "72 years 146 days 20:18:12.966553"}], "histo_col_type": "INTERVAL", "name": "__auto__", "null_count": 8665543958, "row_count": 10000000000}, {"columns": ["col2_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 556413600, "histo_buckets": [{"distinct_range": 0, "num_eq": 30000000, "num_range": 0, "upper_bound": "-28036"}, {"distinct_range": 3989157745367400000, "num_eq": 7519550093137957344, "num_range": 3989157745367399775, "upper_bound": "-21568"}, {"distinct_range": 303709589771573000, "num_eq": 90000000, "num_range": 1269531531974031777, "upper_bound": "-8369"}, {"distinct_range": 20000000000, "num_eq": 100000, "num_range": 20000000000, "upper_bound": "-1"}, {"distinct_range": 48370.01999000506, "num_eq": 8232196664599877795, "num_range": 90000, "upper_bound": "21029"}, {"distinct_range": 0, "num_eq": 4000000000, "num_range": 1895226073256618997, "upper_bound": "32673"}], "histo_col_type": "INT2", "name": "__auto__", "null_count": 0, "row_count": 10000000000}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 9281436260, "histo_col_type": "", "name": "__auto__", "null_count": 7039112355, "row_count": 10000000000}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5646656148, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 10000000000}, {"columns": ["col2_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7137111183, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 10000000000}, {"columns": ["col2_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6404636012, "histo_col_type": "", "name": "__auto__", "null_count": 1717559645, "row_count": 10000000000}]':::JSONB;
        ALTER TABLE table3 INJECT STATISTICS '[{"columns": ["col3_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2878664882346961622, "histo_col_type": "", "name": "__auto__", "null_count": 805260927752749049, "row_count": 4576759961873626700}, {"columns": ["col3_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1125513100173829638, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4576759961873626700}, {"columns": ["col3_17"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2651921396396881491, "histo_col_type": "STRING", "name": "__auto__", "null_count": 0, "row_count": 4576759961873626700}, {"columns": ["col3_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 836061382448174878, "histo_col_type": "", "name": "__auto__", "null_count": 3075386091172973389, "row_count": 4576759961873626700}, {"columns": ["col3_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4319684629534254149, "histo_col_type": "", "name": "__auto__", "null_count": 2172014787365398557, "row_count": 4576759961873626700}, {"columns": ["col3_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1637834497617079987, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4576759961873626700}, {"columns": ["col3_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 125733827385370271, "histo_col_type": "", "name": "__auto__", "null_count": 3695396642847048113, "row_count": 4576759961873626700}, {"columns": ["col3_16"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 111417077739853682, "histo_col_type": "", "name": "__auto__", "null_count": 72909789727381966, "row_count": 4576759961873626700}, {"columns": ["col3_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 828094414201101543, "histo_col_type": "", "name": "__auto__", "null_count": 4202404605841497479, "row_count": 4576759961873626700}, {"columns": ["col3_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1724560998656552461, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4576759961873626700}, {"columns": ["col3_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2725848124132879634, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4576759961873626700}, {"columns": ["col3_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3784561972155724990, "histo_col_type": "", "name": "__auto__", "null_count": 2435595744152459321, "row_count": 4576759961873626700}, {"columns": ["col3_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2098979700311689363, "histo_col_type": "", "name": "__auto__", "null_count": 3964725817355036084, "row_count": 4576759961873626700}, {"columns": ["col3_18"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 809439759261676311, "histo_col_type": "", "name": "__auto__", "null_count": 1957651716727007960, "row_count": 4576759961873626700}, {"columns": ["col3_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2171848372442135132, "histo_col_type": "", "name": "__auto__", "null_count": 1550579989913279349, "row_count": 4576759961873626700}, {"columns": ["col3_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2863700799099625804, "histo_col_type": "", "name": "__auto__", "null_count": 747985593176069781, "row_count": 4576759961873626700}, {"columns": ["col3_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1145530956702572160, "histo_buckets": [{"distinct_range": 0, "num_eq": 7000000, "num_range": 0, "upper_bound": "NaN"}, {"distinct_range": 4604926298717156000, "num_eq": 8831342094340379093, "num_range": 8703834053711956768, "upper_bound": "-0.9104902081551224"}, {"distinct_range": 600, "num_eq": 404770842828561742, "num_range": 600, "upper_bound": "-0.8654079842791917"}, {"distinct_range": 300, "num_eq": 8167801792993235273, "num_range": 300, "upper_bound": "-0.4523810989653798"}, {"distinct_range": 0, "num_eq": 0, "num_range": 70000000, "upper_bound": "0.5286190372338562"}], "histo_col_type": "FLOAT8", "name": "__auto__", "null_count": 19388735522792394, "row_count": 4576759961873626700}, {"columns": ["col3_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 735506494387830218, "histo_col_type": "", "name": "__auto__", "null_count": 1932697879393738215, "row_count": 4576759961873626700}, {"columns": ["col3_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1315785614879147265, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4576759961873626700}]':::JSONB;
        ALTER TABLE table4 INJECT STATISTICS e'[{"columns": ["col4_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1254272095776731894, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2974068083097010264}, {"columns": ["col4_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2887667284534908849, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2974068083097010264}, {"columns": ["col4_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2425425782661034517, "histo_buckets": [{"distinct_range": 0, "num_eq": 90000000000, "num_range": 0, "upper_bound": "-2054834883"}, {"distinct_range": 4460567151.323036, "num_eq": 4051714488016007327, "num_range": 5000000000, "upper_bound": "-1673381202"}, {"distinct_range": 40000000000, "num_eq": 4005063522924299046, "num_range": 40000000000, "upper_bound": "-1347020502"}, {"distinct_range": 0, "num_eq": 4897826819194858610, "num_range": 9000, "upper_bound": "2082398513"}], "histo_col_type": "INT4", "name": "__auto__", "null_count": 0, "row_count": 2974068083097010264}, {"columns": ["col4_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1525913483251490173, "histo_buckets": [{"distinct_range": 0, "num_eq": 60000000000, "num_range": 0, "upper_bound": "00000000-0000-0000-0000-000000000000"}, {"distinct_range": 0, "num_eq": 8000000, "num_range": 2376739335910183383, "upper_bound": "2dc04cb7-d9d7-4471-8bd6-373b034e8853"}, {"distinct_range": 100000, "num_eq": 200000, "num_range": 100000, "upper_bound": "47396dcb-45d6-4d0d-bca5-8c4370d0e824"}, {"distinct_range": 8.454720328918675, "num_eq": 8062548253126318659, "num_range": 10, "upper_bound": "4b8fcbc1-effb-45ef-ab72-ea73fcda15e3"}, {"distinct_range": 226891783.4232111, "num_eq": 6000, "num_range": 700000000, "upper_bound": "52bac8af-81fe-45fd-bf84-a9468c09a48b"}, {"distinct_range": 100000, "num_eq": 9000000000, "num_range": 100000, "upper_bound": "96217e09-b428-4a0b-b325-85f566a5c447"}, {"distinct_range": 0, "num_eq": 900000, "num_range": 7617032133937446864, "upper_bound": "e1e29ac1-b3aa-411f-883e-4c052a2f1c6b"}, {"distinct_range": 724617314613694100, "num_eq": 247371864746904348, "num_range": 920644937383585461, "upper_bound": "e24a81f1-f748-4b78-98ac-b16c20543671"}], "histo_col_type": "UUID", "name": "__auto__", "null_count": 0, "row_count": 2974068083097010264}, {"columns": ["col4_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2901955296752829778, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2974068083097010264}, {"columns": ["col4_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 172767949848826245, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2974068083097010264}, {"columns": ["col4_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1678254009173212496, "histo_buckets": [{"distinct_range": 0, "num_eq": 50000000000, "num_range": 0, "upper_bound": "\\\\x086cc9869cdf"}, {"distinct_range": 221214509327655870, "num_eq": 4913147143327597487, "num_range": 221214509327655884, "upper_bound": "\\\\x200e29cc303f70548f"}, {"distinct_range": 2267266614340813000, "num_eq": 4634458870637861029, "num_range": 2267266614340813051, "upper_bound": "\\\\x364bec456bc765"}, {"distinct_range": 0, "num_eq": 7000, "num_range": 400000, "upper_bound": "\\\\x5e26"}, {"distinct_range": 3065310493275928600, "num_eq": 3906002808660814635, "num_range": 4402665651649612310, "upper_bound": "\\\\x7375c8cc"}, {"distinct_range": 0, "num_eq": 0, "num_range": 200000000, "upper_bound": "\\\\x876074640d0282"}, {"distinct_range": 229261605156993570, "num_eq": 3357214647174971880, "num_range": 1076830733043651447, "upper_bound": "\\\\xa477f2"}, {"distinct_range": 736435605100675100, "num_eq": 3364306085921278237, "num_range": 1586628642478370471, "upper_bound": "\\\\xacaff90a3467"}], "histo_col_type": "BYTES", "name": "__auto__", "null_count": 0, "row_count": 2974068083097010264}]':::JSONB;
        ALTER TABLE table5 INJECT STATISTICS '[{"columns": ["col5_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4054372, "histo_col_type": "", "name": "__auto__", "null_count": 2009639, "row_count": 8000000}, {"columns": ["col5_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2781454, "histo_col_type": "", "name": "__auto__", "null_count": 4201698, "row_count": 8000000}, {"columns": ["col5_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2213750, "histo_col_type": "", "name": "__auto__", "null_count": 6117792, "row_count": 8000000}, {"columns": ["col5_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2249339, "histo_col_type": "STRING", "name": "__auto__", "null_count": 1841353, "row_count": 8000000}, {"columns": ["col5_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5824761, "histo_col_type": "", "name": "__auto__", "null_count": 1380344, "row_count": 8000000}, {"columns": ["col5_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5722604, "histo_col_type": "", "name": "__auto__", "null_count": 4823280, "row_count": 8000000}, {"columns": ["col5_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5412373, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8000000}, {"columns": ["col5_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1563540, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8000000}, {"columns": ["col5_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1879481, "histo_col_type": "", "name": "__auto__", "null_count": 465274, "row_count": 8000000}, {"columns": ["col5_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1549739, "histo_col_type": "", "name": "__auto__", "null_count": 37300, "row_count": 8000000}]':::JSONB;
        CREATE TYPE rand_typ_0 AS ENUM ('hat', 'ml', 'el');
        CREATE TYPE rand_typ_1 AS ENUM ('qpclhr', 'wzj', 'lnn', 'fa', 'yzali', 'gmik');
        CREATE TYPE rand_typ_2 AS ENUM ('ar', 'q', 'e', 'fneo', 'sx');
        ;
    rsg_test.go:598: 
        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:600: 
    rsg_test.go:601: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith143169124
--- FAIL: TestRandomSyntaxSQLSmith (346.41s)
Reproduce

To reproduce, try:

make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1
Same failure on other branches

  • #70663 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-master]
  • #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-release-21.1]
Internal log

mjibson marked as alumn{us/a}; resolving to rafiss instead

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

Jira issue: CRDB-10251

cockroach-teamcity avatar Sep 29 '21 05:09 cockroach-teamcity

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-21.2 @ 88d8c1ce72a3988332e502e103421996d3908ab3:

Random syntax error:

    rsg_test.go:779: Crash detected: server panic: statement exec timeout

Query:

        SELECT
        	tab_295244.crdb_internal_idx_expr AS col_650405,
        	tab_295245.col2_4 AS col_650406,
        	e'[[{}, {"L@fZ+I!2w@": {"E8$b,x": []}, "foo": {}, "foobar": null, "yd/n6Q\'3BoS^": {}}], {".W;Oi<zT": [], "a": [], "c": "5gz,[9Qm,"}, [], [], true]':::JSONB
        		AS col_650407
        FROM
        	defaultdb.public.table3@[0] AS tab_295242
        	JOIN defaultdb.public.table3@[0] AS tab_295243 ON
        			(tab_295242.col3_0) = (tab_295243.col3_0)
        			AND (tab_295242.tableoid) = (tab_295243.tableoid)
        			AND (tab_295242.crdb_internal_mvcc_timestamp) = (tab_295243.crdb_internal_mvcc_timestamp)
        	JOIN defaultdb.public.table1@table1_col1_4_col1_1_col1_3_col1_7_col1_0_col1_5_col1_2_col1_6_key AS tab_295244
        		JOIN defaultdb.public.table2@[0] AS tab_295245
        			JOIN defaultdb.public.table3@[0] AS tab_295246
        				JOIN defaultdb.public.table3 AS tab_295247
        					JOIN defaultdb.public.table3 AS tab_295248 ON (tab_295247.col3_0) = (tab_295248.col3_0) ON
        						(tab_295246.col3_0) = (tab_295247.col3_0) AND (tab_295246.col3_0) = (tab_295248.col3_0) ON
        					(tab_295245.col2_8) = (tab_295246.tableoid) AND (tab_295245.tableoid) = (tab_295246.tableoid)
        			JOIN defaultdb.public.table1@[0] AS tab_295249 ON (tab_295246.tableoid) = (tab_295249.col1_2) ON
        				(tab_295244.col1_4) = (tab_295249.col1_2)
        				AND (tab_295244.col1_4) = (tab_295246.tableoid)
        				AND (tab_295244.col1_1) = (tab_295246.tableoid)
        				AND (tab_295244.tableoid) = (tab_295245.tableoid)
        				AND (tab_295244.col1_1) = (tab_295249.col1_2)
        				AND (tab_295244.col1_6) = (tab_295249.crdb_internal_idx_expr_1)
        				AND (tab_295244.col1_3) = (tab_295245.col2_2)
        				AND (tab_295244.crdb_internal_idx_expr_1) = (tab_295249.col1_7)
        				AND (tab_295244.col1_6) = (tab_295249.col1_6) ON
        			(tab_295243.col3_0) = (tab_295246.col3_0)
        			AND (tab_295242.tableoid) = (tab_295245.col2_8)
        			AND (tab_295243.tableoid) = (tab_295245.col2_5)
        	JOIN defaultdb.public.table3@[0] AS tab_295250
        		JOIN defaultdb.public.table1@[0] AS tab_295251 ON (tab_295250.tableoid) = (tab_295251.col1_1) ON
        			(tab_295244.col1_4) = (tab_295251.col1_2)
        			AND (tab_295246.crdb_internal_mvcc_timestamp) = (tab_295250.crdb_internal_mvcc_timestamp)
        	JOIN defaultdb.public.table3@[0] AS tab_295252
        		JOIN defaultdb.public.table2@[0] AS tab_295253 ON (tab_295252.tableoid) = (tab_295253.col2_5) ON
        			(tab_295245.col2_3) = (tab_295253.col2_8)
        			AND (tab_295242.crdb_internal_mvcc_timestamp) = (tab_295252.crdb_internal_mvcc_timestamp)
        LIMIT
        	91:::INT8;

Schema:

    rsg_test.go:596: To reproduce, use schema:
    rsg_test.go:598: 
        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 UUID NOT NULL, col1_1 REGPROC NOT NULL, col1_2 REGPROC, col1_3 INT4 NOT NULL, col1_4 REGPROC NOT NULL, col1_5 "char" NOT NULL, PRIMARY KEY (col1_5, col1_1 DESC, col1_3, col1_4 ASC, col1_0), col1_6 STRING NOT NULL AS (lower(CAST(col1_0 AS STRING))) STORED, col1_7 STRING AS (lower(CAST(col1_2 AS STRING))) STORED, UNIQUE (col1_3 DESC, col1_7, (col1_3 + (-971224677):::INT8) ASC, col1_6 ASC, col1_4 DESC, col1_1 ASC, col1_5 DESC, col1_0) WHERE (table1.col1_6 > e'\x00':::STRING) AND (table1.col1_5 = '':::STRING), INDEX (col1_2, col1_4 ASC, col1_7 ASC, col1_6 DESC, lower(col1_5) DESC), INDEX (col1_4, col1_3), UNIQUE (col1_4 ASC) STORING (col1_2, col1_6), UNIQUE (col1_1, lower(col1_5) ASC) WHERE table1.col1_7 < e'\x00':::STRING, INDEX (col1_5, col1_0 ASC) WHERE (table1.col1_3 < 1:::INT8) AND (table1.col1_6 = '"':::STRING), UNIQUE (col1_3 ASC) WHERE (((table1.col1_6 > 'X':::STRING) OR (table1.col1_7 <= e'\U00002603':::STRING)) AND (table1.col1_3 != (-128):::INT8)) AND (table1.col1_5 = '':::STRING), INDEX (col1_6 DESC), UNIQUE (col1_4, col1_1, col1_3, col1_7 ASC, col1_0, col1_5 DESC, col1_2, col1_6 ASC), FAMILY (col1_7), FAMILY (col1_3), FAMILY (col1_2, col1_0, col1_4, col1_1), FAMILY (col1_6), FAMILY (col1_5));
        CREATE TABLE table2 (col2_0 INT8 NULL, col2_1 DATE NULL, col2_2 INT4, col2_3 REGCLASS NULL, col2_4 TIMETZ, col2_5 OID NULL, col2_6 UUID NULL, col2_7 GEOGRAPHY, col2_8 REGPROC NULL, col2_9 INT8 NULL AS (col2_0 + col2_2) STORED, FAMILY (col2_3, col2_1, col2_0, col2_7, col2_8), FAMILY (col2_5), FAMILY (col2_4, col2_6, col2_2), FAMILY (col2_9));
        CREATE TABLE table3 (col3_0 JSONB, INVERTED INDEX (col3_0 DESC), INVERTED INDEX (col3_0), INVERTED INDEX (col3_0), INVERTED INDEX (col3_0 ASC), INVERTED INDEX (col3_0), INVERTED INDEX (col3_0 DESC));
        ALTER TABLE table1 INJECT STATISTICS e'[{"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 268, "histo_col_type": "", "name": "__auto__", "null_count": 202, "row_count": 400}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 333, "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": 211, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 400}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 170, "histo_buckets": [{"distinct_range": 0, "num_eq": 1835246023516317441, "num_range": 0, "upper_bound": "3631056259"}, {"distinct_range": 0, "num_eq": 200000, "num_range": 4669494652347263069, "upper_bound": "3659521045"}], "histo_col_type": "REGPROC", "name": "__auto__", "null_count": 362, "row_count": 400}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 20, "histo_buckets": [{"distinct_range": 0, "num_eq": 2310828182983128559, "num_range": 0, "upper_bound": "-2147483648"}, {"distinct_range": 19.66408493631993, "num_eq": 940328831251679686, "num_range": 40, "upper_bound": "-1869956923"}, {"distinct_range": 0, "num_eq": 70000000, "num_range": 1562660623182600338, "upper_bound": "-1753271706"}, {"distinct_range": 3086196029065248000, "num_eq": 5994353407771448840, "num_range": 3086196029065248000, "upper_bound": "-431701658"}, {"distinct_range": 0, "num_eq": 90000000, "num_range": 0, "upper_bound": "-128"}, {"distinct_range": 0, "num_eq": 9018971644428586107, "num_range": 7617491893471789229, "upper_bound": "1"}], "histo_col_type": "INT4", "name": "__auto__", "null_count": 0, "row_count": 400}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 15, "histo_buckets": [{"distinct_range": 0, "num_eq": 300000000, "num_range": 0, "upper_bound": "3288170827"}], "histo_col_type": "REGPROC", "name": "__auto__", "null_count": 0, "row_count": 400}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 399, "histo_buckets": [{"distinct_range": 0, "num_eq": 538508882807021024, "num_range": 0, "upper_bound": " "}, {"distinct_range": 90, "num_eq": 1172382873508636731, "num_range": 90, "upper_bound": "^"}, {"distinct_range": 2189.5409871423276, "num_eq": 3603498928238561526, "num_range": 9000, "upper_bound": "b"}, {"distinct_range": 0, "num_eq": 20000000, "num_range": 7000000, "upper_bound": "t"}, {"distinct_range": 700000000, "num_eq": 900000000, "num_range": 700000000, "upper_bound": "y"}], "histo_col_type": "\\"char\\"", "name": "__auto__", "null_count": 0, "row_count": 400}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 48, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 400}]':::JSONB;
        ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4812207661, "histo_col_type": "", "name": "__auto__", "null_count": 8676086166, "row_count": 10000000000}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6717726150, "histo_col_type": "", "name": "__auto__", "null_count": 5721761005, "row_count": 10000000000}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1787219165, "histo_col_type": "", "name": "__auto__", "null_count": 4085253710, "row_count": 10000000000}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3395820282, "histo_col_type": "", "name": "__auto__", "null_count": 2726014624, "row_count": 10000000000}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3174902541, "histo_col_type": "", "name": "__auto__", "null_count": 9069577582, "row_count": 10000000000}, {"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3414194250, "histo_col_type": "", "name": "__auto__", "null_count": 6295866702, "row_count": 10000000000}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2603295928, "histo_col_type": "", "name": "__auto__", "null_count": 134182096, "row_count": 10000000000}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 275863573, "histo_col_type": "", "name": "__auto__", "null_count": 7009711842, "row_count": 10000000000}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7625135246, "histo_col_type": "", "name": "__auto__", "null_count": 1304606675, "row_count": 10000000000}, {"columns": ["col2_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5105877099, "histo_col_type": "", "name": "__auto__", "null_count": 3514469395, "row_count": 10000000000}]':::JSONB;
        ALTER TABLE table3 INJECT STATISTICS '[{"columns": ["col3_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2892018055580252852, "histo_col_type": "BYTES", "name": "__auto__", "null_count": 69648347989432184, "row_count": 3531220879258411735}]':::JSONB;
        CREATE TYPE rand_typ_0 AS ENUM ('ouh', 'c', 'crkwvh');
        CREATE TYPE rand_typ_1 AS ENUM ('p', 'dv', 'vmc', 'q', 'tzu', 'eseop');
        CREATE TYPE rand_typ_2 AS ENUM ('ahx', 'xjgwn');
        CREATE TYPE rand_typ_3 AS ENUM ('l', 'qm', 'cz', 't', 'gzwkru', 'mmhhq');
        ;
    rsg_test.go:598: 
        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:600: 
    rsg_test.go:601: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith517955379
--- FAIL: TestRandomSyntaxSQLSmith (300.86s)
Reproduce

To reproduce, try:

make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1
Same failure on other branches

  • #70663 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-master]
  • #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-release-21.1]
Internal log

mjibson marked as alumn{us/a}; resolving to rafiss instead

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity avatar Sep 30 '21 05:09 cockroach-teamcity

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-21.2 @ 47b426a9d692a9faebb3749f25fcbfef4f64af34:

Random syntax error:

    rsg_test.go:779: Crash detected: server panic: statement exec timeout

Query:

        SELECT
        	NULL AS col_303523,
        	e'w]h!{O0#\x1d':::STRING AS col_303524,
        	(-8.884303659888717284E+22):::DECIMAL AS col_303525,
        	tab_134550.col3_1 AS col_303526,
        	tab_134546.tableoid AS col_303527,
        	NULL AS col_303528,
        	tab_134546.crdb_internal_idx_expr AS col_303529,
        	B'0000000000000000000000000000000000000' AS col_303530,
        	tab_134546.crdb_internal_mvcc_timestamp AS col_303531,
        	tab_134542.crdb_internal_idx_expr AS col_303532,
        	3785079285:::OID AS col_303533,
        	NULL AS col_303534,
        	0:::DECIMAL AS col_303535,
        	tab_134550.crdb_internal_idx_expr AS col_303536,
        	tab_134543.col1_2 AS col_303537,
        	'0103000020E6100000010000000D0000003BC57E78092662C01ADF48F6966654C058F97150894F46C037AADBBAC93B49C09411F971FBE946C07C31B086230451C0C0D0712E6F40534067DC9AA7E66053C08400182D2E2E614021F3E62F90FA43C0DEFFBC048B3C6540324BB194E4D23AC0341B5427AAEB4140202F1E40A21132C0B41064D08168564008C89C697ADA4F4043CBE28FA47D52C072D541BA6B4A534004904BA6424445C020ED38BF58FF18406A0AE22AECE75BC0D8CE551575BD26409EEE30E75BF94CC0C8C3AC7CD36420C03BC57E78092662C01ADF48F6966654C0':::GEOGRAPHY
        		AS col_303538,
        	0:::OID AS col_303539,
        	tab_134542.tableoid AS col_303540
        FROM
        	defaultdb.public.table3@[0] AS tab_134542,
        	defaultdb.public.table1@[0] AS tab_134543
        	JOIN defaultdb.public.table3@table3_col3_3_expr_key AS tab_134544 ON (tab_134543.tableoid) = (tab_134544.col3_1)
        	JOIN defaultdb.public.table3@primary AS tab_134545
        		RIGHT JOIN defaultdb.public.table1@table1_col1_5_col1_2_expr_col1_1_idx AS tab_134546
        			JOIN defaultdb.public.table2 AS tab_134547
        				JOIN defaultdb.public.table2 AS tab_134548 ON (tab_134547.col2_3) = (tab_134548.col2_3)
        				JOIN defaultdb.public.table3@[0] AS tab_134549 ON
        						(tab_134547.col2_3) = (tab_134549.crdb_internal_idx_expr)
        						AND (tab_134548.col2_3) = (tab_134549.crdb_internal_idx_expr) ON
        					(tab_134546.crdb_internal_idx_expr) = (tab_134549.crdb_internal_idx_expr)
        					AND (tab_134546.tableoid) = (tab_134549.col3_1)
        					AND (tab_134546.col1_5) = (tab_134549.col3_3) ON NULL
        		JOIN defaultdb.public.table3@table3_col3_3_expr_key AS tab_134550 ON
        				(tab_134545.crdb_internal_idx_expr) = (tab_134550.crdb_internal_idx_expr)
        				AND (tab_134548.col2_3) = (tab_134550.crdb_internal_idx_expr)
        				AND (tab_134545.col3_1) = (tab_134550.col3_1)
        				AND (tab_134545.col3_1) = (tab_134550.tableoid) ON
        			(tab_134543.col1_6) = (tab_134546.col1_0)
        			AND (tab_134543.col1_0) = (tab_134550.crdb_internal_idx_expr)
        			AND (tab_134543.col1_2) = (tab_134546.col1_2)
        ORDER BY
        	tab_134542.tableoid DESC,
        	tab_134543.crdb_internal_idx_expr ASC,
        	tab_134550.col3_3 ASC,
        	tab_134543.crdb_internal_idx_expr ASC,
        	tab_134543.col1_6
        LIMIT
        	98:::INT8;

Schema:

    rsg_test.go:596: To reproduce, use schema:
    rsg_test.go:598: 
        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 NAME NOT NULL, col1_1 TIMESTAMP NOT NULL, col1_2 INTERVAL NOT NULL, col1_3 GEOGRAPHY NOT NULL, col1_4 BIT(37) NULL, col1_5 OID NOT NULL, col1_6 STRING NOT NULL AS (lower(CAST(col1_3 AS STRING))) VIRTUAL, INDEX (col1_5, col1_2 DESC, lower(CAST(col1_4 AS STRING)) ASC, col1_1 DESC) STORING (col1_4), INDEX (col1_2 DESC) STORING (col1_0, col1_1), FAMILY (col1_0), FAMILY (col1_4, col1_2), FAMILY (col1_3), FAMILY (col1_5), FAMILY (col1_1));
        CREATE TABLE table2 (col2_0 INT8 NOT NULL, col2_1 BOX2D NOT NULL, col2_2 REGTYPE NULL, col2_3 CHAR NOT NULL, col2_4 GEOMETRY NULL, PRIMARY KEY (col2_3 DESC), col2_5 STRING NULL AS (lower(CAST(col2_4 AS STRING))) VIRTUAL);
        CREATE TABLE table3 (col3_0 BYTES NOT NULL, col3_1 REGPROCEDURE NOT NULL, col3_2 INTERVAL NOT NULL, col3_3 REGNAMESPACE NOT NULL, PRIMARY KEY (col3_1 DESC, col3_2 ASC, col3_0 DESC, col3_3), UNIQUE (col3_3 ASC, (CASE WHEN col3_0 IS NULL THEN '2':::STRING ELSE 'J!t&*M(C':::STRING END)), FAMILY (col3_1), FAMILY (col3_3), FAMILY (col3_2, col3_0));
        ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 21, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 100}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 42, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 100}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 72, "histo_buckets": [{"distinct_range": 0, "num_eq": 9000000000, "num_range": 0, "upper_bound": "-22 years -5 mons -407 days -14:01:45.399972"}], "histo_col_type": "INTERVAL", "name": "__auto__", "null_count": 0, "row_count": 100}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 36, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 100}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 37, "histo_col_type": "", "name": "__auto__", "null_count": 23, "row_count": 100}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 20, "histo_buckets": [{"distinct_range": 0, "num_eq": 3739866452548691112, "num_range": 0, "upper_bound": "0"}, {"distinct_range": 0, "num_eq": 5000000000, "num_range": 400000000, "upper_bound": "1135580228"}, {"distinct_range": 200000, "num_eq": 4971064166916507408, "num_range": 200000, "upper_bound": "2181741574"}, {"distinct_range": 971527032361180300, "num_eq": 100, "num_range": 7544256048844037596, "upper_bound": "3065145086"}], "histo_col_type": "OID", "name": "__auto__", "null_count": 0, "row_count": 100}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 53, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 100}]':::JSONB;
        ALTER TABLE table2 INJECT STATISTICS e'[{"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 18, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 20}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 13, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 20}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 15, "histo_col_type": "", "name": "__auto__", "null_count": 13, "row_count": 20}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4, "histo_buckets": [{"distinct_range": 0, "num_eq": 1000, "num_range": 0, "upper_bound": "\\u000b"}, {"distinct_range": 0, "num_eq": 998234323907945732, "num_range": 8806984313358925466, "upper_bound": "\\u000f"}, {"distinct_range": 0, "num_eq": 7705108807096844736, "num_range": 100000000, "upper_bound": "\'"}, {"distinct_range": 0, "num_eq": 7612427603020661042, "num_range": 8915135318356642071, "upper_bound": "0"}, {"distinct_range": 6000, "num_eq": 6054162813428524235, "num_range": 6000, "upper_bound": "8"}, {"distinct_range": 500000000, "num_eq": 0, "num_range": 500000000, "upper_bound": "``"}, {"distinct_range": 51326752058.9138, "num_eq": 100000000, "num_range": 90000000000, "upper_bound": "a"}], "histo_col_type": "CHAR", "name": "__auto__", "null_count": 0, "row_count": 20}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1, "histo_col_type": "", "name": "__auto__", "null_count": 12, "row_count": 20}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 17, "histo_col_type": "", "name": "__auto__", "null_count": 4, "row_count": 20}]':::JSONB;
        ALTER TABLE table3 INJECT STATISTICS '[{"columns": ["col3_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": ["col3_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": ["col3_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": ["col3_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_buckets": [{"distinct_range": 0, "num_eq": 1895154017748594709, "num_range": 0, "upper_bound": "0"}, {"distinct_range": 0, "num_eq": 30000, "num_range": 1776499220111830286, "upper_bound": "1717759637"}], "histo_col_type": "REGPROCEDURE", "name": "__auto__", "null_count": 0, "row_count": 0}]':::JSONB;
        CREATE TYPE rand_typ_0 AS ENUM ('qwktfr', 'qncafx');
        CREATE TYPE rand_typ_1 AS ENUM ('svfl', 'bxmbb', 'dzot');
        CREATE TYPE rand_typ_2 AS ENUM ('teedd', 'hic');
        CREATE TYPE rand_typ_3 AS ENUM ('cz', 'jiyrtv', 'hzm', 'oterls', 'in', 'iuilm');
        CREATE TYPE rand_typ_4 AS ENUM ('qaiv', 'oblwg', 'ksj', 'bwuswm', 'dzy', 'l');
        ;
    rsg_test.go:598: 
        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:600: 
    rsg_test.go:601: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith874981028
--- FAIL: TestRandomSyntaxSQLSmith (300.73s)
Reproduce

To reproduce, try:

make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1
Same failure on other branches

  • #70663 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-master]
  • #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-release-21.1]
Internal log

mjibson marked as alumn{us/a}; resolving to rafiss instead

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity avatar Oct 02 '21 06:10 cockroach-teamcity

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-21.2 @ d1231cff60125b397ccce6c79c9aeea771cdcca4:

Random syntax error:

    rsg_test.go:779: Crash detected: server panic: statement exec timeout

Query:

        SELECT
        	tab_474917.crdb_internal_mvcc_timestamp AS col_1116873,
        	'hello':::greeting AS col_1116874,
        	tab_474925._int4 AS col_1116875,
        	true AS col_1116876,
        	(-852486340):::INT8 AS col_1116877,
        	tab_474921.tableoid AS col_1116878,
        	false AS col_1116879,
        	tab_474917.col2_0 AS col_1116880,
        	tab_474918.col1_2 AS col_1116881,
        	tab_474922.col2_7 AS col_1116882,
        	NULL AS col_1116883,
        	tab_474921.col1_3 AS col_1116884,
        	(tab_474916._jsonb::JSONB - (-2580822234417272631):::INT8::INT8)::JSONB AS col_1116885,
        	tab_474920._bytes AS col_1116886,
        	(-0.2618270814418793):::FLOAT8 AS col_1116887,
        	(-1):::INT8 AS col_1116888,
        	false AS col_1116889,
        	CASE WHEN true THEN (-1):::DECIMAL ELSE (-12.83246674852898043):::DECIMAL END AS col_1116890,
        	tab_474921.col1_1 AS col_1116891,
        	(NULL AND ((tab_474918.col1_2 OR NULL) AND false)) AS col_1116892
        FROM
        	defaultdb.public.seed@[0] AS tab_474916,
        	defaultdb.public.table2@table2_col2_3_col2_1_key AS tab_474917,
        	defaultdb.public.table1 AS tab_474918
        	JOIN defaultdb.public.table1 AS tab_474919 ON
        			(tab_474918.col1_4) = (tab_474919.col1_4) AND (tab_474918.col1_0) = (tab_474919.col1_0)
        	JOIN defaultdb.public.seed@seed__int8__float8__date_idx AS tab_474920 ON
        			(tab_474919.col1_2) = (tab_474920._bool)
        			AND (tab_474919.col1_2) = (tab_474920._bool)
        			AND (tab_474918.col1_2) = (tab_474920._bool)
        	JOIN defaultdb.public.table1@table1_col1_4_col1_2_expr_expr1_col1_1_col1_0_idx AS tab_474921
        		JOIN defaultdb.public.table2@table2_col2_3_col2_7_key AS tab_474922 ON
        				(tab_474921.crdb_internal_idx_expr) = (tab_474922.crdb_internal_mvcc_timestamp)
        				AND (tab_474921.col1_6) = (tab_474922.col2_3)
        		JOIN defaultdb.public.seed AS tab_474923
        			JOIN defaultdb.public.seed AS tab_474924 ON (tab_474923._jsonb) = (tab_474924._jsonb) ON
        				(tab_474922.col2_6) = (tab_474923._jsonb)
        		JOIN defaultdb.public.seed@[0] AS tab_474925 ON
        				(tab_474922.col2_5) = (tab_474925._int8) AND (tab_474922.col2_5) = (tab_474925._int2) ON
        			(tab_474918.col1_2) = (tab_474925._bool)
        ORDER BY
        	tab_474920._bytes DESC;

Schema:

    rsg_test.go:596: To reproduce, use schema:
    rsg_test.go:598: 
        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 DECIMAL NULL, col1_2 BOOL NOT NULL, col1_3 REGPROC NULL, col1_4 TIME NOT NULL, col1_5 UUID, col1_6 FLOAT4 NOT NULL, PRIMARY KEY (col1_0 DESC, col1_2 DESC), UNIQUE (col1_2 ASC) WHERE ((((NOT table1.col1_2) AND (table1.col1_4 < '00:00:00':::TIME)) OR (table1.col1_6 = 1.0:::FLOAT8)) AND (table1.col1_1 >= 1:::DECIMAL)) AND (table1.col1_0 = (-1.234E+401):::DECIMAL), INDEX (col1_4 DESC, col1_2, (col1_1 + 1.5767933331935852E+27:::DECIMAL) DESC, (col1_1 + col1_0), col1_1 ASC, col1_0 DESC), INDEX (col1_1 DESC, col1_5, col1_2, col1_3) STORING (col1_6));
        CREATE TABLE table2 (col2_0 TIMESTAMPTZ NOT NULL, col2_1 VARCHAR, col2_2 GEOMETRY NOT NULL, col2_3 FLOAT4, col2_4 OID, col2_5 INT4 NOT NULL, col2_6 JSONB, col2_7 STRING AS (lower(col2_1)) VIRTUAL, UNIQUE (col2_3, col2_1) STORING (col2_5) WHERE ((((table2.col2_3 <= 0.0:::FLOAT8) OR (table2.col2_1 >= e'\U00002603':::STRING)) OR (table2.col2_5 = (-32768):::INT8)) AND (table2.col2_0 = '-4713-11-24 00:00:00+00:00':::TIMESTAMPTZ)) AND (table2.col2_7 != 'X':::STRING), UNIQUE (col2_3 DESC, col2_7 ASC) WHERE ((((table2.col2_0 < '294276-12-31 23:59:59.999999+00:00':::TIMESTAMPTZ) OR (table2.col2_3 >= '+Inf':::FLOAT8)) AND (table2.col2_5 <= 1:::INT8)) OR (table2.col2_7 < 'X':::STRING)) AND (table2.col2_1 > '':::STRING), UNIQUE (col2_7 DESC, col2_3 DESC, col2_4 DESC) STORING (col2_0) WHERE ((((table2.col2_1 != e'\x00':::STRING) OR (table2.col2_5 <= (-2147483648):::INT8)) OR (table2.col2_0 != '3000-01-01 00:00:00+00:00':::TIMESTAMPTZ)) OR (table2.col2_7 < e'\U00002603':::STRING)) OR (table2.col2_3 >= '+Inf':::FLOAT8));
        ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7002081829047416, "histo_col_type": "", "name": "__auto__", "null_count": 1461438007032914033, "row_count": 1540032416910514551}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 854261807122353658, "histo_buckets": [{"distinct_range": 0, "num_eq": 8983350383760101798, "num_range": 0, "upper_bound": "02:09:54.557247"}, {"distinct_range": 0, "num_eq": 10000000000, "num_range": 800000, "upper_bound": "02:48:13.815446"}, {"distinct_range": 0, "num_eq": 6477585829767813531, "num_range": 0, "upper_bound": "04:00:44.494243"}, {"distinct_range": 442387.74959486397, "num_eq": 4270929946447287347, "num_range": 5000000, "upper_bound": "06:27:34.830159"}, {"distinct_range": 0, "num_eq": 5683837026133422778, "num_range": 0, "upper_bound": "13:25:08.961376"}, {"distinct_range": 600, "num_eq": 1029997970911447051, "num_range": 600, "upper_bound": "14:32:28.536402"}, {"distinct_range": 0, "num_eq": 8440057026025199209, "num_range": 7000, "upper_bound": "18:27:04.384669"}, {"distinct_range": 3812107615738814500, "num_eq": 100, "num_range": 9200449585732210628, "upper_bound": "20:35:13.177774"}], "histo_col_type": "TIME", "name": "__auto__", "null_count": 0, "row_count": 1540032416910514551}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 660734717349934194, "histo_col_type": "", "name": "__auto__", "null_count": 1389277690912010084, "row_count": 1540032416910514551}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 11937436502434490, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1540032416910514551}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 236866018190864855, "histo_buckets": [{"distinct_range": 0, "num_eq": 3284998087392097595, "num_range": 0, "upper_bound": "2.965675533790395698E+24"}], "histo_col_type": "DECIMAL", "name": "__auto__", "null_count": 0, "row_count": 1540032416910514551}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6024438554852614, "histo_buckets": [{"distinct_range": 0, "num_eq": 400000, "num_range": 0, "upper_bound": "NaN"}, {"distinct_range": 0, "num_eq": 400, "num_range": 900000000, "upper_bound": "-3.227084480446109953E+32"}, {"distinct_range": 4680477068002867000, "num_eq": 80000000000, "num_range": 5553948804413050605, "upper_bound": "8.674971178976198132E+23"}], "histo_col_type": "DECIMAL", "name": "__auto__", "null_count": 236128324928426061, "row_count": 1540032416910514551}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 26342931969173055, "histo_col_type": "BOOL", "name": "__auto__", "null_count": 0, "row_count": 1540032416910514551}]':::JSONB;
        ALTER TABLE table2 INJECT STATISTICS e'[{"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1010233751415015483, "histo_col_type": "", "name": "__auto__", "null_count": 1395751191164002218, "row_count": 4346140824301751532}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1343273929370343820, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4346140824301751532}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2671607402705092379, "histo_col_type": "", "name": "__auto__", "null_count": 3774178270115277341, "row_count": 4346140824301751532}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1783221346199509628, "histo_buckets": [{"distinct_range": 0, "num_eq": 300000000, "num_range": 0, "upper_bound": ""}, {"distinct_range": 7000000000, "num_eq": 325116144530364250, "num_range": 7000000000, "upper_bound": "\\u0000"}, {"distinct_range": 67798.22273555992, "num_eq": 7000, "num_range": 100000, "upper_bound": "W\\\\\\u00031Begm\\u0003"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 929796939451546864, "row_count": 4346140824301751532}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4250300423195924014, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4346140824301751532}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1703906101189267525, "histo_col_type": "", "name": "__auto__", "null_count": 2803109595013243671, "row_count": 4346140824301751532}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3382909146606824575, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4346140824301751532}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 434941091837854265, "histo_buckets": [{"distinct_range": 0, "num_eq": 10000000, "num_range": 0, "upper_bound": "-1.143502950668335"}, {"distinct_range": 1331336372637441000, "num_eq": 700000000, "num_range": 1331336372637440905, "upper_bound": "-0.8597836494445801"}, {"distinct_range": 2706533152469398500, "num_eq": 741476009892837450, "num_range": 2706533152469398384, "upper_bound": "0.9555513262748718"}], "histo_col_type": "FLOAT4", "name": "__auto__", "null_count": 4004555729570180805, "row_count": 4346140824301751532}]':::JSONB;
        CREATE TYPE rand_typ_0 AS ENUM ('wbahpp', 'yo', 'ozoin', 'vvezjr', 'kmn');
        CREATE TYPE rand_typ_1 AS ENUM ('chqy', 'fbezx', 't');
        CREATE TYPE rand_typ_2 AS ENUM ('lvrdyf', 'wdlsto', 'hjmtl', 'ffyn', 'f');
        CREATE TYPE rand_typ_3 AS ENUM ('l', 'tm', 'lzdub', 'ayojik');
        CREATE TYPE rand_typ_4 AS ENUM ('ad', 'p', 'llidta');
        ;
    rsg_test.go:598: 
        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:600: 
    rsg_test.go:601: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith994771827
--- FAIL: TestRandomSyntaxSQLSmith (355.31s)
Reproduce

To reproduce, try:

make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1
Same failure on other branches

  • #70663 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-master]
  • #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-release-21.1]
Internal log

mjibson marked as alumn{us/a}; resolving to rafiss instead

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity avatar Oct 03 '21 05:10 cockroach-teamcity

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-21.2 @ bd00c351494b44b31178350e79c72244c93ea224:

Random syntax error:

    rsg_test.go:779: Crash detected: server panic: statement exec timeout

Query:

        WITH
        	with_149409 (col_857582)
        		AS (
        			SELECT
        				*
        			FROM
        				(
        					VALUES
        						(ARRAY[B'01001010001001101001011001010111',B'01100111110011110010001101100111']),
        						(
        							ARRAY[B'01110010100101111000111100100101',B'00011111000001010001000001100101',B'00110110110000111000100001011010',B'00001010111011111011111000001101']
        						),
        						(
        							ARRAY[B'00000110000000101000100001101101',B'00000000000000000000000000000000',B'00110001001011110100101010111100',B'10000011100000101011001110000110',B'11010010011101001101011010111010']
        						),
        						(ARRAY[B'00110001101010001000010000100001']),
        						(NULL),
        						(
        							(
        								SELECT
        									COALESCE(
        										ARRAY[]:::BIT(32)[],
        										ARRAY[B'11010001001110101111001000111101',B'11000111011100101011100110000000',B'01100000011001101001001001010100',B'11101110101110100010111101100010',B'10101011010001011010100010110100',B'10010010010001010101010000001000',B'00000000000000000000000000000000']
        									)
        										AS col_857581
        								FROM
        									defaultdb.public.table1@[0] AS tab_365438
        								WHERE
        									NULL
        								ORDER BY
        									tab_365438.col1_1 ASC, tab_365438.tableoid
        								LIMIT
        									1:::INT8
        							)
        						)
        				)
        					AS tab_365439 (col_857582)
        		)
        SELECT
        	tab_365443.col3_6 AS col_857583, tab_365449.col1_5 AS col_857584
        FROM
        	defaultdb.public.seed@[0] AS tab_365440
        	JOIN defaultdb.public.table2@primary AS tab_365441
        		JOIN defaultdb.public.table3@[0] AS tab_365442 ON (tab_365441.crdb_internal_idx_expr) = (tab_365442.col3_1)
        		JOIN defaultdb.public.table3@[0] AS tab_365443
        			JOIN defaultdb.public.table2@[0] AS tab_365444
        				CROSS JOIN defaultdb.public.seed@seed__int8__float8__date_idx AS tab_365445
        					JOIN defaultdb.public.seed@seed__int8__float8__date_idx AS tab_365446
        						JOIN defaultdb.public.table1@table1_col1_2_col1_5_col1_3_col1_1_col1_0_idx AS tab_365447 ON
        								(tab_365446.crdb_internal_mvcc_timestamp) = (tab_365447.crdb_internal_mvcc_timestamp)
        								AND (tab_365446._string) = (tab_365447.crdb_internal_idx_expr)
        						JOIN defaultdb.public.table3@[0] AS tab_365448
        							CROSS JOIN defaultdb.public.table1@[0] AS tab_365449 ON
        								(tab_365447.crdb_internal_mvcc_timestamp) = (tab_365449.crdb_internal_mvcc_timestamp) ON
        							st_crosses('010200004008000000910287AAB870F8C14E93450BD063FDC1ACA596DB08EFFF414237F3CA19C0E3C1D08E6C788040FCC1B806DD124EB8D6C140BE8A50B1BDBEC142BB5C736B70F0C1ACAE673EF981F8C11089F9760E82E5416ADAFFC01D5FF4C171399588EA1001C26EF1F376939EF94178E0E1D7E6F5FAC1B556D5CD9B6901C200CF304555ADD541168163DEE9B2EFC16E5D4E5E4586014214EDB3352D4D00C21CF9E4ADD42800423042953DFEB40042BEA6B1586DCAFFC1AA91EF3DFFF7F441845C7A9F807AF741':::GEOMETRY::GEOMETRY, st_buffer(st_addpoint('01010000000088F4413605FC41E04C22592E61BD41':::GEOMETRY::GEOMETRY, '01060000400300000001030000400100000006000000F83B6C64FEF3D9C196FBCB1BDD2A01C21A7B51305EE400C24E76D373CE50F64196AA7A7828B6E5C153FF398EDE86F9C1BEC996E80D0CF041A04DFA486162BB41709C65AB6556EFC1EECC3BD84365FCC1B4238795D847E141B6C9940E1EACF941C503FD9945F401C22473DDF784DEE841A43A4C5164F4E641F83B6C64FEF3D9C196FBCB1BDD2A01C21A7B51305EE400C201030000400100000006000000808E53F443E6D3C1A029CD14043BBDC14CBB61571275F0414C9A33DEFDC9FA414843125FD12CFCC19EBD4640F118F941307CAA61E251DC41D8B103784E4BE941BCB9436B671EEA41E097639A26D2C341A05C0E339883EB412E31AB8A980EF6414EE2A9F4AF7C00C200CA43BB518275C194DF536386CEF3C1808E53F443E6D3C1A029CD14043BBDC14CBB61571275F0410103000040010000000800000073431A72830AF4C1ECE9A9A796F7F2C1B06F6C48CED4C2C184B170DE8DE7E7C1B72ABEF1115002C23E093676332BFCC140E07B5474D6C3C161406AD1F023FDC16C12AD7F5227E14130FD46A4AC1AD34144B7BC139AE6D9C1FF7570CDA2DF01C250CFE1156DE3E1C100DCCE4EA01666C19862181BE92FD841E128C2928F9AF0C13ECFF7A101C5F941DC4011BC4AC6FA414BC10A8EE43C02C21470D1F367FA0042285951361BF4FBC173431A72830AF4C1ECE9A9A796F7F2C1B06F6C48CED4C2C1':::GEOMETRY::GEOMETRY)::GEOMETRY::GEOMETRY, (-2681633468098802880):::INT8::INT8)::GEOMETRY::GEOMETRY)::BOOL ON
        					(tab_365443.col3_9) = (tab_365449.col1_4) ON
        				(tab_365441.crdb_internal_idx_expr) = (tab_365444.col2_5)
        				AND (tab_365442.col3_3) = (tab_365445.tableoid)
        				AND (tab_365441.col2_6) = (tab_365445._string)
        				AND (tab_365442.col3_10) = (tab_365449.col1_4)
        				AND (tab_365442.col3_10) = (tab_365446._string) ON (tab_365440._date) = (tab_365446._date)
        WHERE
        	tab_365445._bool;

Schema:

    rsg_test.go:596: To reproduce, use schema:
    rsg_test.go:598: 
        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 NOT NULL, col1_1 STRING NOT NULL, col1_2 INTERVAL NOT NULL, col1_3 REGCLASS NOT NULL, PRIMARY KEY (col1_1, col1_2 DESC, col1_3, col1_0 ASC), col1_4 STRING NOT NULL AS (lower(CAST(col1_2 AS STRING))) STORED, col1_5 INT4 NOT NULL AS (col1_0 + 2040840829:::INT8) VIRTUAL, UNIQUE (col1_4 ASC, col1_5 ASC, col1_3 ASC), INDEX (col1_2 ASC) STORING (col1_4), UNIQUE (col1_4, col1_3 DESC, col1_1 ASC, col1_2, col1_0, col1_5) WHERE ((table1.col1_4 <= 'X':::STRING) OR (table1.col1_0 = (-2147483648):::INT8)) AND (table1.col1_5 = (-2147483648):::INT8), INDEX (col1_2 DESC, col1_3), INDEX (col1_2 ASC, col1_5 DESC, col1_3, col1_1, col1_0 DESC) STORING (col1_4) WHERE (((table1.col1_4 >= '"':::STRING) OR (table1.col1_1 < e'\x00':::STRING)) OR (table1.col1_5 < 2147483647:::INT8)) AND (table1.col1_0 < (-1):::INT8), INDEX (col1_3, lower(col1_1) DESC, col1_5 DESC, col1_0, col1_1 DESC, col1_2 ASC), FAMILY (col1_2), FAMILY (col1_1, col1_0), FAMILY (col1_3, col1_4));
        CREATE TABLE table2 (col2_0 BIT(7) NOT NULL, col2_1 FLOAT4, col2_2 NAME, col2_3 INT8, PRIMARY KEY (col2_0 ASC), col2_4 STRING NOT NULL AS (lower(CAST(col2_0 AS STRING))) STORED, col2_5 STRING NOT NULL AS (lower(CAST(col2_0 AS STRING))) VIRTUAL, col2_6 STRING NOT NULL AS (lower(CAST(col2_0 AS STRING))) STORED, INDEX (col2_1, col2_0, col2_3 ASC) STORING (col2_4, col2_6), UNIQUE (col2_0) WHERE (table2.col2_6 = e'\'':::STRING) AND (table2.col2_1 > '+Inf':::FLOAT8), UNIQUE (col2_0 DESC, col2_4, col2_1 DESC, col2_6, col2_3 DESC, col2_5 DESC, col2_2 ASC), UNIQUE (lower(CAST(col2_0 AS STRING)) DESC, col2_0, col2_1, col2_6 ASC, col2_4 ASC) WHERE ((table2.col2_5 < 'X':::STRING) OR (table2.col2_4 = '':::STRING)) AND (table2.col2_1 = 1.401298464324817e-45:::FLOAT8), INDEX (col2_3, col2_1 ASC) STORING (col2_2) WHERE (table2.col2_6 <= e'\x00':::STRING) OR (table2.col2_3 > 0:::INT8));
        CREATE TABLE table3 (col3_0 DECIMAL[], col3_1 VARCHAR NOT NULL, col3_2 TIME NOT NULL, col3_3 OID NOT NULL, col3_4 GEOGRAPHY NOT NULL, col3_5 INT4 NULL, col3_6 INT4 NULL AS (col3_5 + 1497258215:::INT8) VIRTUAL, col3_7 STRING NOT NULL AS (lower(CAST(col3_3 AS STRING))) STORED, col3_8 STRING AS (CASE WHEN col3_0 IS NULL THEN e'2[\x17':::STRING ELSE e'um\x07f':::STRING END) VIRTUAL, col3_9 STRING NOT NULL AS (lower(CAST(col3_4 AS STRING))) STORED, col3_10 STRING NOT NULL AS (lower(CAST(col3_2 AS STRING))) VIRTUAL, FAMILY (col3_7), FAMILY (col3_3, col3_9), FAMILY (col3_5, col3_4), FAMILY (col3_2), FAMILY (col3_0, col3_1));
        CREATE TABLE table4 (col4_0 INT4, col4_1 OID NOT NULL, col4_2 GEOMETRY NOT NULL, col4_3 JSONB NOT NULL, col4_4 BOX2D NULL, col4_5 REGPROCEDURE, col4_6 UUID NULL, col4_7 TIMESTAMPTZ, col4_8 BIT(33), col4_9 STRING AS (CASE WHEN col4_7 IS NULL THEN e'[g\x1d+\x17':::STRING ELSE e'+)7;&\x11W[':::STRING END) VIRTUAL, col4_10 STRING AS (lower(CAST(col4_8 AS STRING))) VIRTUAL, col4_11 STRING NOT NULL AS (lower(CAST(col4_3 AS STRING))) STORED, INDEX (col4_11 DESC, col4_4 DESC, col4_0 DESC, col4_5 ASC) STORING (col4_6, col4_8));
        ALTER TABLE table1 INJECT STATISTICS e'[{"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1822, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2000}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1112, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2000}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 380, "histo_buckets": [{"distinct_range": 0, "num_eq": 50000, "num_range": 0, "upper_bound": "24 years 1 mon 423 days 19:57:08.466674"}, {"distinct_range": 3767509576239656400, "num_eq": 200000000, "num_range": 3767509576239656477, "upper_bound": "67 years 10 mons 413 days 01:08:34.943544"}], "histo_col_type": "INTERVAL", "name": "__auto__", "null_count": 0, "row_count": 2000}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1467, "histo_col_type": "REGCLASS", "name": "__auto__", "null_count": 0, "row_count": 2000}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 607, "histo_buckets": [{"distinct_range": 0, "num_eq": 900000000, "num_range": 0, "upper_bound": "\\u0008w\\\\{*"}, {"distinct_range": 288.5439476364412, "num_eq": 40000000000, "num_range": 500, "upper_bound": "\\u000e\\ny^J\\n}#Q"}, {"distinct_range": 5959.331788211501, "num_eq": 60000000, "num_range": 7000, "upper_bound": "@O"}, {"distinct_range": 4023668472294466000, "num_eq": 300000, "num_range": 4807682979325109392, "upper_bound": "e_\\u0001"}, {"distinct_range": 458744572835817.2, "num_eq": 256024752987273530, "num_range": 681395615747306, "upper_bound": "qIR\\u0005\\u000cr``"}, {"distinct_range": 8381265139097525000, "num_eq": 0, "num_range": 8381265139097525677, "upper_bound": "yU\\u0004\\r@\\u0005``"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 0, "row_count": 2000}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1511, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2000}]':::JSONB;
        ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 44712423522239053, "histo_col_type": "BIT(7)", "name": "__auto__", "null_count": 0, "row_count": 187166733893121143}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 42495644609589700, "histo_col_type": "", "name": "__auto__", "null_count": 6236736760687663, "row_count": 187166733893121143}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 130522849500660531, "histo_col_type": "", "name": "__auto__", "null_count": 92973923610567220, "row_count": 187166733893121143}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 147338300093620628, "histo_buckets": [{"distinct_range": 0, "num_eq": 100000000, "num_range": 0, "upper_bound": "-9095176255703432305"}, {"distinct_range": 0, "num_eq": 715371316108854298, "num_range": 10000000000, "upper_bound": "-4215901109105660651"}, {"distinct_range": 0, "num_eq": 1511890756963603050, "num_range": 3402731478706242548, "upper_bound": "-1401645062748416523"}, {"distinct_range": 0, "num_eq": 3328258030877047700, "num_range": 3589787575415070696, "upper_bound": "-996052345997831713"}, {"distinct_range": 0, "num_eq": 7000000000, "num_range": 5788065024974598055, "upper_bound": "-320644446150130214"}, {"distinct_range": 2698378992904698400, "num_eq": 700000000, "num_range": 2957462528741896559, "upper_bound": "2024697537243709140"}, {"distinct_range": 6394978736359291000, "num_eq": 800000000, "num_range": 6394978736359290878, "upper_bound": "2507928332169415527"}, {"distinct_range": 3106955747893400000, "num_eq": 7455665838531045606, "num_range": 3106955747893400073, "upper_bound": "4679347932660808189"}], "histo_col_type": "INT8", "name": "__auto__", "null_count": 61100325379275872, "row_count": 187166733893121143}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 13269608533437595, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 187166733893121143}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 98083588208053232, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 187166733893121143}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 38762643332963239, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 187166733893121143}]':::JSONB;
        ALTER TABLE table3 INJECT STATISTICS '[{"columns": ["col3_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 934001392384012818, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2351571047008131214}, {"columns": ["col3_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1435322701540025337, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2351571047008131214}, {"columns": ["col3_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1210333729149014207, "histo_col_type": "", "name": "__auto__", "null_count": 1909501370428319821, "row_count": 2351571047008131214}, {"columns": ["col3_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1193867459598532655, "histo_col_type": "", "name": "__auto__", "null_count": 488408331913157669, "row_count": 2351571047008131214}, {"columns": ["col3_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 248624760609337051, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2351571047008131214}, {"columns": ["col3_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1156341645647619876, "histo_col_type": "", "name": "__auto__", "null_count": 490968042749513729, "row_count": 2351571047008131214}, {"columns": ["col3_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2270309904986287664, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2351571047008131214}, {"columns": ["col3_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1112662333638674561, "histo_col_type": "", "name": "__auto__", "null_count": 455435425728093929, "row_count": 2351571047008131214}, {"columns": ["col3_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1883775912260238473, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2351571047008131214}, {"columns": ["col3_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2127385077938432465, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2351571047008131214}, {"columns": ["col3_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 245518169039219250, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2351571047008131214}]':::JSONB;
        ALTER TABLE table4 INJECT STATISTICS e'[{"columns": ["col4_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 853829262866262659, "histo_col_type": "", "name": "__auto__", "null_count": 3030141993068456216, "row_count": 6675419786313503774}, {"columns": ["col4_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3844591902130283097, "histo_col_type": "", "name": "__auto__", "null_count": 3214639682520195098, "row_count": 6675419786313503774}, {"columns": ["col4_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6574561480173942817, "histo_col_type": "", "name": "__auto__", "null_count": 6310885705253758209, "row_count": 6675419786313503774}, {"columns": ["col4_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3888615247001057968, "histo_col_type": "", "name": "__auto__", "null_count": 4486557068529487787, "row_count": 6675419786313503774}, {"columns": ["col4_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2914007517584137568, "histo_col_type": "", "name": "__auto__", "null_count": 4951928056581450989, "row_count": 6675419786313503774}, {"columns": ["col4_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5793069464160186391, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6675419786313503774}, {"columns": ["col4_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 908575792491932889, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6675419786313503774}, {"columns": ["col4_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1387799044985909055, "histo_col_type": "", "name": "__auto__", "null_count": 5673249650262556543, "row_count": 6675419786313503774}, {"columns": ["col4_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2708968254445981886, "histo_buckets": [{"distinct_range": 0, "num_eq": 6000, "num_range": 0, "upper_bound": "\\u0000"}, {"distinct_range": 0, "num_eq": 8068903056088113685, "num_range": 300000, "upper_bound": "\\u0003\\u001b."}, {"distinct_range": 2865842573281882600, "num_eq": 300000000, "num_range": 3790615568458788988, "upper_bound": "\\u0010\\u000f\\u0001M\\u000c"}, {"distinct_range": 10000000, "num_eq": 100000, "num_range": 10000000, "upper_bound": "\\""}, {"distinct_range": 86811737834226460, "num_eq": 9156471808489515015, "num_range": 554221554612898600, "upper_bound": "%ra"}, {"distinct_range": 0, "num_eq": 5000000000, "num_range": 800000, "upper_bound": "3\x7f\\"q-|ww"}, {"distinct_range": 0, "num_eq": 2850159927432165950, "num_range": 3318424173933264982, "upper_bound": "RU?p"}, {"distinct_range": 858747.5214404494, "num_eq": 60, "num_range": 2000000, "upper_bound": "U,\\u001a-"}, {"distinct_range": 10000000, "num_eq": 800000000, "num_range": 10000000, "upper_bound": "VfHCw"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 0, "row_count": 6675419786313503774}, {"columns": ["col4_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6349279140296703067, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6675419786313503774}, {"columns": ["col4_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 772193179476063342, "histo_col_type": "", "name": "__auto__", "null_count": 1806008236439805982, "row_count": 6675419786313503774}, {"columns": ["col4_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3259183800175570706, "histo_col_type": "", "name": "__auto__", "null_count": 1820504744056273578, "row_count": 6675419786313503774}]':::JSONB;
        CREATE TYPE rand_typ_0 AS ENUM ('irrp', 'lg');
        CREATE TYPE rand_typ_1 AS ENUM ('vtqyy', 'v', 'wbp', 'iqp', 'smxwd');
        CREATE TYPE rand_typ_2 AS ENUM ('pd', 'hq');
        CREATE TYPE rand_typ_3 AS ENUM ('nuxxp', 'jicyyp', 'rfcz');
        ;
    rsg_test.go:598: 
        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:600: 
    rsg_test.go:601: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith419762952
--- FAIL: TestRandomSyntaxSQLSmith (300.85s)
Reproduce

To reproduce, try:

make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1
Same failure on other branches

  • #70663 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-master]
  • #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-release-21.1]
Internal log

mjibson marked as alumn{us/a}; resolving to rafiss instead

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity avatar Oct 04 '21 05:10 cockroach-teamcity

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-21.2 @ e67cf963427faf93670a4c87e0d02bc0ef213b1d:

Random syntax error:

    rsg_test.go:779: Crash detected: server panic: statement exec timeout

Query:

        SELECT
        	'0001-01-01 00:00:00+00:00':::TIMESTAMPTZ AS col_875136
        FROM
        	defaultdb.public.table4@[0] AS tab_371781,
        	defaultdb.public.table1 AS tab_371782
        	JOIN defaultdb.public.table1 AS tab_371783 ON
        			(tab_371782.col1_14) = (tab_371783.col1_14)
        			AND (tab_371782.col1_6) = (tab_371783.col1_6)
        			AND (tab_371782.col1_13) = (tab_371783.col1_13)
        	JOIN defaultdb.public.table3 AS tab_371784
        		JOIN defaultdb.public.table4 AS tab_371785 ON (tab_371784.col3_1) = (tab_371785.col4_2)
        		CROSS JOIN defaultdb.public.table1@table1_col1_11_expr_col1_7_expr1_col1_13_col1_14_col1_15_col1_17_key
        				AS tab_371786
        		JOIN defaultdb.public.table5@table5_col5_4_col5_1_key AS tab_371787
        			JOIN defaultdb.public.table3 AS tab_371788
        				JOIN defaultdb.public.table2 AS tab_371789 ON (tab_371788.col3_1) = (tab_371789.col2_13) ON
        					(tab_371787.col5_3) = (tab_371789.col2_13) ON
        				(tab_371786.tableoid) = (tab_371787.col5_3)
        				AND (tab_371785.col4_2) = (tab_371788.col3_1)
        				AND (tab_371786.col1_3) = (tab_371787.crdb_internal_idx_expr) ON
        			(tab_371782.col1_4) = (tab_371786.col1_4)
        			AND (tab_371783.col1_4) = (tab_371786.col1_4)
        			AND (tab_371782.col1_4) = (tab_371786.col1_4)
        			AND (tab_371783.col1_4) = (tab_371786.col1_4)
        WHERE
        	(NOT EXISTS (SELECT 1.3458421230316162:::FLOAT8 AS col_875135 FROM defaultdb.public.table5@[0] AS tab_371790, defaultdb.public.table3@table3_col3_4_col3_3_col3_2_col3_0_col3_14_col3_12_col3_15_col3_13_key AS tab_371791, defaultdb.public.table2@table2_col2_4_col2_3_col2_0_idx AS tab_371792 WHERE NULL::DECIMAL NOT IN (WITH with_152575 (col_875131) AS (SELECT * FROM (VALUES (B'1110101111110011000111000110'), (B'0100010100101110010001010011')) AS tab_371793 (col_875131)), with_152576 (col_875132) AS (SELECT * FROM (VALUES (false)) AS tab_371794 (col_875132)), with_152577 (col_875133) AS (SELECT * FROM (VALUES ('01040000A0E6100000020000000101000080B0473838434551402CD81A24D77653C040A904199272E6C10101000080C0DB95954C1616C0DBC22AAB73E452C070ABB557224CEA41':::GEOGRAPHY), ('0105000020E610000000000000':::GEOGRAPHY)) AS tab_371795 (col_875133)) SELECT tab_371792.col2_17::DECIMAL AS col_875134 FROM defaultdb.public.table1@[0] AS tab_371796 WHERE tab_371796.col1_16 LIMIT 8:::INT8) ORDER BY tab_371790.crdb_internal_mvcc_timestamp DESC, tab_371792.col2_3 ASC, tab_371792.col2_11 ASC LIMIT 31:::INT8))
        GROUP BY
        	tab_371783.col1_4
        LIMIT
        	72:::INT8;

Schema:

    rsg_test.go:596: To reproduce, use schema:
    rsg_test.go:598: 
        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 INTERVAL NULL, col1_1 JSONB, col1_2 FLOAT8 NOT NULL, col1_3 CHAR NULL, col1_4 TIMESTAMPTZ NOT NULL, col1_5 REGNAMESPACE NOT NULL, col1_6 JSONB NOT NULL, col1_7 FLOAT4 NULL, col1_8 INT8 NULL, col1_9 REGCLASS, col1_10 DATE NOT NULL, col1_11 TIMESTAMP NULL, col1_12 BIT(31) NOT NULL, col1_13 INET, col1_14 NAME, col1_15 BYTES NULL, col1_16 BOOL NOT NULL, col1_17 STRING NOT NULL AS (lower(CAST(col1_16 AS STRING))) STORED, UNIQUE (col1_11 DESC, lower(col1_14) DESC, col1_7, (col1_7 + (-0.5280987024307251):::FLOAT8), col1_13 ASC, col1_14, col1_15 DESC, col1_17 ASC), INVERTED INDEX (col1_14 DESC, col1_4, lower(CAST(col1_1 AS STRING)) ASC, col1_13 ASC, col1_6 ASC));
        CREATE TABLE table2 (col2_0 STRING NOT NULL, col2_1 GEOMETRY, col2_2 FLOAT4 NULL, col2_3 DECIMAL NOT NULL, col2_4 FLOAT4, col2_5 INTERVAL NULL, col2_6 GEOGRAPHY, col2_7 JSONB NULL, col2_8 TIMESTAMP NOT NULL, col2_9 INT4 NULL, col2_10 "char" NULL, col2_11 FLOAT8 NOT NULL, col2_12 BOX2D, col2_13 REGNAMESPACE NULL, col2_14 BIT(28), col2_15 INTERVAL NULL, col2_16 FLOAT4 NULL AS ((col2_2 + col2_11) + col2_4) STORED, col2_17 DECIMAL NOT NULL AS (col2_3 + (-1):::DECIMAL) VIRTUAL, UNIQUE (col2_13, col2_4 ASC, col2_14 ASC, col2_16 ASC, col2_12, col2_0 ASC) STORING (col2_1, col2_2, col2_3, col2_5, col2_6, col2_10, col2_11) WHERE (((((((((table2.col2_0 != '':::STRING) AND (table2.col2_9 != 32767:::INT8)) OR (table2.col2_10 <= '':::STRING)) OR (table2.col2_3 > 0:::DECIMAL)) AND (table2.col2_2 <= 1.401298464324817e-45:::FLOAT8)) OR (table2.col2_8 != '-2000-01-01 00:00:00':::TIMESTAMP)) AND (table2.col2_4 = 1.0:::FLOAT8)) OR (table2.col2_11 >= 1.7976931348623157e+308:::FLOAT8)) AND (table2.col2_16 <= 1.401298464324817e-45:::FLOAT8)) AND (table2.col2_17 = 'NaN':::DECIMAL), INDEX (col2_4, col2_3 DESC, col2_0 ASC) STORING (col2_5, col2_7, col2_8, col2_9, col2_10, col2_13), FAMILY (col2_16, col2_2, col2_14, col2_3), FAMILY (col2_6, col2_10, col2_1), FAMILY (col2_7), FAMILY (col2_13, col2_0, col2_11), FAMILY (col2_5), FAMILY (col2_15, col2_4, col2_12), FAMILY (col2_9, col2_8));
        CREATE TABLE table3 (col3_0 BIT(34) NOT NULL, col3_1 REGCLASS NOT NULL, col3_2 TIMESTAMP NOT NULL, col3_3 INT2, col3_4 INET NULL, col3_5 CHAR, col3_6 BYTES NOT NULL, col3_7 STRING, col3_8 GEOMETRY, col3_9 GEOMETRY NOT NULL, col3_10 BYTES NOT NULL, col3_11 INET NULL, col3_12 FLOAT4 NOT NULL, col3_13 DATE NOT NULL, col3_14 STRING NOT NULL AS (CASE WHEN col3_6 IS NULL THEN '':::STRING ELSE 'M':::STRING END) VIRTUAL, col3_15 STRING NULL AS (lower(CAST(col3_4 AS STRING))) VIRTUAL, INVERTED INDEX (col3_2 ASC, col3_10 DESC, col3_0 DESC, col3_15 ASC, col3_9 DESC) WHERE (((((((((table3.col3_5 <= e'\x00':::STRING) OR (table3.col3_13 <= '-infinity':::DATE)) OR (table3.col3_7 <= e'\'':::STRING)) OR (table3.col3_10 > '\x27':::BYTES)) OR (table3.col3_2 <= '0001-01-01 00:00:00':::TIMESTAMP)) AND (table3.col3_15 >= '"':::STRING)) AND (table3.col3_6 = '\x00':::BYTES)) AND (table3.col3_3 < 127:::INT8)) OR (table3.col3_12 < 1.0:::FLOAT8)) OR (table3.col3_14 = '':::STRING), UNIQUE (col3_4 ASC, col3_3 DESC, col3_2 ASC, col3_0, col3_14 ASC, col3_12, col3_15, col3_13 DESC) WHERE (((((((((table3.col3_12 >= 'NaN':::FLOAT8) AND (table3.col3_5 > 'X':::STRING)) OR (table3.col3_2 >= '3000-01-01 00:00:00':::TIMESTAMP)) OR (table3.col3_15 < 'X':::STRING)) OR (table3.col3_3 = (-128):::INT8)) AND (table3.col3_7 != '"':::STRING)) OR (table3.col3_13 != '-infinity':::DATE)) OR (table3.col3_10 < '\x22':::BYTES)) AND (table3.col3_14 <= '"':::STRING)) OR (table3.col3_6 <= '\x22':::BYTES), INDEX (col3_1 ASC, col3_11, col3_10, col3_0 DESC) WHERE (((((((((table3.col3_5 > e'\U00002603':::STRING) OR (table3.col3_15 != 'X':::STRING)) OR (table3.col3_13 != 'infinity':::DATE)) OR (table3.col3_10 < '\x':::BYTES)) AND (table3.col3_7 < '':::STRING)) AND (table3.col3_6 > '\x':::BYTES)) AND (table3.col3_12 > 1.401298464324817e-45:::FLOAT8)) AND (table3.col3_2 >= '-4713-11-24 00:00:00':::TIMESTAMP)) OR (table3.col3_14 > 'X':::STRING)) OR (table3.col3_3 < 32767:::INT8), INDEX (col3_15 ASC, col3_5 ASC, col3_13) STORING (col3_1, col3_2, col3_3, col3_4, col3_7, col3_9) WHERE (((((table3.col3_6 >= '\x22':::BYTES) AND (table3.col3_13 < '-infinity':::DATE)) OR (table3.col3_5 = e'\U00002603':::STRING)) OR (table3.col3_12 != 3.4028234663852886e+38:::FLOAT8)) OR (table3.col3_10 = '\x00':::BYTES)) OR (table3.col3_15 = e'\'':::STRING));
        CREATE TABLE table4 (col4_0 REGPROC, col4_1 FLOAT4 NOT NULL, col4_2 REGTYPE NOT NULL, col4_3 REGROLE NULL, PRIMARY KEY (col4_2 DESC), UNIQUE (col4_1 DESC) WHERE table4.col4_1 >= 'NaN':::FLOAT8, UNIQUE (col4_1 DESC, col4_0 ASC), UNIQUE (col4_2 ASC, col4_1 DESC, col4_3 ASC) STORING (col4_0) WHERE table4.col4_1 > 'NaN':::FLOAT8, INDEX (col4_3 ASC, col4_1 ASC) WHERE table4.col4_1 >= '-Inf':::FLOAT8, INDEX (col4_0 DESC) STORING (col4_3), INDEX (col4_2 DESC, col4_3) WHERE table4.col4_1 < 1.401298464324817e-45:::FLOAT8, INDEX (col4_3, col4_2 DESC, col4_0 ASC) WHERE table4.col4_1 < (-1.0):::FLOAT8);
        CREATE TABLE table5 (col5_0 GEOGRAPHY NOT NULL, col5_1 TIMESTAMP, col5_2 TIMESTAMP, col5_3 REGROLE NOT NULL, col5_4 STRING AS (lower(CAST(col5_2 AS STRING))) STORED, INDEX (col5_4 ASC, col5_3 DESC) STORING (col5_1) WHERE table5.col5_2 > '0001-01-01 00:00:00':::TIMESTAMP, UNIQUE (col5_2) WHERE table5.col5_1 <= '-2000-01-01 00:00:00':::TIMESTAMP, UNIQUE (col5_4, col5_1 ASC, lower(CAST(col5_1 AS STRING))) WHERE ((table5.col5_4 >= 'X':::STRING) AND (table5.col5_1 <= '0001-01-01 00:00:00':::TIMESTAMP)) OR (table5.col5_2 >= '3000-01-01 00:00:00':::TIMESTAMP), INVERTED INDEX (col5_4 DESC, col5_0 DESC), UNIQUE (col5_4, col5_1 ASC) STORING (col5_2) WHERE table5.col5_4 = '"':::STRING);
        ALTER TABLE table1 INJECT STATISTICS e'[{"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 552323960, "histo_col_type": "", "name": "__auto__", "null_count": 830909641, "row_count": 1000000000}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 384302096, "histo_col_type": "", "name": "__auto__", "null_count": 830878584, "row_count": 1000000000}, {"columns": ["col1_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 861211989, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000000000}, {"columns": ["col1_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 574341557, "histo_col_type": "", "name": "__auto__", "null_count": 244043665, "row_count": 1000000000}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 800195797, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000000000}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 141527076, "histo_col_type": "", "name": "__auto__", "null_count": 219600524, "row_count": 1000000000}, {"columns": ["col1_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 632214808, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000000000}, {"columns": ["col1_16"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 756226352, "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": 763709619, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000000000}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 483678160, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000000000}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 128644707, "histo_col_type": "", "name": "__auto__", "null_count": 716575373, "row_count": 1000000000}, {"columns": ["col1_17"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 842262422, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000000000}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 480801815, "histo_col_type": "", "name": "__auto__", "null_count": 564630636, "row_count": 1000000000}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 935051685, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000000000}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 695935937, "histo_col_type": "", "name": "__auto__", "null_count": 723614619, "row_count": 1000000000}, {"columns": ["col1_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 94667302, "histo_col_type": "", "name": "__auto__", "null_count": 112184877, "row_count": 1000000000}, {"columns": ["col1_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 302460323, "histo_buckets": [{"distinct_range": 0, "num_eq": 3391481411192769665, "num_range": 0, "upper_bound": "\\u0019\\u0007"}, {"distinct_range": 579486900064765800, "num_eq": 900000, "num_range": 8897866269559172364, "upper_bound": "\\""}, {"distinct_range": 60000000, "num_eq": 6028844635491149873, "num_range": 60000000, "upper_bound": "9!^``T<m@\\u000c"}, {"distinct_range": 278294147.99734145, "num_eq": 3760513464122449480, "num_range": 900000000, "upper_bound": "AOE\\u0003@\\u0015\\u0018T\\u000b"}, {"distinct_range": 50000, "num_eq": 3777334084453069513, "num_range": 50000, "upper_bound": "E|@k/"}, {"distinct_range": 0, "num_eq": 374982360073682426, "num_range": 40, "upper_bound": "R\\u0017SP8d"}, {"distinct_range": 400, "num_eq": 3030997724629844332, "num_range": 400, "upper_bound": "^\\u001d\\u0008"}, {"distinct_range": 1794425728.7919357, "num_eq": 40, "num_range": 7000000000, "upper_bound": "o"}], "histo_col_type": "NAME", "name": "__auto__", "null_count": 774700045, "row_count": 1000000000}, {"columns": ["col1_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 66029131, "histo_col_type": "", "name": "__auto__", "null_count": 956519501, "row_count": 1000000000}]':::JSONB;
        ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3409046315, "histo_col_type": "", "name": "__auto__", "null_count": 968728629, "row_count": 4000000000}, {"columns": ["col2_16"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1656087982, "histo_col_type": "", "name": "__auto__", "null_count": 1905434580, "row_count": 4000000000}, {"columns": ["col2_17"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2759834109, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4000000000}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 330792708, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4000000000}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3907466134, "histo_col_type": "", "name": "__auto__", "null_count": 649427092, "row_count": 4000000000}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3272614144, "histo_col_type": "", "name": "__auto__", "null_count": 1111819849, "row_count": 4000000000}, {"columns": ["col2_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 528498345, "histo_col_type": "", "name": "__auto__", "null_count": 3411986160, "row_count": 4000000000}, {"columns": ["col2_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 622145668, "histo_col_type": "", "name": "__auto__", "null_count": 1021293833, "row_count": 4000000000}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3424711849, "histo_col_type": "", "name": "__auto__", "null_count": 3717164107, "row_count": 4000000000}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3076059400, "histo_buckets": [{"distinct_range": 0, "num_eq": 5297487581396685550, "num_range": 0, "upper_bound": "-1.2797696590423584"}, {"distinct_range": 900000, "num_eq": 400, "num_range": 900000, "upper_bound": "-1.0"}, {"distinct_range": 40, "num_eq": 7000000, "num_range": 40, "upper_bound": "-0.9387152194976807"}, {"distinct_range": 257899539.6273785, "num_eq": 10000, "num_range": 400000000, "upper_bound": "-0.8400507569313049"}, {"distinct_range": 505377067.65887326, "num_eq": 70, "num_range": 600000000, "upper_bound": "-0.346319317817688"}, {"distinct_range": 6721897498891120000, "num_eq": 6653865852190720518, "num_range": 6721897498891119623, "upper_bound": "0.8367079496383667"}, {"distinct_range": 80000, "num_eq": 100000000000, "num_range": 80000, "upper_bound": "1.0"}], "histo_col_type": "FLOAT4", "name": "__auto__", "null_count": 63089122, "row_count": 4000000000}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1892830531, "histo_col_type": "", "name": "__auto__", "null_count": 1654672591, "row_count": 4000000000}, {"columns": ["col2_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2429979772, "histo_buckets": [{"distinct_range": 0, "num_eq": 3704791591127606319, "num_range": 0, "upper_bound": "30786414"}, {"distinct_range": 75072375771.10797, "num_eq": 3274162331722884365, "num_range": 80000000000, "upper_bound": "643602173"}, {"distinct_range": 424141209188773700, "num_eq": 1511910900969553235, "num_range": 1288736336019394126, "upper_bound": "2505006538"}, {"distinct_range": 0, "num_eq": 6001177213421342874, "num_range": 8339390446535025787, "upper_bound": "2590387759"}, {"distinct_range": 3084278966741783600, "num_eq": 0, "num_range": 4430969712038777311, "upper_bound": "3218964603"}, {"distinct_range": 6589465694613832000, "num_eq": 3000000, "num_range": 6589465694613831314, "upper_bound": "3267338842"}, {"distinct_range": 0, "num_eq": 475263022653448801, "num_range": 600, "upper_bound": "3733557098"}, {"distinct_range": 0, "num_eq": 1829189262307191046, "num_range": 4798027291005087050, "upper_bound": "4205886485"}], "histo_col_type": "REGNAMESPACE", "name": "__auto__", "null_count": 2713367130, "row_count": 4000000000}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3885107066, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4000000000}, {"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2593302695, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4000000000}, {"columns": ["col2_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3190688700, "histo_col_type": "", "name": "__auto__", "null_count": 3122738291, "row_count": 4000000000}, {"columns": ["col2_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 271457794, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4000000000}, {"columns": ["col2_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1970462182, "histo_col_type": "", "name": "__auto__", "null_count": 2647258778, "row_count": 4000000000}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2423043047, "histo_col_type": "", "name": "__auto__", "null_count": 425783899, "row_count": 4000000000}]':::JSONB;
        ALTER TABLE table3 INJECT STATISTICS e'[{"columns": ["col3_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_buckets": [{"distinct_range": 0, "num_eq": 9000, "num_range": 0, "upper_bound": "9.248.248.17/12"}, {"distinct_range": 8310952435968927000, "num_eq": 5010036806177352343, "num_range": 8310952435968926494, "upper_bound": "834b:2af1:2eaf:c9f9:b320:78ce:2630:df6b/44"}, {"distinct_range": 0, "num_eq": 9201165562708873458, "num_range": 2412949585317242766, "upper_bound": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"}], "histo_col_type": "INET", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col3_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": ["col3_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": ["col3_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}, {"columns": ["col3_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": ["col3_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_buckets": [{"distinct_range": 0, "num_eq": 10000, "num_range": 0, "upper_bound": "0"}, {"distinct_range": 0, "num_eq": 5458625712037461603, "num_range": 800, "upper_bound": "4052932744"}], "histo_col_type": "REGCLASS", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col3_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": ["col3_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": ["col3_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": ["col3_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": ["col3_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": ["col3_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_buckets": [{"distinct_range": 0, "num_eq": 4855777928648984710, "num_range": 0, "upper_bound": "\\u0019pYAYg7FK"}, {"distinct_range": 52994399222.92617, "num_eq": 6832381264937171332, "num_range": 90000000000, "upper_bound": "G"}, {"distinct_range": 512168584118394400, "num_eq": 10000, "num_range": 6494348134177515338, "upper_bound": "s\\\\\\u000bqI"}, {"distinct_range": 0, "num_eq": 8000000, "num_range": 539754660252720440, "upper_bound": "w\\u001a"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col3_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_buckets": [{"distinct_range": 0, "num_eq": 4000000, "num_range": 0, "upper_bound": "1989-11-08 05:48:48.000942"}, {"distinct_range": 2243475663674361900, "num_eq": 5184617965743850177, "num_range": 3698020706895838894, "upper_bound": "1995-12-10 18:34:56.000908"}, {"distinct_range": 0, "num_eq": 0, "num_range": 3155710446057486102, "upper_bound": "2006-02-01 17:36:25.000822"}, {"distinct_range": 0, "num_eq": 4017355696776628188, "num_range": 900000, "upper_bound": "2029-08-20 21:48:18.000826"}, {"distinct_range": 238530846228019100, "num_eq": 127493518297245889, "num_range": 1565366827394642596, "upper_bound": "2032-09-04 10:28:54.000042"}], "histo_col_type": "TIMESTAMP", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col3_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": ["col3_14"], "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": ["col3_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 table4 INJECT STATISTICS '[{"columns": ["col4_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 166850727055576511, "histo_buckets": [{"distinct_range": 0, "num_eq": 300000, "num_range": 0, "upper_bound": "1221942189"}, {"distinct_range": 0, "num_eq": 40, "num_range": 6924020589394700757, "upper_bound": "2250356375"}], "histo_col_type": "REGPROC", "name": "__auto__", "null_count": 195306796476917458, "row_count": 1195116801999142788}, {"columns": ["col4_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 329508451954618554, "histo_col_type": "FLOAT4", "name": "__auto__", "null_count": 0, "row_count": 1195116801999142788}, {"columns": ["col4_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 779025404785882131, "histo_buckets": [{"distinct_range": 0, "num_eq": 1000, "num_range": 0, "upper_bound": "1191637320"}, {"distinct_range": 0, "num_eq": 80000, "num_range": 2115036100618073139, "upper_bound": "1579909427"}, {"distinct_range": 966360827468293900, "num_eq": 900000000, "num_range": 5179510847140678154, "upper_bound": "2938866729"}, {"distinct_range": 1559.9975211803612, "num_eq": 6662668044128379088, "num_range": 6000, "upper_bound": "3869864665"}], "histo_col_type": "REGTYPE", "name": "__auto__", "null_count": 0, "row_count": 1195116801999142788}, {"columns": ["col4_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 947533931417577156, "histo_buckets": [{"distinct_range": 0, "num_eq": 584599440757889876, "num_range": 0, "upper_bound": "868938816"}, {"distinct_range": 3398326324585839600, "num_eq": 7498330776517660728, "num_range": 3398326324585839362, "upper_bound": "3861540353"}, {"distinct_range": 1599948165571255300, "num_eq": 0, "num_range": 2298901749473163785, "upper_bound": "3985716142"}], "histo_col_type": "REGROLE", "name": "__auto__", "null_count": 84363848130034337, "row_count": 1195116801999142788}]':::JSONB;
        ALTER TABLE table5 INJECT STATISTICS e'[{"columns": ["col5_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2933437100536929824, "histo_buckets": [{"distinct_range": 0, "num_eq": 300000, "num_range": 0, "upper_bound": "-4713-11-24 00:00:00"}, {"distinct_range": 0, "num_eq": 10, "num_range": 8841281082811004792, "upper_bound": "1979-07-12 05:44:21.000755"}, {"distinct_range": 0, "num_eq": 2109677693443530111, "num_range": 50000, "upper_bound": "1984-12-02 21:22:02.000384"}, {"distinct_range": 900000, "num_eq": 7037726499867817825, "num_range": 900000, "upper_bound": "2000-09-25 11:57:54.000797"}, {"distinct_range": 6051481.959842844, "num_eq": 4889294162979675164, "num_range": 7000000, "upper_bound": "2003-06-02 01:33:43.00097"}, {"distinct_range": 0, "num_eq": 100000000, "num_range": 752808527549207045, "upper_bound": "2006-10-26 12:23:28.000043"}], "histo_col_type": "TIMESTAMP", "name": "__auto__", "null_count": 2444262584145259789, "row_count": 4361802317021757904}, {"columns": ["col5_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3849807344250008181, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4361802317021757904}, {"columns": ["col5_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1974008777759656397, "histo_buckets": [{"distinct_range": 0, "num_eq": 5000000, "num_range": 0, "upper_bound": "\\u0002"}, {"distinct_range": 5913029723373966000, "num_eq": 4778894356421109292, "num_range": 5913029723373966738, "upper_bound": "@\\u0012"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 348935570039370601, "row_count": 4361802317021757904}, {"columns": ["col5_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3098560210401235622, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4361802317021757904}, {"columns": ["col5_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2818299415823324528, "histo_col_type": "", "name": "__auto__", "null_count": 350722187312855498, "row_count": 4361802317021757904}]':::JSONB;
        CREATE TYPE rand_typ_0 AS ENUM ('ppe', 'cb', 'uqp', 'rue');
        CREATE TYPE rand_typ_1 AS ENUM ('xxy');
        CREATE TYPE rand_typ_2 AS ENUM ('k', 'i', 'uji', 'vyvfs');
        ;
    rsg_test.go:598: 
        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:600: 
    rsg_test.go:601: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith649875165
--- FAIL: TestRandomSyntaxSQLSmith (300.97s)
Reproduce

To reproduce, try:

make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1
Same failure on other branches

  • #70663 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-master]
  • #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-release-21.1]
Internal log

mjibson marked as alumn{us/a}; resolving to rafiss instead

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity avatar Oct 13 '21 06:10 cockroach-teamcity

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-21.2 @ 80d2fb8e621d25c2ceb89562e45b63205a1c36e9:

        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 VARCHAR NOT NULL, col1_1 REGPROCEDURE NOT NULL, PRIMARY KEY (col1_0 DESC, col1_1), INDEX (lower(col1_0), col1_1) WHERE table1.col1_0 >= 'X':::STRING, INDEX (col1_1 ASC, col1_0 ASC), UNIQUE (col1_0 DESC, col1_1), UNIQUE (col1_0 DESC) WHERE table1.col1_0 >= 'X':::STRING, UNIQUE (col1_0, lower(col1_0) DESC) WHERE table1.col1_0 = 'X':::STRING, FAMILY (col1_1, col1_0));
        CREATE TABLE table2 (col2_0 GEOGRAPHY, col2_1 FLOAT4 NULL, col2_2 UUID NOT NULL, col2_3 INET[] NOT NULL, col2_4 INTERVAL NOT NULL, col2_5 BOX2D NULL, col2_6 REGCLASS NOT NULL, col2_7 VARCHAR NOT NULL, PRIMARY KEY (col2_2 ASC), col2_8 STRING NOT NULL AS (CASE WHEN col2_3 IS NULL THEN e'\x15\x1b\x0f-':::STRING ELSE e'D\x12\x19Y':::STRING END) STORED, col2_9 STRING AS (lower(CAST(col2_0 AS STRING))) STORED, col2_10 STRING NULL AS (lower(CAST(col2_5 AS STRING))) VIRTUAL, UNIQUE (col2_9, lower(CAST(col2_6 AS STRING)) DESC, col2_4, col2_7 ASC, lower(col2_7), col2_10, col2_8 ASC, col2_5, col2_6, col2_2) STORING (col2_0, col2_1) WHERE (((table2.col2_1 < '+Inf':::FLOAT8) AND (table2.col2_7 > e'\x00':::STRING)) AND (table2.col2_10 = e'\x00':::STRING)) OR (table2.col2_8 >= '"':::STRING), UNIQUE (col2_1 ASC), UNIQUE (col2_9 DESC, col2_1 ASC, col2_8), FAMILY (col2_9), FAMILY (col2_6, col2_5), FAMILY (col2_8, col2_0), FAMILY (col2_1), FAMILY (col2_7, col2_2), FAMILY (col2_4), FAMILY (col2_3));
        ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 781, "histo_buckets": [{"distinct_range": 0, "num_eq": 3964412455179699825, "num_range": 0, "upper_bound": ""}, {"distinct_range": 30, "num_eq": 90000, "num_range": 30, "upper_bound": "jGV/v"}], "histo_col_type": "VARCHAR", "name": "__auto__", "null_count": 0, "row_count": 900}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 477, "histo_buckets": [{"distinct_range": 0, "num_eq": 800, "num_range": 0, "upper_bound": "0"}, {"distinct_range": 1694556.1719576244, "num_eq": 6553630629806117683, "num_range": 30000000, "upper_bound": "585648848"}, {"distinct_range": 0, "num_eq": 2315853586504017208, "num_range": 5000, "upper_bound": "2857791990"}, {"distinct_range": 1000000, "num_eq": 60000000, "num_range": 1000000, "upper_bound": "3090564097"}, {"distinct_range": 0, "num_eq": 1000000000, "num_range": 700000, "upper_bound": "3214900364"}], "histo_col_type": "REGPROCEDURE", "name": "__auto__", "null_count": 0, "row_count": 900}]':::JSONB;
        ALTER TABLE table2 INJECT STATISTICS e'[{"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 36812348197, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 80000000000}, {"columns": ["col2_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 37764526045, "histo_buckets": [{"distinct_range": 0, "num_eq": 400000, "num_range": 0, "upper_bound": "\\nZ\x7f\\r\\t3"}, {"distinct_range": 5647042182472225000, "num_eq": 10000000000, "num_range": 8992933541058210830, "upper_bound": "``EZ"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 55379442085, "row_count": 80000000000}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 44112795550, "histo_buckets": [{"distinct_range": 0, "num_eq": 100000000, "num_range": 0, "upper_bound": "02447605-787f-4195-a3d6-13c71d6bd236"}, {"distinct_range": 330326752061965500, "num_eq": 0, "num_range": 394256697335758223, "upper_bound": "2c46bfcb-6876-4e0d-9e25-d06c956756a1"}, {"distinct_range": 0, "num_eq": 7207530535331756588, "num_range": 0, "upper_bound": "d56dbee4-aeaf-46c1-a4b2-3d2ed89566b8"}], "histo_col_type": "UUID", "name": "__auto__", "null_count": 0, "row_count": 80000000000}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 47107390173, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 80000000000}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 43241861530, "histo_col_type": "", "name": "__auto__", "null_count": 8150585788, "row_count": 80000000000}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 28965198548, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 80000000000}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 58374317015, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 80000000000}, {"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 67932389353, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 80000000000}, {"columns": ["col2_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 71127218290, "histo_col_type": "", "name": "__auto__", "null_count": 26247295024, "row_count": 80000000000}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 25891844969, "histo_col_type": "", "name": "__auto__", "null_count": 55897699114, "row_count": 80000000000}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 48425766429, "histo_col_type": "FLOAT4", "name": "__auto__", "null_count": 12494642163, "row_count": 80000000000}]':::JSONB;
        CREATE TYPE rand_typ_0 AS ENUM ('zf');
        CREATE TYPE rand_typ_1 AS ENUM ('xmdh', 's', 'q', 'ebud', 'gq', 'fx');
        CREATE TYPE rand_typ_2 AS ENUM ('ge');
        CREATE TYPE rand_typ_3 AS ENUM ('u', 'dfn');
        CREATE TYPE rand_typ_4 AS ENUM ('t', 'voyxne', 'lhkwwu', 'ksi');
        ;
    rsg_test.go:598: 
        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:600: 
    rsg_test.go:601: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith506560924
--- FAIL: TestRandomSyntaxSQLSmith (313.45s)
Reproduce

To reproduce, try:

make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1
Same failure on other branches

  • #70663 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-master]
  • #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-release-21.1]
Internal log

mjibson marked as alumn{us/a}; resolving to rafiss instead

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity avatar Nov 12 '21 07:11 cockroach-teamcity

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-21.2 @ 97f2e7dbe93a3873916b99307f1372d7c095347c:

        	tab_204100.crdb_internal_mvcc_timestamp AS col_506441,
        	4699569180394505989:::INT8 AS col_506442,
        	e'J\x1e\f\x127fD':::STRING AS col_506443,
        	1.7573901414871216:::FLOAT8 AS col_506444,
        	'1972-08-18':::DATE AS col_506445,
        	COALESCE(e'\x0b':::STRING, tab_204100.col1_15) AS col_506446,
        	false AS col_506447,
        	e'sW\x13\x1a}\x17\x04S':::STRING AS col_506448
        FROM
        	defaultdb.public.table1@table1_col1_8_col1_4_col1_1_col1_14_col1_10_expr_col1_0_col1_9_col1_15_col1_5_col1_11_col1_16_idx
        		AS tab_204100
        	JOIN defaultdb.public.seed@seed__int8__float8__date_idx AS tab_204101 ON (tab_204100.col1_8) = (tab_204101._string)
        WHERE
        	tab_204100.col1_9
        ORDER BY
        	tab_204100.col1_11, tab_204101._float8 ASC
        LIMIT
        	62:::INT8;
    rsg_test.go:588: ERROR: pq: index "table1_col1_8_col1_4_col1_1_col1_14_col1_10_expr_col1_0_col1_9_col1_15_col1_5_col1_11_col1_16_idx" is a partial index that does not contain all the rows needed to execute this query
        caused by:
        SELECT
        	1752176887:::OID AS col_506472
        FROM
        	defaultdb.public.table1@table1_col1_8_col1_4_col1_1_col1_14_col1_10_expr_col1_0_col1_9_col1_15_col1_5_col1_11_col1_16_idx
        		AS tab_204119
        ORDER BY
        	tab_204119.col1_12 DESC, tab_204119.col1_14;
    rsg_test.go:588: ERROR: pq: index "table1_col1_8_col1_4_col1_1_col1_14_col1_10_expr_col1_0_col1_9_col1_15_col1_5_col1_11_col1_16_idx" is a partial index that does not contain all the rows needed to execute this query
        caused by:
        SELECT
        	count(*) AS col_506436
        FROM
        	defaultdb.public.table1@table1_col1_8_col1_4_col1_1_col1_14_col1_10_expr_col1_0_col1_9_col1_15_col1_5_col1_11_col1_16_idx
        		AS tab_204093
        GROUP BY
        	tab_204093.col1_8, tab_204093.col1_16;
    rsg_test.go:588: ERROR: pq: index "table1_col1_8_col1_4_col1_1_col1_14_col1_10_expr_col1_0_col1_9_col1_15_col1_5_col1_11_col1_16_idx" is a partial index that does not contain all the rows needed to execute this query
        caused by:
        SELECT
        	tab_204141.col1_10 AS col_506493
        FROM
        	defaultdb.public.table1 AS tab_204139
        	JOIN defaultdb.public.table1 AS tab_204140 ON (tab_204139.col1_8) = (tab_204140.col1_8),
        	defaultdb.public.table1@table1_col1_8_col1_4_col1_1_col1_14_col1_10_expr_col1_0_col1_9_col1_15_col1_5_col1_11_col1_16_idx
        		AS tab_204141,
        	defaultdb.public.table1@[0] AS tab_204142
        ORDER BY
        	tab_204142.tableoid
        LIMIT
        	50:::INT8;
Reproduce

To reproduce, try:

make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1
Same failure on other branches

  • #70663 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-master]
  • #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-release-21.1]
Internal log

mjibson marked as alumn{us/a}; resolving to rafiss instead

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity avatar Nov 16 '21 06:11 cockroach-teamcity

I had a sql smith issue but all the teamcity logs were deleted so I started looking at this one, the last two seemed to fail like this:

    rsg_test.go:204: SELECT 1 executed successfully: probably a slow statement
    rsg_test.go:574: couldn't reconnect to db after crasher: server panic: statement exec timeout

Not sure how the timeouts are supposed to work but I'll keep digging.

cucaroach avatar Nov 19 '21 14:11 cucaroach

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-21.2 @ af7f257bc39988e6d98d516d7fe7cb842a22ad67:

Random syntax error:

    rsg_test.go:779: Crash detected: server panic: statement exec timeout

Query:

        SELECT
        	tab_84219.crdb_internal_idx_expr AS col_187503,
        	tab_84221.col1_1 AS col_187504,
        	tab_84218.col4_2 AS col_187505,
        	tab_84218.col4_18 AS col_187506,
        	tab_84221.col1_6 AS col_187507,
        	1886969956:::OID AS col_187508,
        	COALESCE(3607803562:::OID, tab_84218.tableoid) AS col_187509,
        	'T':::STRING AS col_187510
        FROM
        	defaultdb.public.table3 AS tab_84216
        	JOIN defaultdb.public.table4 AS tab_84217 ON (tab_84216.crdb_internal_idx_expr) = (tab_84217.col4_16),
        	defaultdb.public.table4@[0] AS tab_84218
        	JOIN defaultdb.public.table3@[0] AS tab_84219
        		JOIN defaultdb.public.table1@[0] AS tab_84220
        			JOIN defaultdb.public.table1@table1_expr_key AS tab_84221
        				JOIN defaultdb.public.table3@[0] AS tab_84222 ON
        						(tab_84221.col1_4) = (tab_84222.crdb_internal_idx_expr_1) ON
        					(tab_84220.col1_4) = (tab_84222.crdb_internal_idx_expr)
        					AND (tab_84220.crdb_internal_idx_expr) = (tab_84221.crdb_internal_idx_expr_1)
        			JOIN defaultdb.public.table5 AS tab_84227
        				JOIN defaultdb.public.table5 AS tab_84228 ON
        						(tab_84227.crdb_internal_idx_expr) = (tab_84228.crdb_internal_idx_expr) ON
        					(tab_84221.crdb_internal_idx_expr_1) = (tab_84227.crdb_internal_idx_expr)
        					AND (tab_84221.col1_6) = (tab_84228.crdb_internal_idx_expr)
        					AND (tab_84222.crdb_internal_idx_expr) = (tab_84227.crdb_internal_idx_expr)
        					AND (tab_84221.col1_4) = (tab_84227.crdb_internal_idx_expr)
        					AND (tab_84220.col1_5) = (tab_84228.crdb_internal_idx_expr) ON
        				(tab_84219.col3_0) = (tab_84228.crdb_internal_idx_expr)
        				AND (tab_84219.crdb_internal_idx_expr_1) = (tab_84222.col3_6)
        				AND (tab_84219.crdb_internal_idx_expr_1) = (tab_84227.crdb_internal_idx_expr) ON
        			(tab_84218.col4_7) = (tab_84227.crdb_internal_idx_expr)
        			AND (tab_84218.col4_18) = (tab_84221.crdb_internal_idx_expr)
        			AND (tab_84218.crdb_internal_idx_expr_4) = (tab_84227.crdb_internal_idx_expr)
        WHERE
        	'&ie=>uN':::STRING NOT LIKE tab_84221.col1_5
        ORDER BY
        	tab_84218.col4_0
        LIMIT
        	52:::INT8;

Schema:

    rsg_test.go:596: To reproduce, use schema:
    rsg_test.go:598: 
        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 NULL, col1_1 VARCHAR NOT NULL, col1_2 REGNAMESPACE, col1_3 GEOGRAPHY NOT NULL, col1_4 STRING NULL AS (CASE WHEN col1_0 IS NULL THEN e'\x13I':::STRING ELSE 'b':::STRING END) STORED, col1_5 STRING NULL AS (CASE WHEN col1_0 IS NULL THEN e'\x1db4\x1br':::STRING ELSE e'Cc?\x1a\x12':::STRING END) STORED, col1_6 STRING NOT NULL AS (lower(col1_1)) STORED, UNIQUE ((CASE WHEN col1_0 IS NULL THEN 'BXS':::STRING ELSE e'L w\x1e\x11\x05)':::STRING END)) STORING (col1_0, col1_2, col1_3, col1_4, col1_5, col1_6) WHERE ((table1.col1_4 < '"':::STRING) OR (table1.col1_0 >= '0001-01-01 00:00:00+00:00':::TIMESTAMPTZ)) AND (table1.col1_6 >= e'\U00002603':::STRING), INDEX (col1_5, col1_4 DESC, col1_2, col1_6, col1_1), UNIQUE (lower(col1_1) ASC) WHERE table1.col1_0 < '-2000-01-01 00:00:00+00:00':::TIMESTAMPTZ, INVERTED INDEX (col1_1 ASC, col1_4 ASC, col1_0 DESC, col1_3 DESC), FAMILY (col1_3, col1_5), FAMILY (col1_1), FAMILY (col1_6), FAMILY (col1_2), FAMILY (col1_0, col1_4));
        CREATE TABLE table2 (col2_0 BOX2D, col2_1 REGPROCEDURE NOT NULL, PRIMARY KEY (col2_1), INDEX (col2_1), UNIQUE (col2_1, col2_0 ASC), UNIQUE (col2_1 DESC, col2_0 DESC), UNIQUE (lower(CAST(col2_1 AS STRING)) ASC), UNIQUE (col2_1));
        CREATE TABLE table3 (col3_0 STRING NOT NULL, col3_1 TIME, col3_2 TIMETZ NOT NULL, col3_3 FLOAT4, col3_4 GEOGRAPHY, col3_5 FLOAT4 AS (col3_3 + 0.24219180643558502:::FLOAT8) VIRTUAL, col3_6 STRING NOT NULL AS (lower(CAST(col3_2 AS STRING))) STORED, INVERTED INDEX (col3_5 DESC, col3_2, col3_0 DESC, col3_4 ASC), INDEX (lower(CAST(col3_2 AS STRING)) ASC, lower(col3_0) ASC) STORING (col3_0, col3_1, col3_3, col3_4), INDEX (col3_2 DESC, col3_0 DESC, col3_6, (col3_3 + (-0.9469944834709167):::FLOAT8) DESC), FAMILY (col3_4), FAMILY (col3_2, col3_1, col3_6), FAMILY (col3_0, col3_3));
        CREATE TABLE table4 (col4_0 REGPROC NULL, col4_1 OID NOT NULL, col4_2 REGCLASS, col4_3 BIT(32), col4_4 BIT(28) NULL, col4_5 REGPROCEDURE NOT NULL, col4_6 REGCLASS NOT NULL, col4_7 CHAR NULL, col4_8 BOOL NULL, col4_9 STRING NOT NULL, col4_10 INT4 NOT NULL, col4_11 BOOL, col4_12 BOOL NOT NULL, col4_13 FLOAT8 NULL, col4_14 DECIMAL NOT NULL, PRIMARY KEY (col4_1, col4_5 DESC, col4_10, col4_6, col4_9 DESC), col4_15 STRING NULL AS (lower(col4_7)) STORED, col4_16 STRING NULL AS (lower(CAST(col4_4 AS STRING))) STORED, col4_17 FLOAT8 NULL AS (col4_13 + NULL) VIRTUAL, col4_18 STRING NOT NULL AS (lower(col4_9)) VIRTUAL, UNIQUE ((col4_14 + 314136942236950.9461:::DECIMAL), col4_3, col4_12 ASC, col4_14, col4_0, (col4_14 + (-1):::DECIMAL) ASC, col4_2, col4_8 ASC, col4_13 DESC, col4_5, col4_10 ASC, col4_4, lower(CAST(col4_11 AS STRING)) DESC, col4_15, col4_1 ASC, col4_18 DESC, col4_16 DESC, col4_9 ASC, col4_6) STORING (col4_7, col4_11) WHERE (((((((((((NOT table4.col4_11) AND (table4.col4_7 = e'\U00002603':::STRING)) AND (NOT table4.col4_8)) OR (table4.col4_9 >= e'\'':::STRING)) AND (table4.col4_13 < '-Inf':::FLOAT8)) OR (table4.col4_15 >= '':::STRING)) OR (table4.col4_17 >= (-1.0):::FLOAT8)) AND (table4.col4_18 <= 'X':::STRING)) OR (table4.col4_16 > 'X':::STRING)) AND (table4.col4_10 >= (-2147483648):::INT8)) OR (table4.col4_14 = (-1):::DECIMAL)) AND (NOT table4.col4_12), UNIQUE (col4_3 DESC, lower(col4_7) ASC, col4_8 DESC, col4_15 ASC, col4_9 DESC, col4_10, col4_0 ASC, col4_2 DESC, col4_18 DESC, col4_13, lower(CAST(col4_11 AS STRING)), col4_17, col4_1, col4_14 ASC, col4_16 DESC) STORING (col4_7), UNIQUE (col4_16 ASC, col4_3 DESC, col4_1) STORING (col4_2, col4_7, col4_8, col4_14, col4_15));
        CREATE TABLE table5 (col5_0 TIMESTAMPTZ, INDEX (col5_0), INDEX (col5_0 DESC), INDEX ((CASE WHEN col5_0 IS NULL THEN e'Y;\b\x1b':::STRING ELSE '':::STRING END) DESC), UNIQUE (col5_0 ASC) WHERE table5.col5_0 <= '-2000-01-01 00:00:00+00:00':::TIMESTAMPTZ);
        ALTER TABLE table1 INJECT STATISTICS e'[{"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 364618, "histo_col_type": "", "name": "__auto__", "null_count": 655052, "row_count": 700000}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 628328, "histo_buckets": [{"distinct_range": 0, "num_eq": 300, "num_range": 0, "upper_bound": "X"}, {"distinct_range": 2503.7578365778777, "num_eq": 8000000, "num_range": 10000, "upper_bound": "_\\thZt\\u0004\\n"}, {"distinct_range": 104654173.12360181, "num_eq": 900, "num_range": 400000000, "upper_bound": "u>D+\\u000ec"}], "histo_col_type": "VARCHAR", "name": "__auto__", "null_count": 0, "row_count": 700000}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 85459, "histo_col_type": "", "name": "__auto__", "null_count": 644784, "row_count": 700000}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 457317, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 700000}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 569677, "histo_col_type": "", "name": "__auto__", "null_count": 50846, "row_count": 700000}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 596678, "histo_buckets": [{"distinct_range": 0, "num_eq": 8123990484388208228, "num_range": 0, "upper_bound": ""}, {"distinct_range": 0, "num_eq": 2153577617466160453, "num_range": 7000000000, "upper_bound": "T%bG\x7fg"}, {"distinct_range": 3747384353781202000, "num_eq": 10000, "num_range": 3812530129836114309, "upper_bound": "w5X~w"}, {"distinct_range": 291269.58539653226, "num_eq": 4878869901094192969, "num_range": 800000, "upper_bound": "|&;Bd"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 564194, "row_count": 700000}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 600651, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 700000}]':::JSONB;
        ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 50474361, "histo_col_type": "", "name": "__auto__", "null_count": 314212646, "row_count": 500000000}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 225626345, "histo_buckets": [{"distinct_range": 0, "num_eq": 2000, "num_range": 0, "upper_bound": "692441361"}, {"distinct_range": 6265170482248552000, "num_eq": 300000, "num_range": 6265170482248551979, "upper_bound": "1084234016"}, {"distinct_range": 1358909183941602300, "num_eq": 5000000000, "num_range": 4988710299141472405, "upper_bound": "1654012155"}, {"distinct_range": 7000000, "num_eq": 600000, "num_range": 7000000, "upper_bound": "3037951786"}, {"distinct_range": 1814501738141620700, "num_eq": 6947225155977264395, "num_range": 2221440352422506859, "upper_bound": "3103853641"}, {"distinct_range": 0, "num_eq": 40, "num_range": 90000000000, "upper_bound": "3308773111"}, {"distinct_range": 2874408173172291000, "num_eq": 4540574209849156340, "num_range": 2874408173172290893, "upper_bound": "3868265550"}, {"distinct_range": 10000000, "num_eq": 70000, "num_range": 10000000, "upper_bound": "4160263177"}], "histo_col_type": "REGPROCEDURE", "name": "__auto__", "null_count": 0, "row_count": 500000000}]':::JSONB;
        ALTER TABLE table3 INJECT STATISTICS '[{"columns": ["col3_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2874135047358841500, "histo_col_type": "", "name": "__auto__", "null_count": 593572461488035750, "row_count": 3130153915677792742}, {"columns": ["col3_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 611004284046939226, "histo_col_type": "", "name": "__auto__", "null_count": 533974854794520902, "row_count": 3130153915677792742}, {"columns": ["col3_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1275524973537531712, "histo_col_type": "", "name": "__auto__", "null_count": 2572820658046065736, "row_count": 3130153915677792742}, {"columns": ["col3_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3059265247846135682, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 3130153915677792742}, {"columns": ["col3_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1012453462987040762, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 3130153915677792742}, {"columns": ["col3_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 107815834727378192, "histo_col_type": "", "name": "__auto__", "null_count": 1913017473777886046, "row_count": 3130153915677792742}, {"columns": ["col3_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1411203735442620804, "histo_col_type": "TIMETZ", "name": "__auto__", "null_count": 0, "row_count": 3130153915677792742}]':::JSONB;
        ALTER TABLE table4 INJECT STATISTICS e'[{"columns": ["col4_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 68973, "histo_col_type": "", "name": "__auto__", "null_count": 41300, "row_count": 90000}, {"columns": ["col4_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4030, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 90000}, {"columns": ["col4_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 61898, "histo_col_type": "", "name": "__auto__", "null_count": 11182, "row_count": 90000}, {"columns": ["col4_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7522, "histo_col_type": "", "name": "__auto__", "null_count": 5632, "row_count": 90000}, {"columns": ["col4_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 19938, "histo_buckets": [{"distinct_range": 0, "num_eq": 0, "num_range": 0, "upper_bound": "0"}, {"distinct_range": 30000000000, "num_eq": 1939096660105709685, "num_range": 30000000000, "upper_bound": "805999713"}, {"distinct_range": 0, "num_eq": 4542538648910262982, "num_range": 100000000, "upper_bound": "1473058724"}, {"distinct_range": 0, "num_eq": 8000000, "num_range": 400, "upper_bound": "1588088607"}, {"distinct_range": 0, "num_eq": 7000000, "num_range": 4000000, "upper_bound": "2309824085"}, {"distinct_range": 0, "num_eq": 8747247330986538418, "num_range": 995571963196049318, "upper_bound": "3196507626"}, {"distinct_range": 0, "num_eq": 7000, "num_range": 70, "upper_bound": "3991183923"}], "histo_col_type": "OID", "name": "__auto__", "null_count": 0, "row_count": 90000}, {"columns": ["col4_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 42968, "histo_col_type": "", "name": "__auto__", "null_count": 83299, "row_count": 90000}, {"columns": ["col4_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 21941, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 90000}, {"columns": ["col4_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 14045, "histo_col_type": "", "name": "__auto__", "null_count": 76916, "row_count": 90000}, {"columns": ["col4_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 56901, "histo_col_type": "", "name": "__auto__", "null_count": 66003, "row_count": 90000}, {"columns": ["col4_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 35108, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 90000}, {"columns": ["col4_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 53914, "histo_col_type": "", "name": "__auto__", "null_count": 39276, "row_count": 90000}, {"columns": ["col4_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 8705, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 90000}, {"columns": ["col4_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 77402, "histo_col_type": "", "name": "__auto__", "null_count": 76347, "row_count": 90000}, {"columns": ["col4_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 9592, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 90000}, {"columns": ["col4_18"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 39933, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 90000}, {"columns": ["col4_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6011, "histo_col_type": "", "name": "__auto__", "null_count": 16450, "row_count": 90000}, {"columns": ["col4_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 77682, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 90000}, {"columns": ["col4_16"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 52683, "histo_buckets": [{"distinct_range": 0, "num_eq": 7806971127200666746, "num_range": 0, "upper_bound": ""}, {"distinct_range": 10000, "num_eq": 4583928445733606528, "num_range": 10000, "upper_bound": "\'"}, {"distinct_range": 90000000000, "num_eq": 7463409211187428205, "num_range": 90000000000, "upper_bound": "\\\\\\u0002?\\u001d\\u000f"}, {"distinct_range": 5592917722533526000, "num_eq": 5000, "num_range": 5592917722533525187, "upper_bound": "f|\\u0005\\u0005h"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 78293, "row_count": 90000}, {"columns": ["col4_17"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 43742, "histo_col_type": "", "name": "__auto__", "null_count": 79164, "row_count": 90000}]':::JSONB;
        ALTER TABLE table5 INJECT STATISTICS '[{"columns": ["col5_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 23968328, "histo_buckets": [{"distinct_range": 0, "num_eq": 8651495182535650875, "num_range": 0, "upper_bound": "-2000-01-01 00:00:00+00:00"}, {"distinct_range": 0, "num_eq": 0, "num_range": 3997289641181424637, "upper_bound": "1986-08-14 15:12:57.000923+00:00"}, {"distinct_range": 12158033.330773376, "num_eq": 2719398455843241073, "num_range": 20000000, "upper_bound": "1990-04-11 02:09:44.000129+00:00"}, {"distinct_range": 3000, "num_eq": 2132971568985478619, "num_range": 3000, "upper_bound": "2003-09-22 05:49:59.000198+00:00"}], "histo_col_type": "TIMESTAMPTZ", "name": "__auto__", "null_count": 67585698, "row_count": 100000000}]':::JSONB;
        CREATE TYPE rand_typ_0 AS ENUM ('v', 'fzmn');
        CREATE TYPE rand_typ_1 AS ENUM ('dj', 'bz', 'ty', 'fnps', 'ziwgq');
        CREATE TYPE rand_typ_2 AS ENUM ('vrhs', 'jjpyi', 'f', 'iwthqp');
        CREATE TYPE rand_typ_3 AS ENUM ('i', 'uppes', 'wxz', 'zvbur');
        ;
    rsg_test.go:598: 
        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:600: 
    rsg_test.go:601: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith733498217
--- FAIL: TestRandomSyntaxSQLSmith (352.14s)
Reproduce

To reproduce, try:

make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1
Same failure on other branches

  • #73010 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
  • #70663 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-master]
Internal log

mjibson marked as alumn{us/a}; resolving to rafiss instead

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity avatar Nov 23 '21 06:11 cockroach-teamcity

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-21.2 @ 81d49bd3d2e8ee3da4a5800043b94aa174127ab7:

Random syntax error:

    rsg_test.go:779: Crash detected: server panic: statement exec timeout

Query:

        SELECT
        	'00:00:00':::INTERVAL AS col_170471,
        	tab_69858.col1_2 AS col_170472,
        	tab_69861._inet AS col_170473,
        	tab_69858.col1_9 AS col_170474
        FROM
        	defaultdb.public.table1@[0] AS tab_69858
        	JOIN defaultdb.public.seed@[0] AS tab_69859
        		JOIN defaultdb.public.table1@[0] AS tab_69860
        			JOIN defaultdb.public.seed@seed__int8__float8__date_idx AS tab_69861 ON
        					(tab_69860.col1_2) = (tab_69861.tableoid)
        					AND (tab_69860.col1_5) = (tab_69861.tableoid)
        					AND (tab_69860.col1_10) = (tab_69861._string)
        					AND (tab_69860.col1_13) = (tab_69861._string)
        					AND (tab_69860.col1_12) = (tab_69861._string)
        					AND (tab_69860.col1_3) = (tab_69861._interval)
        					AND (tab_69860.col1_9) = (tab_69861._string)
        			JOIN defaultdb.public.table1 AS tab_69862
        				JOIN defaultdb.public.table1 AS tab_69863 ON
        						(tab_69862.col1_12) = (tab_69863.col1_12)
        						AND (tab_69862.col1_2) = (tab_69863.col1_2)
        						AND (tab_69862.col1_10) = (tab_69863.col1_10)
        				JOIN defaultdb.public.seed@[0] AS tab_69864 ON
        						(tab_69862.col1_6) = (tab_69864._string)
        						AND (tab_69862.col1_6) = (tab_69864._string)
        						AND (tab_69862.col1_6) = (tab_69864._string)
        						AND (tab_69863.col1_6) = (tab_69864._string) ON
        					(tab_69860.col1_2) = (tab_69864.tableoid) AND (tab_69860.col1_11) = (tab_69862.col1_6) ON
        				(tab_69859._enum) = (tab_69861._enum) AND (tab_69859._string) = (tab_69860.col1_11)
        		JOIN defaultdb.public.table1@table1_col1_12_col1_6_col1_0_col1_13_col1_9_col1_7_col1_3_col1_10_col1_2_key
        				AS tab_69865 ON
        				(tab_69860.col1_12) = (tab_69865.col1_8)
        				AND (tab_69861._inet) = (tab_69865.col1_7)
        				AND (tab_69863.col1_6) = (tab_69865.col1_10) ON
        			(tab_69858.col1_1) = (tab_69865.col1_1) AND (tab_69858.col1_12) = (tab_69863.col1_6)
        WHERE
        	tab_69861._bool
        ORDER BY
        	tab_69861._uuid
        LIMIT
        	80:::INT8;

Schema:

    rsg_test.go:596: To reproduce, use schema:
    rsg_test.go:598: 
        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, col1_1 REGTYPE NOT NULL, col1_2 REGPROC NOT NULL, col1_3 INTERVAL NOT NULL, col1_4 GEOMETRY NULL, col1_5 REGROLE, col1_6 "char" NOT NULL, col1_7 INET NOT NULL, col1_8 STRING NOT NULL AS (lower(col1_6)) STORED, col1_9 STRING NOT NULL AS (lower(CAST(col1_7 AS STRING))) VIRTUAL, col1_10 STRING NOT NULL AS (lower(CAST(col1_7 AS STRING))) VIRTUAL, col1_11 STRING NOT NULL AS (lower(col1_6)) STORED, col1_12 STRING NOT NULL AS (lower(col1_6)) VIRTUAL, col1_13 STRING NOT NULL AS (lower(col1_6)) STORED, UNIQUE (col1_12 ASC, col1_6 ASC, col1_0 ASC, col1_13 DESC, col1_9 ASC, col1_7 ASC, col1_3 DESC, col1_10 DESC, col1_2 DESC) STORING (col1_1, col1_8) WHERE table1.col1_8 != e'\U00002603':::STRING);
        ALTER TABLE table1 INJECT STATISTICS e'[{"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3680187086554691795, "histo_col_type": "", "name": "__auto__", "null_count": 3214101812965994083, "row_count": 6128832902647577712}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3660788408882230232, "histo_col_type": "", "name": "__auto__", "null_count": 1606898986546814151, "row_count": 6128832902647577712}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4845148271117138501, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6128832902647577712}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 422872076098012248, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6128832902647577712}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2093126043471405326, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6128832902647577712}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 144718557263646999, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6128832902647577712}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4372888819940138303, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6128832902647577712}, {"columns": ["col1_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1681378821087865651, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6128832902647577712}, {"columns": ["col1_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2956502545619675984, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6128832902647577712}, {"columns": ["col1_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4995413789932796202, "histo_buckets": [{"distinct_range": 0, "num_eq": 4469094650563920396, "num_range": 0, "upper_bound": ""}, {"distinct_range": 1723794039475703300, "num_eq": 6547735428890268202, "num_range": 1723794039475703297, "upper_bound": "\\u0019XO22oJ%1"}, {"distinct_range": 41232759.70341191, "num_eq": 9178825296116591227, "num_range": 50000000, "upper_bound": "#[a]"}, {"distinct_range": 9362432.222741392, "num_eq": 9000000000, "num_range": 40000000, "upper_bound": "+(=\\u0019"}, {"distinct_range": 396.3243527571812, "num_eq": 1000000000, "num_range": 1000, "upper_bound": "/\\u0010i"}, {"distinct_range": 1340697628247432200, "num_eq": 6624677272523464485, "num_range": 5180423757546675911, "upper_bound": "H"}, {"distinct_range": 4566905749.682609, "num_eq": 6548489448235960211, "num_range": 10000000000, "upper_bound": "Z\\t\\u0015BV"}, {"distinct_range": 1526516152.3107867, "num_eq": 90000000000, "num_range": 2000000000, "upper_bound": "o\\u0010 \\u000f\\u001b}Q"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 0, "row_count": 6128832902647577712}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1733168337945519742, "histo_col_type": "", "name": "__auto__", "null_count": 583719498430366961, "row_count": 6128832902647577712}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2535650084560201996, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6128832902647577712}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 636521454017189858, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6128832902647577712}, {"columns": ["col1_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4913768325775271879, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6128832902647577712}]':::JSONB;
        CREATE TYPE rand_typ_0 AS ENUM ('rp', 'xoldwb', 'dpxxo', 'w', 'jgz', 'kprxgi');
        ;
    rsg_test.go:598: 
        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:600: 
    rsg_test.go:601: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith787524221
--- FAIL: TestRandomSyntaxSQLSmith (300.88s)
Reproduce

To reproduce, try:

make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1
Same failure on other branches

  • #70663 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-master]
Internal log

mjibson marked as alumn{us/a}; resolving to rafiss instead

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity avatar Dec 08 '21 06:12 cockroach-teamcity

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-21.2 @ 1bb94b40c519b775d99dffe64435f968206ced4b:

github.com/lib/pq.(*conn).simpleExec(0xc0364bb600, 0xc00f9ec6c0, 0xa2, 0x18, 0x14, 0x2, 0xc00ea77988, 0x4b7a67, 0xfe88ea)
	/go/src/github.com/cockroachdb/cockroach/vendor/github.com/lib/pq/conn.go:643 +0x1bb
github.com/lib/pq.(*conn).Exec(0xc0364bb600, 0xc00f9ec6c0, 0xa2, 0x93459f8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
	/go/src/github.com/cockroachdb/cockroach/vendor/github.com/lib/pq/conn.go:900 +0x2fa
github.com/lib/pq.(*conn).ExecContext(0xc0364bb600, 0x6abe308, 0xc00139b680, 0xc00f9ec6c0, 0xa2, 0x93459f8, 0x0, 0x0, 0x0, 0x0, ...)
	/go/src/github.com/cockroachdb/cockroach/vendor/github.com/lib/pq/conn_go18.go:43 +0x188
database/sql.ctxDriverExec(0x6abe308, 0xc00139b680, 0x7efe65f0fbb8, 0xc0364bb600, 0x0, 0x0, 0xc00f9ec6c0, 0xa2, 0x93459f8, 0x0, ...)
	/usr/local/go/src/database/sql/ctxutil.go:31 +0x22e
database/sql.(*DB).execDC.func2()
	/usr/local/go/src/database/sql/sql.go:1577 +0x1df
database/sql.withLock(0x6a708e0, 0xc00a56aab0, 0xc00ea77d28)
	/usr/local/go/src/database/sql/sql.go:3294 +0x69
database/sql.(*DB).execDC(0xc0178269c0, 0x6abe308, 0xc00139b680, 0xc00a56aab0, 0xc00ea77e50, 0xc00f9ec6c0, 0xa2, 0x0, 0x0, 0x0, ...)
	/usr/local/go/src/database/sql/sql.go:1572 +0x495
database/sql.(*DB).exec(0xc0178269c0, 0x6abe308, 0xc00139b680, 0xc00f9ec6c0, 0xa2, 0x0, 0x0, 0x0, 0xc001930f01, 0xc017b86300, ...)
	/usr/local/go/src/database/sql/sql.go:1557 +0x13c
database/sql.(*DB).ExecContext(0xc0178269c0, 0x6abe308, 0xc00139b680, 0xc00f9ec6c0, 0xa2, 0x0, 0x0, 0x0, 0x0, 0xc0544c8a01, ...)
	/usr/local/go/src/database/sql/sql.go:1535 +0xe5
github.com/cockroachdb/cockroach/pkg/sql/tests_test.(*verifyFormatDB).execWithTimeout.func2(0xc0175c61e0, 0x6abe308, 0xc00139b680, 0xc00f9ec6c0, 0xa2, 0xc05ca8d860)
	/go/src/github.com/cockroachdb/cockroach/pkg/sql/tests/rsg_test.go:152 +0x7f
created by github.com/cockroachdb/cockroach/pkg/sql/tests_test.(*verifyFormatDB).execWithTimeout
	/go/src/github.com/cockroachdb/cockroach/pkg/sql/tests/rsg_test.go:151 +0x15c

goroutine 6740457 [select]:
google.golang.org/grpc/internal/transport.(*http2Server).keepalive(0xc00eb92000)
	/go/src/github.com/cockroachdb/cockroach/vendor/google.golang.org/grpc/internal/transport/http2_server.go:1061 +0x265
created by google.golang.org/grpc/internal/transport.NewServerTransport
	/go/src/github.com/cockroachdb/cockroach/vendor/google.golang.org/grpc/internal/transport/http2_server.go:313 +0x11d5

goroutine 6926661 [select]:
github.com/lib/pq.(*conn).watchCancel.func1(0xc017b86300, 0xc0104b5440, 0xc0303e8840)
	/go/src/github.com/cockroachdb/cockroach/vendor/github.com/lib/pq/conn_go18.go:95 +0x85
created by github.com/lib/pq.(*conn).watchCancel
	/go/src/github.com/cockroachdb/cockroach/vendor/github.com/lib/pq/conn_go18.go:94 +0xa5

goroutine 6740973 [select, 1 minutes]:
github.com/cockroachdb/cockroach/pkg/kv/kvserver.(*baseQueue).addToPurgatoryLocked.func2(0x6abe3b0, 0xc01aac2840)
	/go/src/github.com/cockroachdb/cockroach/pkg/kv/kvserver/queue.go:1147 +0x30d
github.com/cockroachdb/cockroach/pkg/util/stop.(*Stopper).RunAsyncTaskEx.func2(0xc01c718280, 0x6abe3b0, 0xc01aac2840, 0x0, 0x0, 0xc01b9674e8)
	/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 6740827 [select]:
github.com/cockroachdb/cockroach/pkg/kv/kvserver.(*baseQueue).processLoop.func2(0x6abe3b0, 0xc01aac2840)
	/go/src/github.com/cockroachdb/cockroach/pkg/kv/kvserver/queue.go:807 +0x12c
github.com/cockroachdb/cockroach/pkg/util/stop.(*Stopper).RunAsyncTaskEx.func2(0xc01c718280, 0x6abe3b0, 0xc01aac2840, 0x0, 0x0, 0xc01564e1c0)
	/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
Reproduce

To reproduce, try:

make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1
Same failure on other branches

  • #70663 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-master]
Internal log

mjibson marked as alumn{us/a}; resolving to rafiss instead

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity avatar Dec 09 '21 06:12 cockroach-teamcity

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-21.2 @ 999d35029f33a9b35dde0599c952efc83ed726a7:

Random syntax error:

    rsg_test.go:779: Crash detected: server panic: pq: internal error: provided -3,-2 can be trimmed to -3 (FDs: key(9); (2)-->(1,3), (7,8)-->(9), (9)-->(7,8), (8)-->(9), (1)==(7), (7)==(1), (2)==(8), (8)==(2), (3)==(9), (9)==(3))

Query:

        SELECT
        	'22:55:42.968787+06:54:00':::TIMETZ AS col_136333,
        	79112842112805689.30:::DECIMAL AS col_136334,
        	NULL AS col_136335,
        	mod(tab_62191.crdb_internal_mvcc_timestamp::DECIMAL, tab_62191.crdb_internal_mvcc_timestamp::DECIMAL)::DECIMAL
        		AS col_136336
        FROM
        	defaultdb.public.table3@[0] AS tab_62190
        	JOIN defaultdb.public.table3@[0] AS tab_62191 ON
        			(tab_62190.col3_0) = (tab_62191.col3_0)
        			AND (tab_62190.crdb_internal_idx_expr) = (tab_62191.crdb_internal_idx_expr)
        			AND (tab_62190.col3_2) = (tab_62191.crdb_internal_idx_expr)
        			AND (tab_62190.col3_1) = (tab_62191.col3_1)
        			AND (tab_62190.col3_2) = (tab_62191.col3_2)
        WHERE
        	EXISTS(
        		SELECT
        			tab_62192._bytes AS col_136330,
        			COALESCE(
        				ARRAY['06:24:43.613761':::TIME,'23:05:25.549401':::TIME,'00:00:00':::TIME,'23:38:39.079484':::TIME],
        				ARRAY['15:03:29.099292':::TIME,'11:15:50.021786':::TIME,'10:15:19.829471':::TIME]
        			)
        				AS col_136331,
        			'0101000020E6100000AC2939F1714F45C0FAB2EC6D233741C0':::GEOGRAPHY AS col_136332
        		FROM
        			defaultdb.public.seed@seed__int8__float8__date_idx AS tab_62192
        		ORDER BY
        			tab_62192._timestamp, tab_62192._enum, tab_62192._bool
        		LIMIT
        			3:::INT8
        	)
        ORDER BY
        	tab_62191.col3_2 DESC, tab_62191.col3_1 DESC
        LIMIT
        	56:::INT8;

Schema:

    rsg_test.go:596: To reproduce, use schema:
    rsg_test.go:598: 
        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 INET NOT NULL, col1_1 REGNAMESPACE, col1_2 REGPROCEDURE, col1_3 OID NOT NULL, col1_4 BIT(40) NULL, col1_5 REGPROCEDURE, col1_6 TIMESTAMPTZ NULL, col1_7 STRING AS (lower(CAST(col1_5 AS STRING))) VIRTUAL, UNIQUE (lower(CAST(col1_4 AS STRING)) ASC, col1_0 DESC, col1_1 ASC, lower(CAST(col1_2 AS STRING)) DESC) STORING (col1_3, col1_6) WHERE (table1.col1_6 < '294276-12-31 23:59:59.999999+00:00':::TIMESTAMPTZ) OR (table1.col1_7 = e'\x00':::STRING), UNIQUE (col1_4 ASC, col1_1 DESC, col1_3 DESC, col1_2 DESC), INDEX (col1_6 DESC, col1_3 DESC), INDEX (col1_7 DESC, col1_6 ASC, col1_0, col1_3 ASC, col1_2, col1_5, col1_4 ASC, col1_1 ASC) WHERE table1.col1_6 = '3000-01-01 00:00:00+00:00':::TIMESTAMPTZ, INDEX (col1_2, col1_3, col1_6 ASC, col1_4 ASC, col1_0 ASC, col1_7, col1_5) STORING (col1_1) WHERE (table1.col1_6 < '-2000-01-01 00:00:00+00:00':::TIMESTAMPTZ) OR (table1.col1_7 < '':::STRING), INDEX (col1_1 DESC, col1_3 DESC, col1_2 ASC) WHERE (table1.col1_6 < '-2000-01-01 00:00:00+00:00':::TIMESTAMPTZ) AND (table1.col1_7 < 'X':::STRING), UNIQUE (col1_0 ASC, col1_5 ASC, col1_2, col1_7 DESC, col1_3 ASC, col1_6, col1_1 ASC) WHERE (table1.col1_7 < e'\U00002603':::STRING) OR (table1.col1_6 > '-2000-01-01 00:00:00+00:00':::TIMESTAMPTZ), INDEX (col1_4 DESC, col1_0 ASC, col1_7 DESC, col1_1 ASC, col1_5, col1_2) STORING (col1_3), FAMILY (col1_3, col1_6, col1_0, col1_2, col1_1), FAMILY (col1_4), FAMILY (col1_5));
        CREATE TABLE table2 (col2_0 TIMESTAMPTZ NOT NULL, col2_1 CHAR, PRIMARY KEY (col2_0), INDEX (col2_0 DESC));
        CREATE TABLE table3 (col3_0 NAME NOT NULL, col3_1 TIMETZ NOT NULL, PRIMARY KEY (col3_1 DESC, col3_0 ASC), col3_2 STRING NOT NULL AS (lower(CAST(col3_1 AS STRING))) VIRTUAL, UNIQUE (col3_2 ASC, col3_1 DESC, col3_0) WHERE (table3.col3_2 != e'\U00002603':::STRING) AND (table3.col3_1 < '24:00:00-15:59:00':::TIMETZ), UNIQUE (col3_2 DESC), INDEX (col3_1), INDEX (col3_0 ASC) WHERE ((table3.col3_0 < e'\x00':::STRING) OR (table3.col3_2 > '"':::STRING)) AND (table3.col3_1 = '00:00:00+15:59:00':::TIMETZ), INDEX (col3_2) WHERE ((table3.col3_2 <= e'\x00':::STRING) OR (table3.col3_1 != '24:00:00-15:59:00':::TIMETZ)) OR (table3.col3_0 = e'\x00':::STRING), UNIQUE (lower(col3_0), col3_2) WHERE ((table3.col3_2 <= '"':::STRING) OR (table3.col3_0 < e'\'':::STRING)) OR (table3.col3_1 > '00:00:00+15:59:00':::TIMETZ), UNIQUE (col3_2));
        ALTER TABLE table1 INJECT STATISTICS e'[{"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 203154099041071784, "histo_buckets": [{"distinct_range": 0, "num_eq": 8839436645607155193, "num_range": 0, "upper_bound": "0"}, {"distinct_range": 9000000, "num_eq": 1449240156004035485, "num_range": 9000000, "upper_bound": "587302789"}, {"distinct_range": 0, "num_eq": 20000000, "num_range": 80, "upper_bound": "648126068"}, {"distinct_range": 6484518104864779000, "num_eq": 7205831504367068753, "num_range": 6484518104864779006, "upper_bound": "1095364210"}, {"distinct_range": 100, "num_eq": 3483719909153921739, "num_range": 100, "upper_bound": "1568230305"}, {"distinct_range": 7254249215106451000, "num_eq": 2223168367572096120, "num_range": 7254249215106451008, "upper_bound": "1806148528"}, {"distinct_range": 6000000, "num_eq": 9000000000, "num_range": 6000000, "upper_bound": "2983203132"}, {"distinct_range": 1000000000, "num_eq": 70000000000, "num_range": 1000000000, "upper_bound": "3916180969"}, {"distinct_range": 4550630896195516400, "num_eq": 1599746123591059754, "num_range": 4550630896195516297, "upper_bound": "4004240950"}], "histo_col_type": "REGPROCEDURE", "name": "__auto__", "null_count": 2970311126792695489, "row_count": 5820028783959643288}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 197758722639907406, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 5820028783959643288}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4737093043868157107, "histo_buckets": [{"distinct_range": 0, "num_eq": 70000000000, "num_range": 0, "upper_bound": "0000000000000000000000000000000000000000"}, {"distinct_range": 200, "num_eq": 5444807676850745715, "num_range": 200, "upper_bound": "0000010010111101011110010010000101100010"}, {"distinct_range": 0, "num_eq": 6901600730062061861, "num_range": 70, "upper_bound": "0000100001100001001001111101010010011001"}, {"distinct_range": 0, "num_eq": 3985514519801618553, "num_range": 90000000000, "upper_bound": "1010000000011100011001000101101011011010"}, {"distinct_range": 0, "num_eq": 100000000000, "num_range": 50000, "upper_bound": "1100000001100101101110010001101001111110"}, {"distinct_range": 218900.08342781282, "num_eq": 5569959658021120122, "num_range": 1000000, "upper_bound": "1110100010000010011110010000010100100110"}, {"distinct_range": 3804135101981358600, "num_eq": 200, "num_range": 4647786233869827919, "upper_bound": "1111001011000100101001100010110000110111"}, {"distinct_range": 1544774336389958000, "num_eq": 100, "num_range": 2762372811066043760, "upper_bound": "1111110111110000110001010001110110001101"}], "histo_col_type": "BIT(40)", "name": "__auto__", "null_count": 972242491509980120, "row_count": 5820028783959643288}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3842532116562962937, "histo_col_type": "", "name": "__auto__", "null_count": 2678041390517138979, "row_count": 5820028783959643288}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5247135882317191098, "histo_col_type": "TIMESTAMPTZ", "name": "__auto__", "null_count": 3396801791441798013, "row_count": 5820028783959643288}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 419252218545787916, "histo_buckets": [{"distinct_range": 0, "num_eq": 2815320931078774761, "num_range": 0, "upper_bound": ""}, {"distinct_range": 0, "num_eq": 5006869432253594341, "num_range": 1574440330070605334, "upper_bound": "\\u0017~\\u0012``!q;"}, {"distinct_range": 0, "num_eq": 6000000000, "num_range": 3000, "upper_bound": "\\u001e\\u0007\\u0014"}, {"distinct_range": 0, "num_eq": 712394906072423268, "num_range": 0, "upper_bound": "P;bqO>p\\u001d"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 1439741246449941439, "row_count": 5820028783959643288}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4395290000246681934, "histo_buckets": [{"distinct_range": 0, "num_eq": 7741481904766081747, "num_range": 0, "upper_bound": "112.17.236.18/2"}, {"distinct_range": 3210389378252624400, "num_eq": 5481496839090440599, "num_range": 3210389378252624183, "upper_bound": "55.225.177.112/3"}, {"distinct_range": 0, "num_eq": 2733290839103427816, "num_range": 70000000000, "upper_bound": "44.196.177.72/7"}, {"distinct_range": 829458345565929000, "num_eq": 5406606329762847590, "num_range": 829458345565928943, "upper_bound": "79.40.125.196/20"}, {"distinct_range": 0, "num_eq": 3746718347796721520, "num_range": 60000000000, "upper_bound": "90.44.81.111/20"}, {"distinct_range": 5337630591241210000, "num_eq": 0, "num_range": 5337630591241209877, "upper_bound": "7.215.6.109/26"}, {"distinct_range": 535591554784107260, "num_eq": 1019461656908102247, "num_range": 656180480465958781, "upper_bound": "64db:1e83:3568:6c10:4dfa:1902:c9a:220f/45"}], "histo_col_type": "INET", "name": "__auto__", "null_count": 0, "row_count": 5820028783959643288}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5499671016204460916, "histo_col_type": "", "name": "__auto__", "null_count": 3403068340285081223, "row_count": 5820028783959643288}]':::JSONB;
        ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 87851715, "histo_col_type": "", "name": "__auto__", "null_count": 58445350, "row_count": 90000000}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 71505303, "histo_buckets": [{"distinct_range": 0, "num_eq": 2899969143188332192, "num_range": 0, "upper_bound": "1971-05-20 08:36:34.000915+00:00"}, {"distinct_range": 0, "num_eq": 100000, "num_range": 0, "upper_bound": "2013-07-31 17:54:31.000675+00:00"}, {"distinct_range": 0, "num_eq": 708860491330729325, "num_range": 9000000000, "upper_bound": "2028-12-17 15:20:05.000345+00:00"}], "histo_col_type": "TIMESTAMPTZ", "name": "__auto__", "null_count": 0, "row_count": 90000000}]':::JSONB;
        ALTER TABLE table3 INJECT STATISTICS e'[{"columns": ["col3_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2178095377734522832, "histo_buckets": [{"distinct_range": 0, "num_eq": 70000000, "num_range": 0, "upper_bound": "04:26:21.775585+13:42:00"}, {"distinct_range": 0, "num_eq": 0, "num_range": 3854986152353208573, "upper_bound": "05:46:12.828652+02:48:00"}, {"distinct_range": 414365.1827697958, "num_eq": 2600350693243437743, "num_range": 500000, "upper_bound": "06:31:11.459197-08:02:00"}, {"distinct_range": 0, "num_eq": 1000000000, "num_range": 0, "upper_bound": "10:40:28.043045-04:24:00"}, {"distinct_range": 10000000, "num_eq": 9000000, "num_range": 10000000, "upper_bound": "11:45:13.657638-05:24:00"}, {"distinct_range": 561725838158044100, "num_eq": 600, "num_range": 561725838158044082, "upper_bound": "24:00:00-15:59:00"}], "histo_col_type": "TIMETZ", "name": "__auto__", "null_count": 0, "row_count": 4935508558953418311}, {"columns": ["col3_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3970487219465910087, "histo_buckets": [{"distinct_range": 0, "num_eq": 3000, "num_range": 0, "upper_bound": "\\u0019\\u0012\\u000c"}, {"distinct_range": 0, "num_eq": 0, "num_range": 600000000, "upper_bound": "T\\u0012"}, {"distinct_range": 548290012.4926457, "num_eq": 6111439017269784487, "num_range": 1000000000, "upper_bound": "W"}, {"distinct_range": 0, "num_eq": 2607818290397118812, "num_range": 20, "upper_bound": "X"}, {"distinct_range": 0, "num_eq": 7054515482558932702, "num_range": 2013703180030526118, "upper_bound": "gs~dJ_\\u001f3"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 0, "row_count": 4935508558953418311}, {"columns": ["col3_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2725371525118870692, "histo_buckets": [{"distinct_range": 0, "num_eq": 3728569627368161633, "num_range": 0, "upper_bound": ""}, {"distinct_range": 50, "num_eq": 100000, "num_range": 50, "upper_bound": "5Z\\u000c+E"}, {"distinct_range": 0, "num_eq": 450689184747613903, "num_range": 0, "upper_bound": "@pz"}, {"distinct_range": 667894147979973100, "num_eq": 60000000000, "num_range": 8625647586004077668, "upper_bound": "X"}, {"distinct_range": 1740070526825056800, "num_eq": 600000000, "num_range": 3358698148713310429, "upper_bound": "c\\u0011O\\ry\\\\"}, {"distinct_range": 4542010005.905104, "num_eq": 8971024423084782046, "num_range": 5000000000, "upper_bound": "v8hh"}], "histo_col_type": "NAME", "name": "__auto__", "null_count": 0, "row_count": 4935508558953418311}]':::JSONB;
        CREATE TYPE rand_typ_0 AS ENUM ('fd');
        CREATE TYPE rand_typ_1 AS ENUM ('kdp', 'ibshde', 'zqp', 'kpqobn', 'mvsk', 'rxqsi');
        CREATE TYPE rand_typ_2 AS ENUM ('xdmr', 'wryu', 'knfq');
        ;
    rsg_test.go:598: 
        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:600: 
    rsg_test.go:601: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith018018660
--- FAIL: TestRandomSyntaxSQLSmith (335.35s)
Reproduce

To reproduce, try:

make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1
Same failure on other branches

  • #70663 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-master]
Internal log

mjibson marked as alumn{us/a}; resolving to rafiss instead

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity avatar Dec 17 '21 06:12 cockroach-teamcity

I opened the most recent failure as #73968

rytaft avatar Dec 17 '21 13:12 rytaft

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-21.2 @ 019f070929f94d692d9a0c1306050b9b1044e722:

    rsg_test.go:588: ERROR: pq: index "table2_expr_expr1_key" is a partial index that does not contain all the rows needed to execute this query
        caused by:
        SELECT
        	tab_487886.col2_3 AS col_1112247, tab_487886.col2_11 AS col_1112248
        FROM
        	defaultdb.public.table2@table2_expr_expr1_key AS tab_487886
        ORDER BY
        	tab_487886.col2_10, tab_487886.col2_4 DESC
        LIMIT
        	50:::INT8;
    rsg_test.go:588: ERROR: pq: index "table2_expr_expr1_key" is a partial index that does not contain all the rows needed to execute this query
        caused by:
        SELECT
        	3944030683:::OID AS col_1112266, '2023-01-17 10:50:18.000169':::TIMESTAMP AS col_1112267
        FROM
        	defaultdb.public.table2@table2_expr_expr1_key AS tab_487894;
    rsg_test.go:588: ERROR: pq: index "table3_expr_col3_3_expr1_col3_8_key" is a partial index that does not contain all the rows needed to execute this query
        caused by:
        WITH
        	with_198728 (col_1112282)
        		AS (SELECT * FROM (VALUES ('B':::STRING), ('1':::STRING), (']':::STRING)) AS tab_487900 (col_1112282))
        SELECT
        	count(*) AS col_1112283
        FROM
        	defaultdb.public.table3@table3_expr_col3_3_expr1_col3_8_key AS tab_487901
        GROUP BY
        	tab_487901.col3_5
        HAVING
        	bool_or(true::BOOL)::BOOL
        LIMIT
        	53:::INT8;
    rsg_test.go:588: ERROR: pq: index "table3_col3_10_col3_11_col3_5_expr_col3_0_col3_4_col3_3_col3_2_col3_6_col3_9_idx" is a partial index that does not contain all the rows needed to execute this query
        caused by:
        SELECT
        	tab_487963.col3_6 AS col_1112408
        FROM
        	defaultdb.public.table3@table3_col3_10_col3_11_col3_5_expr_col3_0_col3_4_col3_3_col3_2_col3_6_col3_9_idx
        		AS tab_487963
        WHERE
        	true;
    rsg_test.go:588: ERROR: pq: index "table3_col3_4_expr_col3_10_col3_3_col3_7_col3_11_col3_12_col3_1_col3_8_col3_0_col3_5_col3_2_key" is a partial index that does not contain all the rows needed to execute this query
        caused by:
        SELECT
        	tab_487931.col3_11 AS col_1112344, '-4713-11-24 00:00:00':::TIMESTAMP AS col_1112345
        FROM
        	defaultdb.public.seed@[0] AS tab_487930,
        	defaultdb.public.table3@table3_col3_4_expr_col3_10_col3_3_col3_7_col3_11_col3_12_col3_1_col3_8_col3_0_col3_5_col3_2_key
        		AS tab_487931
        LIMIT
        	4:::INT8;
Reproduce

To reproduce, try:

make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1
Same failure on other branches

  • #74272 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
  • #70663 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-master]
Internal log

mjibson marked as alumn{us/a}; resolving to rafiss instead

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity avatar Jan 15 '22 06:01 cockroach-teamcity

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-21.2 @ 0655d082b0d98f27e77471fcced8de94cd9327bc:

Random syntax error:

    rsg_test.go:779: Crash detected: server panic: statement exec timeout

Query:

        SELECT
        	'BOX(-0.7687866692866365 0.1362916057744734,1.3179509006362915 1.5780068341417213)':::BOX2D AS col_1076780,
        	tab_505409.col1_0 AS col_1076781,
        	NULL AS col_1076782,
        	tab_505413.tableoid AS col_1076783,
        	4.999924349809880893E+28:::DECIMAL AS col_1076784,
        	tab_505414.col2_6 AS col_1076785,
        	tab_505409.tableoid AS col_1076786,
        	e'x\x17:':::STRING AS col_1076787,
        	78801.76182013410398:::DECIMAL AS col_1076788,
        	B'001010011010101001000001000000' AS col_1076789,
        	NULL AS col_1076790,
        	tab_505413.col2_6 AS col_1076791
        FROM
        	defaultdb.public.table1@table1_col1_0_idx AS tab_505409
        	JOIN defaultdb.public.table1@[0] AS tab_505410
        		JOIN defaultdb.public.seed@[0] AS tab_505411
        			JOIN defaultdb.public.table2@[0] AS tab_505412 ON
        					(tab_505411.crdb_internal_mvcc_timestamp) = (tab_505412.crdb_internal_mvcc_timestamp)
        			JOIN defaultdb.public.table2@table2_col2_0_col2_6_col2_3_col2_5_col2_2_key AS tab_505413
        				JOIN defaultdb.public.table2@table2_col2_1_col2_3_expr_col2_4_col2_0_col2_6_col2_2_key AS tab_505414 ON
        						(tab_505413.col2_0) = (tab_505414.col2_0) ON (tab_505412.col2_0) = (tab_505414.col2_1) ON
        				(tab_505410.tableoid) = (tab_505414.tableoid)
        				AND (tab_505410.tableoid) = (tab_505413.tableoid)
        				AND (tab_505410.col1_0) = (tab_505411._uuid)
        				AND (tab_505410.crdb_internal_mvcc_timestamp) = (tab_505414.crdb_internal_mvcc_timestamp)
        				AND (tab_505410.crdb_internal_mvcc_timestamp) = (tab_505412.crdb_internal_mvcc_timestamp)
        				AND (tab_505410.crdb_internal_mvcc_timestamp) = (tab_505411._decimal)
        				AND (tab_505410.tableoid) = (tab_505411.tableoid)
        				AND (tab_505410.tableoid) = (tab_505412.tableoid)
        				AND (tab_505410.crdb_internal_mvcc_timestamp) = (tab_505413.crdb_internal_mvcc_timestamp)
        				AND (tab_505410.crdb_internal_mvcc_timestamp) = (tab_505411.crdb_internal_mvcc_timestamp)
        		JOIN defaultdb.public.seed@[0] AS tab_505415 ON
        				(tab_505411._int2) = (tab_505415._int4)
        				AND (tab_505411.tableoid) = (tab_505415.tableoid)
        				AND (tab_505411._decimal) = (tab_505415._decimal) ON (tab_505409.tableoid) = (tab_505411.tableoid)
        	JOIN defaultdb.public.table2@table2_col2_1_col2_3_expr_col2_4_col2_0_col2_6_col2_2_key AS tab_505416 ON
        			(tab_505413.col2_4) = (tab_505416.col2_2)
        	JOIN defaultdb.public.table1@[0] AS tab_505417 ON
        			(tab_505416.crdb_internal_mvcc_timestamp) = (tab_505417.crdb_internal_mvcc_timestamp)
        			AND (tab_505412.crdb_internal_mvcc_timestamp) = (tab_505417.crdb_internal_mvcc_timestamp);

Schema:

    rsg_test.go:596: To reproduce, use schema:
    rsg_test.go:598: 
        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 UUID NOT NULL, PRIMARY KEY (col1_0), UNIQUE (col1_0 ASC), INDEX (col1_0 ASC), UNIQUE (lower(CAST(col1_0 AS STRING))), UNIQUE (col1_0 DESC), INDEX (col1_0 DESC));
        CREATE TABLE table2 (col2_0 BOX2D NOT NULL, col2_1 BOX2D NOT NULL, col2_2 "char" NOT NULL, col2_3 BOX2D NOT NULL, col2_4 CHAR NOT NULL, col2_5 BIT(30) NOT NULL, PRIMARY KEY (col2_1 DESC, col2_2 DESC, col2_5, col2_0 ASC, col2_4), col2_6 STRING NOT NULL AS (lower(CAST(col2_1 AS STRING))) VIRTUAL, UNIQUE (lower(CAST(col2_1 AS STRING)) ASC, col2_2 ASC, col2_5 ASC) WHERE ((table2.col2_2 < e'\x00':::STRING) OR (table2.col2_6 <= e'\x00':::STRING)) AND (table2.col2_4 = '':::STRING), UNIQUE (col2_0 ASC, col2_6, col2_3, col2_5 DESC, col2_2 DESC) WHERE ((table2.col2_6 < e'\x00':::STRING) OR (table2.col2_4 != e'\'':::STRING)) OR (table2.col2_2 != e'\x00':::STRING), UNIQUE (col2_6 DESC, col2_5, col2_2 ASC) STORING (col2_3) WHERE (table2.col2_2 > e'\x00':::STRING) OR (table2.col2_4 >= 'X':::STRING), INDEX (col2_0 ASC) WHERE ((table2.col2_4 < '"':::STRING) AND (table2.col2_6 >= e'\x00':::STRING)) OR (table2.col2_2 < e'\U00002603':::STRING), UNIQUE (col2_1 DESC, col2_3, lower(col2_2) DESC, col2_4, col2_0 DESC, col2_6 ASC, col2_2 ASC) WHERE ((table2.col2_2 > e'\'':::STRING) AND (table2.col2_6 <= e'\'':::STRING)) OR (table2.col2_4 < e'\x00':::STRING), UNIQUE (col2_3 ASC) WHERE ((table2.col2_2 = '"':::STRING) AND (table2.col2_6 >= 'X':::STRING)) AND (table2.col2_4 > e'\x00':::STRING), FAMILY (col2_0), FAMILY (col2_5), FAMILY (col2_1), FAMILY (col2_2), FAMILY (col2_4, col2_3));
        ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 263484828, "histo_buckets": [{"distinct_range": 0, "num_eq": 3762612819182254942, "num_range": 0, "upper_bound": "00000000-0000-0000-0000-000000000000"}, {"distinct_range": 9820394.106313368, "num_eq": 2158554364396636617, "num_range": 30000000, "upper_bound": "3cde1958-b0b0-45b6-9341-3d191081fe55"}, {"distinct_range": 1310805733268297700, "num_eq": 8487002964860783617, "num_range": 1310805733268297835, "upper_bound": "61df8128-8487-4c8f-8e70-890d59011b45"}, {"distinct_range": 6140726554167565000, "num_eq": 3069078044923284072, "num_range": 7256909086465645061, "upper_bound": "bfa0bb3b-0022-4793-abf7-91c221d0bf84"}, {"distinct_range": 8895348497697240000, "num_eq": 715748877799025785, "num_range": 8895348497697239939, "upper_bound": "d2d248b1-7f9a-416a-9f65-2ac988bc945b"}, {"distinct_range": 100000000, "num_eq": 6641862592510170136, "num_range": 100000000, "upper_bound": "ffffffff-ffff-ffff-ffff-ffffffffffff"}], "histo_col_type": "UUID", "name": "__auto__", "null_count": 0, "row_count": 700000000}]':::JSONB;
        ALTER TABLE table2 INJECT STATISTICS e'[{"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2231839054873655760, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 5672970281474469819}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4018641222284240674, "histo_buckets": [{"distinct_range": 0, "num_eq": 90000, "num_range": 0, "upper_bound": "BOX(-1.3372369156010564 -1.099533047328754,0.4388701926104064 0.3994398748807266)"}, {"distinct_range": 600000, "num_eq": 8451640615509108698, "num_range": 600000, "upper_bound": "BOX(-0.9321138490239069 -1.7141502465085523,-0.8346227717207262 0.07713978052572196)"}, {"distinct_range": 20.212967463635135, "num_eq": 100000000000, "num_range": 30, "upper_bound": "BOX(-0.9215505994389799 0.45540804604643076,0.06629949139558533 0.9711493001113822)"}, {"distinct_range": 0, "num_eq": 30000000, "num_range": 8920486767966419376, "upper_bound": "BOX(-0.5018964562487993 -0.09070143925901844,0.17119936646107559 0.5320104624648225)"}, {"distinct_range": 6000, "num_eq": 1721946027119817902, "num_range": 6000, "upper_bound": "BOX(0.0469255291202082 -0.5781892069132719,0.8775930311094089 2.1756829392488664)"}, {"distinct_range": 101322.73247332928, "num_eq": 600000000, "num_range": 9000000, "upper_bound": "BOX(0.6134488615235462 -0.5647183126905555,0.6630567599642003 3.148025492492336)"}], "histo_col_type": "BOX2D", "name": "__auto__", "null_count": 0, "row_count": 5672970281474469819}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5071705677198786085, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 5672970281474469819}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2795296030651311925, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 5672970281474469819}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1116264846341896962, "histo_buckets": [{"distinct_range": 0, "num_eq": 100000000, "num_range": 0, "upper_bound": ""}, {"distinct_range": 3254494932198398500, "num_eq": 416630867555948649, "num_range": 4542538660039334983, "upper_bound": "\\u000ci"}, {"distinct_range": 9000000000, "num_eq": 0, "num_range": 9000000000, "upper_bound": "\'cV\\u001cA-<H6"}, {"distinct_range": 2381035195029970000, "num_eq": 1118841425448212814, "num_range": 2381035195029969937, "upper_bound": "\\\\\\u0001MTqW\\u000c"}, {"distinct_range": 0, "num_eq": 9000000000, "num_range": 10000, "upper_bound": "}N\\u0004];["}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 0, "row_count": 5672970281474469819}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4872817667681397486, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 5672970281474469819}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5535393154039588988, "histo_buckets": [{"distinct_range": 0, "num_eq": 2000000, "num_range": 0, "upper_bound": "BOX(-10 -10,10 10)"}, {"distinct_range": 500, "num_eq": 10000000, "num_range": 500, "upper_bound": "BOX(-1.146733062198903 -0.1368919268017753,1.2131871505809455 0.3990581508398371)"}, {"distinct_range": 0, "num_eq": 3421858406919352654, "num_range": 0, "upper_bound": "BOX(-0.7504883164915626 -0.9523223335569968,1.2366401375114418 -0.4784842757166049)"}, {"distinct_range": 3373346236316460000, "num_eq": 9000000000, "num_range": 3373346236316459802, "upper_bound": "BOX(-0.44966705094474646 -0.8664609185393463,0.675569865246305 -0.34100328128910906)"}, {"distinct_range": 3026889088506040000, "num_eq": 80, "num_range": 4763289502637288989, "upper_bound": "BOX(0.30903231293582767 0.08760389471360597,1.4852019242147763 0.4301455179348118)"}, {"distinct_range": 1864231894.4302664, "num_eq": 1980939209966321280, "num_range": 4000000000, "upper_bound": "BOX(0.3196823894502465 0.1536136043953854,0.5653752412731131 0.33206820083597166)"}, {"distinct_range": 6235018539635706000, "num_eq": 3318467598757894917, "num_range": 6863825362403430510, "upper_bound": "BOX(0.4217801029025447 -0.41015313312533247,0.7038802248652354 0.6061272201598324)"}, {"distinct_range": 7468144332146145000, "num_eq": 200000000, "num_range": 7468144332146144865, "upper_bound": "BOX(0.5351902523866069 -1.344171054129193,1.3349085268316507 1.5776769593167694)"}], "histo_col_type": "BOX2D", "name": "__auto__", "null_count": 0, "row_count": 5672970281474469819}]':::JSONB;
        CREATE TYPE rand_typ_0 AS ENUM ('hpz', 'yxre', 'snr', 'jub');
        CREATE TYPE rand_typ_1 AS ENUM ('c');
        CREATE TYPE rand_typ_2 AS ENUM ('oubf');
        CREATE TYPE rand_typ_3 AS ENUM ('gtrq', 'lafrj', 'fdbz', 'lefkhb');
        CREATE TYPE rand_typ_4 AS ENUM ('zn', 'lndbtb');
        ;
    rsg_test.go:598: 
        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:600: 
    rsg_test.go:601: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith037976285
--- FAIL: TestRandomSyntaxSQLSmith (302.29s)
Reproduce

To reproduce, try:

make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1
Same failure on other branches

  • #74272 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
  • #70663 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-master]
Internal log

mjibson marked as alumn{us/a}; resolving to rafiss instead

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity avatar Jan 19 '22 06:01 cockroach-teamcity

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-21.2 @ 36fb1109856898f2c45c247fe669dc955ccd9f48:

Random syntax error:

    rsg_test.go:779: Crash detected: server panic: pq: internal error: ordering column group (2,9) contains non-equivalent columns (op values)

Query:

        SELECT
        	tab_27974.crdb_internal_mvcc_timestamp AS col_64535,
        	(-128):::INT8 AS col_64536,
        	tab_27966.col2_1 AS col_64537,
        	true AS col_64538,
        	(-1337478434):::INT8 AS col_64539,
        	726361562:::OID AS col_64540,
        	1741649885:::INT8 AS col_64541,
        	NULL AS col_64542,
        	tab_27967.col2_1 AS col_64543
        FROM
        	defaultdb.public.table2 AS tab_27966
        	JOIN defaultdb.public.table2 AS tab_27967 ON
        			(tab_27966.col2_0) = (tab_27967.col2_0)
        			AND (tab_27966.col2_2) = (tab_27967.col2_2)
        			AND (tab_27966.col2_1) = (tab_27967.col2_1),
        	defaultdb.public.table3@table3_col3_10_col3_3_col3_7_col3_6_col3_5_col3_9_col3_0_col3_2_col3_8_col3_1_key
        		AS tab_27974
        	INNER JOIN defaultdb.public.table3@[0] AS tab_27975 ON
        			EXISTS(
        				SELECT
        					NULL AS col_64534
        				FROM
        					(
        						SELECT
        							'48 years 5 mons 485 days 04:51:59.452642':::INTERVAL AS col_64530,
        							tab_27976.col2_1 AS col_64531
        						FROM
        							defaultdb.public.table2@[0] AS tab_27976
        						WHERE
        							st_orderingequals('01060000C00400000001030000C0010000000B0000005E420BC19FCDECC1E09E96A0B5D4C3C1606CFA1225C9F4C18E46240F3259024287F161762282F7C1CE94C81235A2F7C1D3D6E1D3436DFAC18451083CE998FF4110874249900AD641CE2115F1BA7DF8C1243EF28D2C0DF9C16672B21A0CCDECC1CA9BB15D8D54F24105BBE0C83D47F1C148CC389B2CD801C26635473D3CA7F9C10EBD66E365E4F4415093C82CC9D8C5412313A5C99171F2C10A5E5C4020F2F1419CDAD3839918FB41E2CD34E038880242D0A8155AD277D0C1207A1A88C494F9410007157ECA998A4194F9F4F9849B014296EDA2B48A5A01421A49DEE69956F1417839C8A52B01D3C1C84FB0240734F041807AB4FA314ED2C178AD0697857D02C2601EE642F0D8BBC1C8C6C4FD4E4CE4416A7B9A18D411F441A8A319AA978FF341A062C8C16E73C5C1444C33CBB701E14144019406C146FD410EEEDDCBF4BBF5C15E420BC19FCDECC1E09E96A0B5D4C3C1606CFA1225C9F4C18E46240F3259024201030000C0010000000600000048082779D72DF7C1802797FB8D4ACB41240DAB8C2906F441D437A219DCC6FBC1D05E98903982C441FBD3048225DFF5C1D9F6E6F9EF4702C2C08C34B6969AD1C11C733F2EDA5CF94152600CDB660700424070D78D078EE6C17C5527A684B6F74190F13DE52B5FC741DC16DCE2D3BA01426EC39676E27DF9C1B8F3D085778BFB418091B929606F9EC1D821476E5EBAF241C41AF5440FD8D5C14AB53661254B01C248082779D72DF7C1802797FB8D4ACB41240DAB8C2906F441D437A219DCC6FBC101030000C0010000000B0000009452A2C690ADEBC1363508AE0151E4C11029FDCC3749CD4181B1EB127752F1C1C437DD70AE70F0C11D020B1EAA59F3C1139BC67C7A02F2C1A27E719A180100C2D0108F4082E7C1C1645E7490A13B02C20ED419B22C5FFA4182DF3F321AEEE5C18065A0B242DCF841CF975D0B7F4EF4C110B39D3CB39FD1C1E0363FEF90E9C5C1F82C023C4602FB41A86ACE662E48F241A43CE1C0E8FAF4C169BD55978607F5C1A2DBAD7D5FE9F14150D7061BB7CCF1418AC591AEEDD30142000810C01652AC4180145D890B21F741CEA7EBD6D2F0F741FCD0216D17B9E94100F927B904E1D6C18682C36887CBE7C17609958B410E02427843C45F57F5E841B24F7FCD03C4F6C1D49ED8BF9CE2D8C16888540B3FB5E641A81371A158A2FCC140B82CA11C8AD2418240F58BBECD00C2E897699835D6E54169C630A270D7F6C164E29EA5883BE0419452A2C690ADEBC1363508AE0151E4C11029FDCC3749CD4181B1EB127752F1C101030000C0010000000A00000042901EB5C21FF7C16DE680E05CE0F3C137B6E2E3D642F6C168E4160B5757F7C1A50F58251A98F2C1A87BC42EC3CD00C2441C64D416EFE8419A31CAC08BF4E7C1D04DC6317CB3F1C1C8AAED766FD400C27AB5872C8C0BF7C1F0992435C4DED0413816CB729149E3C1E21BA99CF38EF5C1F8E94E53D893D64108CC8988100DFC41D8CBD90AA086E34169CD5FFCA977F5C16851CC5D0C8CE1C1C7A2591D4485F1C18C5AFAEAE2F8F2412D10975269B3F6C150EEC8BAC108F741EEBC3203A4020142E023BAC195C0B1C1008AF916A6A5C341B0765C10B1C9DC41A8D7C5CF6C88FDC1422D23252D30F9C13C96236905820042344ED65CD98100C2762075167F730042AEFAABFADDF6F2C160384740E3C2B141981EECA29D44DA41B4F0E353EFC4F9C142901EB5C21FF7C16DE680E05CE0F3C137B6E2E3D642F6C168E4160B5757F7C1':::GEOMETRY::GEOMETRY, '010100000078195F417D10E841DC4C808A350AFC41':::GEOMETRY::GEOMETRY)::BOOL
        						ORDER BY
        							tab_27976.col2_2 ASC
        					)
        						AS tab_27977 (col_64532, col_64533)
        				WHERE
        					NULL
        			)
        ORDER BY
        	tab_27967.col2_1 DESC, tab_27974.col3_10 DESC;

Schema:

    rsg_test.go:596: To reproduce, use schema:
    rsg_test.go:598: 
        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 INT8, col1_1 INTERVAL NULL, col1_2 BOX2D NOT NULL, col1_3 TIMESTAMPTZ NOT NULL, col1_4 REGCLASS, col1_5 JSONB NOT NULL, col1_6 OID NOT NULL, col1_7 "char" NULL, col1_8 UUID NOT NULL, col1_9 STRING NOT NULL, col1_10 STRING NULL AS (lower(CAST(col1_1 AS STRING))) VIRTUAL, col1_11 STRING NULL AS (lower(CAST(col1_1 AS STRING))) STORED, col1_12 STRING NULL AS (lower(col1_7)) VIRTUAL, col1_13 STRING NOT NULL AS (lower(CAST(col1_8 AS STRING))) VIRTUAL, col1_14 INT8 AS (col1_0 + NULL) STORED, col1_15 STRING NULL AS (lower(CAST(col1_1 AS STRING))) STORED, col1_16 STRING NOT NULL AS (lower(col1_9)) STORED, UNIQUE (col1_9 ASC, lower(col1_7) DESC, col1_16 ASC, col1_0, col1_7 ASC) STORING (col1_2, col1_3, col1_8, col1_14), INVERTED INDEX (col1_5 ASC) WHERE ((((table1.col1_10 > e'\'':::STRING) OR (table1.col1_16 != '':::STRING)) OR (table1.col1_15 <= e'\x00':::STRING)) OR (table1.col1_13 != '"':::STRING)) AND (table1.col1_7 > e'\U00002603':::STRING), UNIQUE (lower(CAST(col1_6 AS STRING)) DESC) STORING (col1_0, col1_2, col1_4, col1_8, col1_11, col1_14, col1_15, col1_16), UNIQUE (col1_0, col1_7, col1_1, col1_4), UNIQUE (col1_0));
        CREATE TABLE table2 (col2_0 REGTYPE NOT NULL, col2_1 INT4 NOT NULL, col2_2 INTERVAL NOT NULL, PRIMARY KEY (col2_1 ASC, col2_0 ASC, col2_2), UNIQUE (col2_1 ASC, lower(CAST(col2_2 AS STRING)) DESC, col2_0) WHERE table2.col2_1 <= (-2147483648):::INT8, UNIQUE (col2_2 ASC) WHERE table2.col2_1 != (-1):::INT8, INDEX (col2_2 DESC), UNIQUE (col2_2, col2_0, col2_1) WHERE table2.col2_1 <= (-128):::INT8, INDEX (col2_0 ASC, col2_1) WHERE table2.col2_1 = 0:::INT8, INDEX (col2_0 ASC) WHERE table2.col2_1 != 1:::INT8, INDEX (col2_1 DESC, lower(CAST(col2_0 AS STRING)) DESC) WHERE table2.col2_1 <= 2147483647:::INT8, INDEX (col2_0 ASC), UNIQUE (col2_1, col2_2 DESC) WHERE table2.col2_1 != 1:::INT8);
        CREATE TABLE table3 (col3_0 INT2 NOT NULL, col3_1 DATE NOT NULL, col3_2 INT4 NULL, col3_3 DATE NOT NULL, col3_4 TIMESTAMPTZ NOT NULL, col3_5 BOOL NOT NULL, col3_6 BOOL NOT NULL, col3_7 REGPROCEDURE NOT NULL, PRIMARY KEY (col3_7 DESC, col3_4, col3_5 DESC, col3_3 DESC, col3_6 DESC, col3_1, col3_0 ASC), col3_8 INT4 NULL AS (col3_2 + col3_0) STORED, col3_9 INT4 NULL AS (col3_2 + col3_0) STORED, col3_10 INT2 NOT NULL AS (col3_0 + 27436:::INT8) VIRTUAL, UNIQUE (col3_1 DESC, col3_0 ASC, lower(CAST(col3_7 AS STRING)), col3_3 ASC, col3_8 DESC, col3_9, col3_7 ASC, col3_4 ASC) WHERE (((((((((table3.col3_0 != (-128):::INT8) OR (table3.col3_4 = '-4713-11-24 00:00:00+00:00':::TIMESTAMPTZ)) OR table3.col3_5) AND (table3.col3_8 = (-32768):::INT8)) AND (table3.col3_2 != 1:::INT8)) AND (table3.col3_1 != '-infinity':::DATE)) AND (table3.col3_3 >= 'infinity':::DATE)) OR (table3.col3_9 <= (-32768):::INT8)) AND table3.col3_6) AND (table3.col3_10 <= 1:::INT8), UNIQUE (col3_10 ASC, col3_3, col3_7 DESC, col3_6 DESC, col3_5 ASC, col3_9, col3_0 DESC, col3_2 ASC, col3_8 ASC, col3_1));
        CREATE TABLE table4 (col4_0 DECIMAL NULL, col4_1 TIMESTAMP, col4_2 CHAR NOT NULL, col4_3 OID, col4_4 STRING NOT NULL, col4_5 INT4 NULL, col4_6 REGPROCEDURE NOT NULL, col4_7 BOX2D NOT NULL, col4_8 REGPROCEDURE NULL, col4_9 STRING NOT NULL, col4_10 REGPROC NULL, col4_11 UUID NULL, col4_12 INT4 NULL, col4_13 BOX2D NULL, col4_14 UUID NOT NULL, col4_15 GEOGRAPHY NULL, PRIMARY KEY (col4_2), col4_16 STRING NULL AS (lower(CAST(col4_15 AS STRING))) STORED, col4_17 INT4 NULL AS (col4_5 + col4_12) STORED, INDEX (col4_13 DESC, col4_2 ASC, col4_0 ASC, col4_8 ASC) WHERE ((((((((table4.col4_5 != 1:::INT8) AND (table4.col4_0 >= (-1):::DECIMAL)) OR (table4.col4_1 = '0001-01-01 00:00:00':::TIMESTAMP)) AND (table4.col4_9 > 'X':::STRING)) AND (table4.col4_2 > e'\x00':::STRING)) OR (table4.col4_4 >= 'X':::STRING)) AND (table4.col4_16 = '':::STRING)) AND (table4.col4_12 <= (-32768):::INT8)) OR (table4.col4_17 >= 1:::INT8), INDEX (col4_10 DESC, col4_7 DESC, col4_12 DESC, col4_1 ASC), INDEX (col4_5, col4_2 DESC, col4_12, col4_6 DESC, col4_10, col4_8) STORING (col4_13, col4_14, col4_15, col4_17) WHERE ((((((table4.col4_5 < 32767:::INT8) AND (table4.col4_4 != e'\'':::STRING)) AND (table4.col4_0 != (-1.234E+401):::DECIMAL)) OR (table4.col4_12 <= 1:::INT8)) OR (table4.col4_1 >= '3000-01-01 00:00:00':::TIMESTAMP)) OR (table4.col4_9 >= e'\U00002603':::STRING)) OR (table4.col4_16 < '"':::STRING), INDEX (col4_8, col4_0 DESC, lower(CAST(col4_3 AS STRING)), col4_17 ASC, col4_2, col4_12 DESC) STORING (col4_4, col4_6, col4_7, col4_10, col4_11, col4_14, col4_15, col4_16) WHERE ((((((((table4.col4_16 != '"':::STRING) AND (table4.col4_0 != 'Infinity':::DECIMAL)) AND (table4.col4_9 != '"':::STRING)) OR (table4.col4_12 <= 32767:::INT8)) OR (table4.col4_2 != e'\U00002603':::STRING)) OR (table4.col4_5 >= (-1):::INT8)) OR (table4.col4_4 = 'X':::STRING)) AND (table4.col4_1 = '-4713-11-24 00:00:00':::TIMESTAMP)) OR (table4.col4_17 = (-32768):::INT8), FAMILY (col4_5), FAMILY (col4_12, col4_16), FAMILY (col4_4), FAMILY (col4_2, col4_7, col4_15, col4_14, col4_10), FAMILY (col4_0, col4_3, col4_11), FAMILY (col4_1), FAMILY (col4_8), FAMILY (col4_13), FAMILY (col4_17), FAMILY (col4_6), FAMILY (col4_9));
        CREATE TABLE table5 (col5_0 CHAR NOT NULL, col5_1 INT2 NOT NULL, col5_2 INTERVAL NOT NULL, col5_3 REGTYPE NULL, PRIMARY KEY (col5_0 ASC, col5_2 DESC, col5_1), col5_4 STRING NOT NULL AS (lower(CAST(col5_2 AS STRING))) STORED, col5_5 STRING NOT NULL AS (lower(col5_0)) VIRTUAL, INDEX (col5_1 ASC, col5_2 ASC, col5_4), UNIQUE (col5_5 ASC, col5_1 DESC, col5_3 DESC, col5_2), UNIQUE (col5_2, col5_0 DESC, col5_4 ASC, col5_5 ASC, col5_3 ASC, col5_1 ASC) WHERE (((table5.col5_4 != e'\'':::STRING) AND (table5.col5_0 < e'\x00':::STRING)) AND (table5.col5_5 != '"':::STRING)) AND (table5.col5_1 = 1:::INT8), UNIQUE (col5_2 DESC, lower(CAST(col5_2 AS STRING)) DESC, col5_3 DESC, col5_1, col5_0, col5_4 DESC) WHERE ((table5.col5_1 <= 0:::INT8) AND (table5.col5_0 = 'X':::STRING)) AND (table5.col5_4 != e'\x00':::STRING), FAMILY (col5_0), FAMILY (col5_1, col5_4), FAMILY (col5_3, col5_2));
        ALTER TABLE table1 INJECT STATISTICS e'[{"columns": ["col1_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 853946276205714748, "histo_col_type": "", "name": "__auto__", "null_count": 3998558180729549590, "row_count": 5050210536865458110}, {"columns": ["col1_16"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3766969467095871121, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 5050210536865458110}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4538116561584469505, "histo_col_type": "", "name": "__auto__", "null_count": 836210268968588613, "row_count": 5050210536865458110}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3233852299388519795, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 5050210536865458110}, {"columns": ["col1_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1744587226466405163, "histo_col_type": "", "name": "__auto__", "null_count": 1217605381165055105, "row_count": 5050210536865458110}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3456017694350572881, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 5050210536865458110}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3414572744760171872, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 5050210536865458110}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4223502703195590660, "histo_buckets": [{"distinct_range": 0, "num_eq": 7000, "num_range": 0, "upper_bound": "<}\\u001eV\\u0006"}, {"distinct_range": 704390910769993900, "num_eq": 1000, "num_range": 1406793995136551238, "upper_bound": "N+\\"M\\u0002"}, {"distinct_range": 40000000000, "num_eq": 10000, "num_range": 40000000000, "upper_bound": "X"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 0, "row_count": 5050210536865458110}, {"columns": ["col1_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3324274908356792680, "histo_col_type": "", "name": "__auto__", "null_count": 2601650116355566507, "row_count": 5050210536865458110}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4276250543914908125, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 5050210536865458110}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2540628655565825457, "histo_col_type": "", "name": "__auto__", "null_count": 1122705620056465229, "row_count": 5050210536865458110}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1769166465009768749, "histo_col_type": "", "name": "__auto__", "null_count": 1800245593235460678, "row_count": 5050210536865458110}, {"columns": ["col1_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 838534704826335409, "histo_col_type": "", "name": "__auto__", "null_count": 1405236125524590475, "row_count": 5050210536865458110}, {"columns": ["col1_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4243861580316664516, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 5050210536865458110}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 701387947759898558, "histo_col_type": "", "name": "__auto__", "null_count": 823225118420088968, "row_count": 5050210536865458110}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1710273057093231233, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 5050210536865458110}, {"columns": ["col1_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4871642699798951140, "histo_col_type": "", "name": "__auto__", "null_count": 3033308359379790241, "row_count": 5050210536865458110}]':::JSONB;
        ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 112989651798062635, "histo_buckets": [{"distinct_range": 0, "num_eq": 8000, "num_range": 0, "upper_bound": "45854337"}, {"distinct_range": 3709267702298855000, "num_eq": 20, "num_range": 3709267702298854755, "upper_bound": "2470400457"}, {"distinct_range": 6810980802330233000, "num_eq": 5000, "num_range": 7117252818319751647, "upper_bound": "3450013373"}], "histo_col_type": "REGTYPE", "name": "__auto__", "null_count": 0, "row_count": 1019988571488767496}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 761085658982333338, "histo_buckets": [{"distinct_range": 0, "num_eq": 1339200736983275647, "num_range": 0, "upper_bound": "-1996183703"}, {"distinct_range": 400000000, "num_eq": 300000, "num_range": 400000000, "upper_bound": "-1657041102"}, {"distinct_range": 800000, "num_eq": 800000, "num_range": 800000, "upper_bound": "-311438532"}, {"distinct_range": 5900003746540327000, "num_eq": 2909345611966043712, "num_range": 8465851129914351709, "upper_bound": "-217563260"}, {"distinct_range": 0, "num_eq": 10000, "num_range": 5991405701919816884, "upper_bound": "1"}, {"distinct_range": 1922442875236447000, "num_eq": 1870844936813122107, "num_range": 6286839882375189637, "upper_bound": "140583492"}, {"distinct_range": 6000, "num_eq": 7707874056474546150, "num_range": 6000, "upper_bound": "1044730637"}, {"distinct_range": 666.7372430161838, "num_eq": 3045428506040845069, "num_range": 700, "upper_bound": "1176826688"}], "histo_col_type": "INT4", "name": "__auto__", "null_count": 0, "row_count": 1019988571488767496}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 767550809222329286, "histo_buckets": [{"distinct_range": 0, "num_eq": 8165164608559392506, "num_range": 0, "upper_bound": "-61 years -10 mons -325 days -11:58:22.263066"}, {"distinct_range": 0, "num_eq": 300, "num_range": 0, "upper_bound": "-11 years -11 mons -917 days -08:35:58.268457"}, {"distinct_range": 390970.05693130044, "num_eq": 800000000, "num_range": 6000000, "upper_bound": "2 years 10 mons 547 days 01:11:15.421754"}], "histo_col_type": "INTERVAL", "name": "__auto__", "null_count": 0, "row_count": 1019988571488767496}]':::JSONB;
        ALTER TABLE table3 INJECT STATISTICS '[{"columns": ["col3_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4805560, "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": 5542924, "histo_col_type": "", "name": "__auto__", "null_count": 5533169, "row_count": 10000000}, {"columns": ["col3_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5240035, "histo_col_type": "", "name": "__auto__", "null_count": 6443984, "row_count": 10000000}, {"columns": ["col3_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4791420, "histo_col_type": "INT2", "name": "__auto__", "null_count": 0, "row_count": 10000000}, {"columns": ["col3_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7086414, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 10000000}, {"columns": ["col3_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6833521, "histo_buckets": [{"distinct_range": 0, "num_eq": 4234807031608951047, "num_range": 0, "upper_bound": "4714-11-24 BC"}, {"distinct_range": 100, "num_eq": 800000000, "num_range": 100, "upper_bound": "1976-01-12"}, {"distinct_range": 200, "num_eq": 0, "num_range": 200, "upper_bound": "1976-02-11"}, {"distinct_range": 3581229645052274700, "num_eq": 4730336703850843536, "num_range": 3581229645052274836, "upper_bound": "1979-01-25"}, {"distinct_range": 4000000000, "num_eq": 20000, "num_range": 4000000000, "upper_bound": "1982-02-23"}, {"distinct_range": 1038475347520285400, "num_eq": 1000000000, "num_range": 1887311201312422213, "upper_bound": "1983-04-16"}, {"distinct_range": 3080736920650005000, "num_eq": 6097077149126165255, "num_range": 3080736920650005245, "upper_bound": "1986-03-20"}], "histo_col_type": "DATE", "name": "__auto__", "null_count": 0, "row_count": 10000000}, {"columns": ["col3_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7986942, "histo_col_type": "", "name": "__auto__", "null_count": 680358, "row_count": 10000000}, {"columns": ["col3_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 8419992, "histo_buckets": [{"distinct_range": 0, "num_eq": 300000, "num_range": 0, "upper_bound": "778164506"}, {"distinct_range": 1000000, "num_eq": 0, "num_range": 1000000, "upper_bound": "847762552"}], "histo_col_type": "REGPROCEDURE", "name": "__auto__", "null_count": 0, "row_count": 10000000}, {"columns": ["col3_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2481337, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 10000000}, {"columns": ["col3_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3605041, "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": 8432466, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 10000000}]':::JSONB;
        ALTER TABLE table4 INJECT STATISTICS '[{"columns": ["col4_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 400021196951254894, "histo_buckets": [{"distinct_range": 0, "num_eq": 700, "num_range": 0, "upper_bound": "BOX(-2.2938781571518794 -0.6413619740007339,1.0267666045167299 -0.09726710807731517)"}, {"distinct_range": 1647798124244018200, "num_eq": 100000, "num_range": 8612509545601795568, "upper_bound": "BOX(-2.1960295077890315 0.7007378005538102,1.65242428503348 2.081743774290309)"}, {"distinct_range": 190675.7862868057, "num_eq": 4866573855233430361, "num_range": 400000, "upper_bound": "BOX(-1.0113427040980378 -0.48195941008974663,0.7008757078836689 0.7510133958234366)"}, {"distinct_range": 0, "num_eq": 7000000, "num_range": 2211404839439018760, "upper_bound": "BOX(-0.7734658658236672 -0.129143444307664,-0.7601324621108105 -0.04835935826817539)"}, {"distinct_range": 179771.12213956713, "num_eq": 6195003429067153436, "num_range": 1000000, "upper_bound": "BOX(-0.7710448368184648 -0.49909591596495784,0.16704566470128457 0.034836035572304)"}, {"distinct_range": 0, "num_eq": 0, "num_range": 987627503321175584, "upper_bound": "BOX(-0.5954594710547267 -0.6254396843358289,-0.22464608163849445 1.0196177778581794)"}, {"distinct_range": 1018789098815353200, "num_eq": 3000000, "num_range": 5821761030012587474, "upper_bound": "BOX(0.12452240295879607 -1.4821392836882936,0.8673937623298407 1.3603516221240588)"}], "histo_col_type": "BOX2D", "name": "__auto__", "null_count": 8014580258227156, "row_count": 544328043827919972}, {"columns": ["col4_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 25735812635924602, "histo_col_type": "", "name": "__auto__", "null_count": 440590322980137674, "row_count": 544328043827919972}, {"columns": ["col4_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 213741664637748828, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 544328043827919972}, {"columns": ["col4_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 205198426223036055, "histo_col_type": "", "name": "__auto__", "null_count": 237263005932047522, "row_count": 544328043827919972}, {"columns": ["col4_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 71743857690292485, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 544328043827919972}, {"columns": ["col4_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 399629453770635460, "histo_col_type": "", "name": "__auto__", "null_count": 400110513067215696, "row_count": 544328043827919972}, {"columns": ["col4_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 316456110432131708, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 544328043827919972}, {"columns": ["col4_17"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 391119269456841295, "histo_col_type": "", "name": "__auto__", "null_count": 271336185996941355, "row_count": 544328043827919972}, {"columns": ["col4_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 243695912949966650, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 544328043827919972}, {"columns": ["col4_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 458392592655677483, "histo_col_type": "", "name": "__auto__", "null_count": 383342713959931942, "row_count": 544328043827919972}, {"columns": ["col4_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 81145519813957132, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 544328043827919972}, {"columns": ["col4_16"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 71824835578409168, "histo_col_type": "", "name": "__auto__", "null_count": 69485749514912604, "row_count": 544328043827919972}, {"columns": ["col4_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 357301247657525843, "histo_col_type": "", "name": "__auto__", "null_count": 395300100523623765, "row_count": 544328043827919972}, {"columns": ["col4_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 126296320008091125, "histo_buckets": [{"distinct_range": 0, "num_eq": 1161555607387678055, "num_range": 0, "upper_bound": "-1659470752"}, {"distinct_range": 1420610308346660900, "num_eq": 5000000, "num_range": 5198847810202203248, "upper_bound": "-1600911183"}, {"distinct_range": 0, "num_eq": 0, "num_range": 100000000, "upper_bound": "-1498257264"}, {"distinct_range": 0, "num_eq": 8711787425222063666, "num_range": 30, "upper_bound": "195275593"}], "histo_col_type": "INT4", "name": "__auto__", "null_count": 243947310031169113, "row_count": 544328043827919972}, {"columns": ["col4_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 174186328003133457, "histo_buckets": [{"distinct_range": 0, "num_eq": 900000000, "num_range": 0, "upper_bound": "409773674"}, {"distinct_range": 200000, "num_eq": 5000000000, "num_range": 200000, "upper_bound": "723458694"}, {"distinct_range": 1925825302407181300, "num_eq": 6000, "num_range": 7006947122016819873, "upper_bound": "1069374117"}, {"distinct_range": 0, "num_eq": 8976582244556224585, "num_range": 0, "upper_bound": "1487720041"}, {"distinct_range": 0, "num_eq": 6843753997052258616, "num_range": 6084318207842045693, "upper_bound": "3924562109"}, {"distinct_range": 0, "num_eq": 6000000000, "num_range": 0, "upper_bound": "4287888570"}], "histo_col_type": "REGPROC", "name": "__auto__", "null_count": 380094277179058767, "row_count": 544328043827919972}, {"columns": ["col4_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 228675505413730520, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 544328043827919972}, {"columns": ["col4_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 223751670484563198, "histo_buckets": [{"distinct_range": 0, "num_eq": 90, "num_range": 0, "upper_bound": "253188358"}, {"distinct_range": 5674318274759891000, "num_eq": 100000, "num_range": 5674318274759891423, "upper_bound": "618982143"}], "histo_col_type": "REGPROCEDURE", "name": "__auto__", "null_count": 528262550836403069, "row_count": 544328043827919972}, {"columns": ["col4_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 298838665380658592, "histo_col_type": "", "name": "__auto__", "null_count": 167000557408670656, "row_count": 544328043827919972}]':::JSONB;
        ALTER TABLE table5 INJECT STATISTICS e'[{"columns": ["col5_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 309396034178876073, "histo_buckets": [{"distinct_range": 0, "num_eq": 4586560371261296455, "num_range": 0, "upper_bound": "-47 years -10 mons -629 days -08:37:47.063904"}, {"distinct_range": 0, "num_eq": 90000000, "num_range": 3315080032340134230, "upper_bound": "-6 years -3 mons -55 days -14:32:01.637352"}, {"distinct_range": 0, "num_eq": 40000000000, "num_range": 6471402806924455432, "upper_bound": "33 years 7 mons 169 days 23:09:39.149738"}, {"distinct_range": 1000, "num_eq": 2032859733087684073, "num_range": 1000, "upper_bound": "290 years"}], "histo_col_type": "INTERVAL", "name": "__auto__", "null_count": 0, "row_count": 711361871263473643}, {"columns": ["col5_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 262710354502548963, "histo_col_type": "", "name": "__auto__", "null_count": 488159153443838229, "row_count": 711361871263473643}, {"columns": ["col5_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 337570772756424773, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 711361871263473643}, {"columns": ["col5_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 644378959741068563, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 711361871263473643}, {"columns": ["col5_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 277207480894350953, "histo_buckets": [{"distinct_range": 0, "num_eq": 400000, "num_range": 0, "upper_bound": ""}, {"distinct_range": 70000, "num_eq": 5603004623979434946, "num_range": 70000, "upper_bound": "\\u001d"}, {"distinct_range": 0, "num_eq": 3000000, "num_range": 1000000, "upper_bound": "M"}, {"distinct_range": 0, "num_eq": 3000000000, "num_range": 600, "upper_bound": "m"}, {"distinct_range": 0, "num_eq": 4851748924989627030, "num_range": 7636339208690383359, "upper_bound": "o"}], "histo_col_type": "CHAR", "name": "__auto__", "null_count": 0, "row_count": 711361871263473643}, {"columns": ["col5_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 172291948392069045, "histo_buckets": [{"distinct_range": 0, "num_eq": 60000000, "num_range": 0, "upper_bound": "19776"}], "histo_col_type": "INT2", "name": "__auto__", "null_count": 0, "row_count": 711361871263473643}]':::JSONB;
        ALTER TABLE table5 ADD FOREIGN KEY (col5_1, col5_0, col5_2, col5_3) REFERENCES table1 (col1_0, col1_7, col1_1, col1_4);
        ALTER TABLE table3 ADD FOREIGN KEY (col3_0) REFERENCES table1 (col1_0) ON DELETE RESTRICT ON UPDATE RESTRICT;
        CREATE TYPE rand_typ_0 AS ENUM ('sivuib');
        CREATE TYPE rand_typ_1 AS ENUM ('stphl', 'c', 'scu', 'ak');
        ;
    rsg_test.go:598: 
        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:600: 
    rsg_test.go:601: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith898734634
--- FAIL: TestRandomSyntaxSQLSmith (365.43s)
Reproduce

To reproduce, try:

make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1
Same failure on other branches

  • #74272 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
  • #70663 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-master]
Internal log

mjibson marked as alumn{us/a}; resolving to rafiss instead

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity avatar Jan 20 '22 06:01 cockroach-teamcity

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-21.2 @ 74346c2b0bf49d40d044d78a9a10a0ce88188469:


goroutine 6974388 [sync.Cond.Wait]:
sync.runtime_notifyListWait(0xc01a47a090, 0xc00000065d)
	/usr/local/go/src/runtime/sema.go:513 +0xf8
sync.(*Cond).Wait(0xc01a47a080)
	/usr/local/go/src/sync/cond.go:56 +0x99
github.com/cockroachdb/cockroach/pkg/kv/kvserver.(*raftScheduler).worker(0xc00db0a0a0, 0x6afaa30, 0xc02735cfc0)
	/go/src/github.com/cockroachdb/cockroach/pkg/kv/kvserver/scheduler.go:251 +0x8b
github.com/cockroachdb/cockroach/pkg/util/stop.(*Stopper).RunAsyncTaskEx.func2(0xc0108d0280, 0x6afaa30, 0xc02735cfc0, 0x0, 0x0, 0xc026b5c130)
	/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 6974295 [chan receive]:
github.com/cockroachdb/pebble.(*tableCacheShard).releaseLoop.func1(0x6afaa30, 0xc020c7e300)
	/go/src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/pebble/table_cache.go:175 +0x76
runtime/pprof.Do(0x6afa9c0, 0xc020c7e300, 0xc000456140, 0x1, 0x1, 0xc00367efb8)
	/usr/local/go/src/runtime/pprof/runtime.go:40 +0xcf
github.com/cockroachdb/pebble.(*tableCacheShard).releaseLoop(0xc01a13c700)
	/go/src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/pebble/table_cache.go:174 +0x89
created by github.com/cockroachdb/pebble.(*tableCacheShard).init
	/go/src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/pebble/table_cache.go:166 +0x1a5

goroutine 6974420 [sync.Cond.Wait]:
sync.runtime_notifyListWait(0xc01a47a090, 0xc000000634)
	/usr/local/go/src/runtime/sema.go:513 +0xf8
sync.(*Cond).Wait(0xc01a47a080)
	/usr/local/go/src/sync/cond.go:56 +0x99
github.com/cockroachdb/cockroach/pkg/kv/kvserver.(*raftScheduler).worker(0xc00db0a0a0, 0x6afaa30, 0xc02735cfc0)
	/go/src/github.com/cockroachdb/cockroach/pkg/kv/kvserver/scheduler.go:251 +0x8b
github.com/cockroachdb/cockroach/pkg/util/stop.(*Stopper).RunAsyncTaskEx.func2(0xc0108d0280, 0x6afaa30, 0xc02735cfc0, 0x0, 0x0, 0xc026b5c330)
	/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 6974288 [select]:
github.com/cockroachdb/cockroach/pkg/gossip.newInfoStore.func1(0x6afa9c0, 0xc000074108)
	/go/src/github.com/cockroachdb/cockroach/pkg/gossip/infostore.go:190 +0x14d
github.com/cockroachdb/cockroach/pkg/util/stop.(*Stopper).RunAsyncTaskEx.func2(0xc0108d0280, 0x6afa9c0, 0xc000074108, 0x0, 0x0, 0xc00c839ec0)
	/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 6974322 [select]:
github.com/cockroachdb/cockroach/pkg/sql.(*DistSQLPlanner).initCancelingWorkers.func1(0x6afaa30, 0xc00617cde0)
	/go/src/github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:134 +0xc7
github.com/cockroachdb/cockroach/pkg/util/stop.(*Stopper).RunAsyncTaskEx.func2(0xc0108d0280, 0x6afaa30, 0xc00617cde0, 0x0, 0x0, 0xc02c434a20)
	/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
Reproduce

To reproduce, try:

make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1
Same failure on other branches

  • #74272 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
  • #70663 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-master]
Internal log

mjibson marked as alumn{us/a}; resolving to rafiss instead

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity avatar Jan 21 '22 06:01 cockroach-teamcity

The most recent failure is also panic: statement exec timeout. I cannot reproduce the one before that.

rytaft avatar Jan 21 '22 20:01 rytaft

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-21.2 @ 1c74602223ae3815f20fb9b261b9405ae1a7ce51:

Random syntax error:

    rsg_test.go:779: Crash detected: server panic: statement exec timeout

Query:

        SELECT
        	DISTINCT
        	B'000001110110111010' AS col_286888,
        	tab_135708.crdb_internal_mvcc_timestamp AS col_286889,
        	'12:07:26.509747+04:33:00':::TIMETZ AS col_286890,
        	st_distance(st_geogfromtext(tab_135708.col1_2::STRING)::GEOGRAPHY::GEOGRAPHY, NULL::GEOGRAPHY, true::BOOL)::FLOAT8
        		AS col_286891,
        	NULL AS col_286892,
        	'BOX(0.4946988820271053 -1.3256647991736106,0.5548792009269983 0.5174333510458993)':::BOX2D AS col_286893,
        	'_':::STRING AS col_286894,
        	0.9486301449449164:::FLOAT8 AS col_286895,
        	tab_135710.crdb_internal_mvcc_timestamp AS col_286896,
        	tab_135708.col1_3 AS col_286897,
        	NULL AS col_286898,
        	tab_135714.col1_0 AS col_286899,
        	tab_135712.col2_0 AS col_286900,
        	tab_135713.tableoid AS col_286901,
        	tab_135713.col2_0 AS col_286902,
        	(-0.47935305400257683):::FLOAT8 AS col_286903
        FROM
        	defaultdb.public.table1@[0] AS tab_135708
        	JOIN defaultdb.public.table2@[0] AS tab_135709
        		JOIN defaultdb.public.table3@[0] AS tab_135710 ON (tab_135709.tableoid) = (tab_135710.tableoid)
        		JOIN defaultdb.public.table2@[0] AS tab_135711 ON
        				(tab_135710.crdb_internal_mvcc_timestamp) = (tab_135711.crdb_internal_mvcc_timestamp)
        				AND (tab_135709.tableoid) = (tab_135711.tableoid)
        				AND (tab_135709.col2_1) = (tab_135711.col2_1)
        				AND (tab_135709.col2_0) = (tab_135711.col2_0)
        		JOIN defaultdb.public.table2@[0] AS tab_135712
        			JOIN defaultdb.public.table2@table2_col2_1_col2_0_idx AS tab_135713 ON
        					(tab_135712.tableoid) = (tab_135713.tableoid)
        			JOIN defaultdb.public.table1@[0] AS tab_135714 ON
        					(tab_135713.tableoid) = (tab_135714.tableoid)
        					AND (tab_135712.crdb_internal_mvcc_timestamp) = (tab_135714.crdb_internal_mvcc_timestamp) ON
        				(tab_135709.tableoid) = (tab_135713.tableoid) AND (tab_135710.col3_3) = (tab_135714.col1_2)
        		JOIN defaultdb.public.table2@primary AS tab_135716 ON (tab_135713.tableoid) = (tab_135716.tableoid) ON
        			(tab_135708.col1_0) = (tab_135711.tableoid) AND (tab_135708.tableoid) = (tab_135711.tableoid)
        	JOIN defaultdb.public.table2@table2_col2_0_idx AS tab_135717 ON
        			(tab_135716.crdb_internal_mvcc_timestamp) = (tab_135717.crdb_internal_mvcc_timestamp)
        LIMIT
        	92:::INT8;

Schema:

    rsg_test.go:596: To reproduce, use schema:
    rsg_test.go:598: 
        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 BOX2D NULL, col1_2 "char" NOT NULL, PRIMARY KEY (col1_0 DESC, col1_2 ASC), col1_3 STRING NOT NULL AS (CASE WHEN col1_0 IS NULL THEN 'x':::STRING ELSE e'9R\x0f\x12\x13\'5&V':::STRING END) VIRTUAL, col1_4 STRING NOT NULL AS (CASE WHEN col1_0 IS NULL THEN e'\x03dQ\x1d':::STRING ELSE '``d_S>B_L':::STRING END) VIRTUAL, INDEX (col1_2 ASC, col1_3 ASC, col1_4 ASC, col1_1 ASC), UNIQUE (col1_0 ASC, col1_2 ASC) STORING (col1_1) WHERE ((table1.col1_2 > e'\x00':::STRING) OR (table1.col1_4 = 'X':::STRING)) OR (table1.col1_3 < '"':::STRING), FAMILY (col1_2, col1_0), FAMILY (col1_1));
        CREATE TABLE table2 (col2_0 BIT(18) NOT NULL, col2_1 FLOAT8 NOT NULL, PRIMARY KEY (col2_1 DESC, col2_0 ASC), INDEX (col2_1, col2_0 DESC) WHERE table2.col2_1 <= '-Inf':::FLOAT8, INDEX (col2_0 DESC), UNIQUE (col2_0 DESC, col2_1 DESC) WHERE table2.col2_1 < (-1.0):::FLOAT8, INDEX (col2_0 DESC, col2_1 DESC), UNIQUE (col2_1, col2_0) WHERE table2.col2_1 > 'NaN':::FLOAT8, INDEX (col2_0 DESC, (col2_1 + (-1.1136186032886495):::FLOAT8) ASC), INDEX (lower(CAST(col2_0 AS STRING)) ASC) WHERE table2.col2_1 != 1.0:::FLOAT8, FAMILY (col2_0), FAMILY (col2_1));
        CREATE TABLE table3 (col3_0 TIMETZ NOT NULL, col3_1 UUID NOT NULL, col3_2 TIMETZ NOT NULL, col3_3 VARCHAR NOT NULL, PRIMARY KEY (col3_2, col3_1, col3_3 ASC, col3_0 ASC), UNIQUE (col3_0 DESC, col3_3 DESC, col3_2) WHERE table3.col3_0 != '24:00:00-15:59:00':::TIMETZ, UNIQUE (col3_1 DESC, col3_3 DESC, col3_2 DESC) WHERE (table3.col3_2 <= '00:00:00+15:59:00':::TIMETZ) OR (table3.col3_0 = '24:00:00-15:59:00':::TIMETZ), UNIQUE (col3_3, col3_1 DESC) WHERE ((table3.col3_3 != e'\x00':::STRING) AND (table3.col3_0 != '00:00:00+15:59:00':::TIMETZ)) AND (table3.col3_2 >= '24:00:00-15:59:00':::TIMETZ), UNIQUE (col3_2, lower(CAST(col3_1 AS STRING)) ASC) WHERE ((table3.col3_2 = '24:00:00-15:59:00':::TIMETZ) AND (table3.col3_0 = '24:00:00-15:59:00':::TIMETZ)) AND (table3.col3_3 <= 'X':::STRING), INDEX (col3_0 DESC, col3_2, col3_1 ASC, col3_3 ASC) WHERE table3.col3_3 > 'X':::STRING, INDEX (col3_0 ASC) WHERE (table3.col3_2 < '00:00:00+15:59:00':::TIMETZ) OR (table3.col3_0 <= '00:00:00+15:59:00':::TIMETZ));
        ALTER TABLE table1 INJECT STATISTICS e'[{"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5851211429800642322, "histo_buckets": [{"distinct_range": 0, "num_eq": 8000000000, "num_range": 0, "upper_bound": "0"}, {"distinct_range": 0, "num_eq": 20000000, "num_range": 6248387328695548016, "upper_bound": "776347081"}, {"distinct_range": 0, "num_eq": 70000000000, "num_range": 700000000, "upper_bound": "970797823"}, {"distinct_range": 90000000, "num_eq": 516226032649342198, "num_range": 90000000, "upper_bound": "988252964"}], "histo_col_type": "REGNAMESPACE", "name": "__auto__", "null_count": 0, "row_count": 6005362747728853962}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4361233265477387579, "histo_col_type": "", "name": "__auto__", "null_count": 1597779688674263777, "row_count": 6005362747728853962}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3850163109961125060, "histo_buckets": [{"distinct_range": 0, "num_eq": 800, "num_range": 0, "upper_bound": "*"}, {"distinct_range": 0, "num_eq": 2711090678285067326, "num_range": 0, "upper_bound": ","}, {"distinct_range": 100, "num_eq": 581694379105590360, "num_range": 100, "upper_bound": "i"}], "histo_col_type": "\\"char\\"", "name": "__auto__", "null_count": 0, "row_count": 6005362747728853962}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1752043864232202798, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6005362747728853962}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4454741295682314765, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6005362747728853962}]':::JSONB;
        ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6301075831246397129, "histo_buckets": [{"distinct_range": 0, "num_eq": 2208913410707700766, "num_range": 0, "upper_bound": "-0.9444254270205452"}, {"distinct_range": 60160864.88615447, "num_eq": 5332666800259356978, "num_range": 20000000000, "upper_bound": "-0.8003145741894044"}, {"distinct_range": 3000000, "num_eq": 5200138956347166504, "num_range": 3000000, "upper_bound": "-0.7341121214333954"}, {"distinct_range": 20000000, "num_eq": 1066462890027224896, "num_range": 20000000, "upper_bound": "-0.027058325285534424"}, {"distinct_range": 0, "num_eq": 70000, "num_range": 400, "upper_bound": "0.3272828045040921"}, {"distinct_range": 10000, "num_eq": 1000000000, "num_range": 10000, "upper_bound": "0.38022274622157803"}, {"distinct_range": 0, "num_eq": 3711665739260960003, "num_range": 7166852378055936057, "upper_bound": "0.5911600922191537"}, {"distinct_range": 460728.952249311, "num_eq": 30, "num_range": 1000000, "upper_bound": "0.7302503272398081"}, {"distinct_range": 4200.364461978531, "num_eq": 3000000, "num_range": 8000, "upper_bound": "0.9128248224080584"}], "histo_col_type": "FLOAT8", "name": "__auto__", "null_count": 0, "row_count": 6830752330340314871}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2938537423517939974, "histo_buckets": [{"distinct_range": 0, "num_eq": 2000000, "num_range": 0, "upper_bound": "000011100001100001"}, {"distinct_range": 0, "num_eq": 1856045739516798924, "num_range": 5300849287322308966, "upper_bound": "010001001111011001"}, {"distinct_range": 134753495087427980, "num_eq": 2659282664828555259, "num_range": 2850153106737961489, "upper_bound": "011010000001101101"}, {"distinct_range": 1000, "num_eq": 8433065372979427154, "num_range": 1000, "upper_bound": "100010110000101111"}, {"distinct_range": 2118214.4982617362, "num_eq": 2000000, "num_range": 7000000, "upper_bound": "110010100010010100"}], "histo_col_type": "BIT(18)", "name": "__auto__", "null_count": 0, "row_count": 6830752330340314871}]':::JSONB;
        ALTER TABLE table3 INJECT STATISTICS e'[{"columns": ["col3_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 41642889, "histo_buckets": [{"distinct_range": 0, "num_eq": 400000, "num_range": 0, "upper_bound": "0d2da470-5e9e-4089-b6df-d220600c7856"}, {"distinct_range": 221772926876790720, "num_eq": 900, "num_range": 221772926876790721, "upper_bound": "6684de44-2615-4dfb-82bf-0a9d7ac2bd10"}, {"distinct_range": 451039.4589923867, "num_eq": 1000, "num_range": 6000000, "upper_bound": "865e5991-8234-4496-8561-f6324a92932c"}], "histo_col_type": "UUID", "name": "__auto__", "null_count": 0, "row_count": 60000000}, {"columns": ["col3_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 26803049, "histo_buckets": [{"distinct_range": 0, "num_eq": 800000000, "num_range": 0, "upper_bound": "18:39:05.247528-11:19:00"}, {"distinct_range": 0, "num_eq": 90000, "num_range": 5000, "upper_bound": "21:14:08.194794-10:54:00"}], "histo_col_type": "TIMETZ", "name": "__auto__", "null_count": 0, "row_count": 60000000}, {"columns": ["col3_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 18978665, "histo_buckets": [{"distinct_range": 0, "num_eq": 430063251010284443, "num_range": 0, "upper_bound": "G6r"}, {"distinct_range": 382013621919023900, "num_eq": 6144453740685121611, "num_range": 5313045912003141386, "upper_bound": "d\x7f.<b"}], "histo_col_type": "VARCHAR", "name": "__auto__", "null_count": 0, "row_count": 60000000}, {"columns": ["col3_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 33749182, "histo_buckets": [{"distinct_range": 0, "num_eq": 5793618524386103643, "num_range": 0, "upper_bound": "13:24:09.825567+13:30:00"}, {"distinct_range": 0, "num_eq": 800000000, "num_range": 5060842872479623715, "upper_bound": "01:09:36.096244-05:41:00"}, {"distinct_range": 0, "num_eq": 5628764477195741881, "num_range": 500, "upper_bound": "16:48:46.941035+00:42:00"}, {"distinct_range": 0, "num_eq": 8503474152061177978, "num_range": 7478229839378148220, "upper_bound": "17:50:18.504197-03:09:00"}, {"distinct_range": 5098224781501166000, "num_eq": 8777823826357522868, "num_range": 5098224781501165907, "upper_bound": "21:08:55.959469-12:59:00"}], "histo_col_type": "TIMETZ", "name": "__auto__", "null_count": 0, "row_count": 60000000}]':::JSONB;
        CREATE TYPE rand_typ_0 AS ENUM ('mu', 'zmvq', 'gpjptm', 'rr', 'n');
        CREATE TYPE rand_typ_1 AS ENUM ('en', 'uvufek');
        CREATE TYPE rand_typ_2 AS ENUM ('e', 'nozdk', 'yyal', 'eh', 'ffimxq');
        CREATE TYPE rand_typ_3 AS ENUM ('u', 'sas', 'wbfqc');
        ;
    rsg_test.go:598: 
        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:600: 
    rsg_test.go:601: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith138485358
--- FAIL: TestRandomSyntaxSQLSmith (309.10s)
Reproduce

To reproduce, try:

make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1
Same failure on other branches

  • #74272 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
  • #70663 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-master]
Internal log

mjibson marked as alumn{us/a}; resolving to rafiss instead

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity avatar Jan 22 '22 06:01 cockroach-teamcity

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-21.2 @ ea903ef55abfbbdd8fd963fc7ce5975324d238e5:

Random syntax error:

    rsg_test.go:779: Crash detected: server panic: statement exec timeout

Query:

        SELECT
        	tab_113304.col2_14 AS col_266998, NULL AS col_266999, 'fa6e44fc-5ca2-4e70-ac4f-88e620d4ebb8':::UUID AS col_267000
        FROM
        	defaultdb.public.table3@[0] AS tab_113298
        	JOIN defaultdb.public.seed@[0] AS tab_113299
        		JOIN defaultdb.public.seed AS tab_113300
        			JOIN defaultdb.public.seed AS tab_113301 ON (tab_113300._int8) = (tab_113301._int8) ON
        				(tab_113299._float8) = (tab_113300._float8)
        		JOIN defaultdb.public.table1@[0] AS tab_113302
        			JOIN defaultdb.public.table3@[0] AS tab_113303
        				JOIN defaultdb.public.table2@[0] AS tab_113304
        					JOIN defaultdb.public.table3@primary AS tab_113305 ON
        							(tab_113304.col2_2) = (tab_113305.col3_0) AND (tab_113304.col2_12) = (tab_113305.col3_4) ON
        						(tab_113303.col3_3) = (tab_113304.col2_2) AND (tab_113303.tableoid) = (tab_113304.tableoid) ON
        					(tab_113302.col1_3) = (tab_113304.col2_5)
        					AND (tab_113302.col1_0) = (tab_113305.crdb_internal_mvcc_timestamp)
        					AND (tab_113302.tableoid) = (tab_113304.col2_5)
        					AND (tab_113302.tableoid) = (tab_113305.tableoid)
        					AND (tab_113302.col1_9) = (tab_113303.col3_4)
        					AND (tab_113302.tableoid) = (tab_113303.tableoid) ON
        				(tab_113299.tableoid) = (tab_113304.tableoid) ON
        			(tab_113298.col3_2) = (tab_113304.tableoid)
        			AND (tab_113298.crdb_internal_mvcc_timestamp) = (tab_113304.crdb_internal_mvcc_timestamp)
        			AND (tab_113298.tableoid) = (tab_113304.tableoid)
        			AND (tab_113298.col3_3) = (tab_113302.col1_3)
        			AND (tab_113298.col3_2) = (tab_113299.tableoid)
        WHERE
        	tab_113299._bool
        ORDER BY
        	tab_113302.col1_6 DESC
        LIMIT
        	51:::INT8;

Schema:

    rsg_test.go:596: To reproduce, use schema:
    rsg_test.go:598: 
        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 NULL, col1_1 DATE NULL, col1_2 DATE, col1_3 REGPROC NOT NULL, col1_4 GEOGRAPHY NOT NULL, col1_5 REGNAMESPACE NULL, col1_6 STRING NOT NULL AS (lower(CAST(col1_4 AS STRING))) STORED, col1_7 STRING AS (CASE WHEN col1_2 IS NULL THEN NULL ELSE e'?\x1b':::STRING END) VIRTUAL, col1_8 STRING NULL AS (CASE WHEN col1_1 IS NULL THEN 'B':::STRING ELSE NULL END) VIRTUAL, col1_9 STRING NOT NULL AS (CASE WHEN col1_3 IS NULL THEN e'\x10jV\b':::STRING ELSE e'\x00':::STRING END) VIRTUAL);
        CREATE TABLE table2 (col2_0 TIMESTAMPTZ NULL, col2_1 BOOL NOT NULL, col2_2 REGPROC NOT NULL, col2_3 NAME NULL, col2_4 GEOGRAPHY[], col2_5 REGCLASS NOT NULL, col2_6 STRING, col2_7 TIMESTAMP NOT NULL, col2_8 INET, col2_9 STRING NULL, col2_10 GEOGRAPHY NOT NULL, col2_11 BIT(32) NOT NULL, col2_12 STRING NOT NULL AS (lower(CAST(col2_11 AS STRING))) STORED, col2_13 STRING NOT NULL AS (lower(CAST(col2_1 AS STRING))) STORED, col2_14 STRING NOT NULL AS (lower(CAST(col2_11 AS STRING))) VIRTUAL, INDEX (col2_11 DESC, col2_14 DESC, col2_0 ASC, col2_1 ASC, lower(CAST(col2_10 AS STRING)) ASC, col2_8 DESC) WHERE table2.col2_9 <= '"':::STRING);
        CREATE TABLE table3 (col3_0 REGCLASS NOT NULL, col3_1 UUID NOT NULL, col3_2 REGPROC NOT NULL, col3_3 REGPROC NOT NULL, PRIMARY KEY (col3_0 ASC, col3_2 ASC, col3_1 ASC, col3_3), col3_4 STRING NOT NULL AS (CASE WHEN col3_0 IS NULL THEN '6*$^wraR6':::STRING ELSE e'+\x16U\x1c':::STRING END) VIRTUAL, INDEX (col3_0 ASC, col3_3 ASC, col3_1 ASC, col3_2) WHERE table3.col3_4 != e'\x00':::STRING, INDEX (col3_4 DESC, lower(CAST(col3_1 AS STRING)) DESC) WHERE table3.col3_4 = 'X':::STRING, FAMILY (col3_1), FAMILY (col3_0, col3_2), FAMILY (col3_3));
        ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 364054, "histo_col_type": "", "name": "__auto__", "null_count": 747538, "row_count": 800000}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 235450, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 800000}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 302994, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 800000}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 279631, "histo_col_type": "", "name": "__auto__", "null_count": 370320, "row_count": 800000}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 421937, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 800000}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 240287, "histo_col_type": "", "name": "__auto__", "null_count": 402289, "row_count": 800000}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 203334, "histo_col_type": "", "name": "__auto__", "null_count": 230958, "row_count": 800000}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 164444, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 800000}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 352580, "histo_col_type": "", "name": "__auto__", "null_count": 123804, "row_count": 800000}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 719247, "histo_col_type": "", "name": "__auto__", "null_count": 699441, "row_count": 800000}]':::JSONB;
        ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3461181576950654063, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8112303975352210981}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5754087780870168897, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8112303975352210981}, {"columns": ["col2_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7483788041774903115, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8112303975352210981}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 9645309652964647, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8112303975352210981}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2124373398440035814, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8112303975352210981}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6247317203536529175, "histo_col_type": "", "name": "__auto__", "null_count": 6546785313000656210, "row_count": 8112303975352210981}, {"columns": ["col2_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 789802527890843556, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8112303975352210981}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 121151834296332121, "histo_col_type": "", "name": "__auto__", "null_count": 7561013722816481282, "row_count": 8112303975352210981}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4051252163325084675, "histo_col_type": "", "name": "__auto__", "null_count": 2294428028243068095, "row_count": 8112303975352210981}, {"columns": ["col2_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3686858320387606163, "histo_buckets": [{"distinct_range": 0, "num_eq": 700000000, "num_range": 0, "upper_bound": "00011110101100100010010111111111"}, {"distinct_range": 0, "num_eq": 80000000, "num_range": 6000, "upper_bound": "00111010010100001000010011111101"}, {"distinct_range": 0, "num_eq": 4119171633389153576, "num_range": 100000, "upper_bound": "01010100011111011001001000001111"}, {"distinct_range": 0, "num_eq": 60, "num_range": 4928133800419787049, "upper_bound": "01111000111110010000110110100001"}, {"distinct_range": 0, "num_eq": 7000000000, "num_range": 3448430673552778392, "upper_bound": "10010011000100111011101110001110"}, {"distinct_range": 10, "num_eq": 50000000000, "num_range": 10, "upper_bound": "11011010110101000011011100111100"}, {"distinct_range": 70000000000, "num_eq": 300, "num_range": 70000000000, "upper_bound": "11100100000001010111111101100110"}, {"distinct_range": 80000000000, "num_eq": 7000, "num_range": 80000000000, "upper_bound": "11110010000100001110111100110101"}], "histo_col_type": "BIT(32)", "name": "__auto__", "null_count": 0, "row_count": 8112303975352210981}, {"columns": ["col2_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6328011840488281566, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8112303975352210981}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4604826549415845037, "histo_col_type": "", "name": "__auto__", "null_count": 4688645191250759525, "row_count": 8112303975352210981}, {"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6586157855471119995, "histo_col_type": "", "name": "__auto__", "null_count": 295211353555660415, "row_count": 8112303975352210981}, {"columns": ["col2_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5530503082308911988, "histo_col_type": "", "name": "__auto__", "null_count": 2953648456419854904, "row_count": 8112303975352210981}, {"columns": ["col2_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2619714095279170823, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8112303975352210981}]':::JSONB;
        ALTER TABLE table3 INJECT STATISTICS e'[{"columns": ["col3_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 981938323, "histo_buckets": [{"distinct_range": 0, "num_eq": 1354553385203478143, "num_range": 0, "upper_bound": "456610006"}, {"distinct_range": 490434699.8577412, "num_eq": 10, "num_range": 900000000, "upper_bound": "590299665"}, {"distinct_range": 0, "num_eq": 600000000, "num_range": 0, "upper_bound": "1254828916"}], "histo_col_type": "REGCLASS", "name": "__auto__", "null_count": 0, "row_count": 1000000000}, {"columns": ["col3_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 261507644, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000000000}, {"columns": ["col3_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 639572364, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000000000}, {"columns": ["col3_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 866967571, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000000000}, {"columns": ["col3_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 895496669, "histo_buckets": [{"distinct_range": 0, "num_eq": 7415986533582454588, "num_range": 0, "upper_bound": ""}, {"distinct_range": 0, "num_eq": 80000000000, "num_range": 3431789270191535069, "upper_bound": "\\u0008J\\u000f^\\u0007FU\\u0011]"}, {"distinct_range": 0, "num_eq": 0, "num_range": 20, "upper_bound": "\\u0017#e/i"}, {"distinct_range": 2290844318299040500, "num_eq": 2000000, "num_range": 3926270970715451806, "upper_bound": "&>a"}, {"distinct_range": 4171088917510553600, "num_eq": 8378855458504470835, "num_range": 4171088917510553819, "upper_bound": "\'"}, {"distinct_range": 6587757253518792000, "num_eq": 90000000000, "num_range": 6587757253518791850, "upper_bound": "_j"}, {"distinct_range": 901614.201495744, "num_eq": 90000000, "num_range": 8000000, "upper_bound": "jr9"}, {"distinct_range": 1586343007514721300, "num_eq": 6654490186917485617, "num_range": 1586343007514721316, "upper_bound": "tNQ\\u0005\\r\\u000ee("}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 0, "row_count": 1000000000}]':::JSONB;
        CREATE TYPE rand_typ_0 AS ENUM ('r', 'lod', 'bbsw', 'bgrv', 'w', 'n');
        ;
    rsg_test.go:598: 
        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:600: 
    rsg_test.go:601: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith223241619
--- FAIL: TestRandomSyntaxSQLSmith (300.85s)
Reproduce

To reproduce, try:

make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1
Same failure on other branches

  • #74272 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
  • #70663 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-master]
Internal log

mjibson marked as alumn{us/a}; resolving to rafiss instead

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity avatar Jan 24 '22 06:01 cockroach-teamcity

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-21.2 @ f63f6d6f7e8b850b3eaf67e7f6920f251c8598f0:

Random syntax error:

    rsg_test.go:779: Crash detected: server panic: statement exec timeout

Query:

        SELECT
        	tab_190830.col2_11 AS col_460491
        FROM
        	defaultdb.public.table2@[0] AS tab_190822,
        	defaultdb.public.table1@table1_col1_10_col1_11_col1_9_col1_8_col1_7_col1_12_idx AS tab_190823,
        	defaultdb.public.table2@[0] AS tab_190827
        	JOIN defaultdb.public.seed@seed__int8__float8__date_idx AS tab_190828 ON
        			(tab_190827.col2_11) = (tab_190828._string)
        			AND (tab_190827.crdb_internal_mvcc_timestamp) = (tab_190828._decimal)
        			AND (tab_190827.col2_8) = (tab_190828._string)
        			AND (tab_190827.crdb_internal_mvcc_timestamp) = (tab_190828.crdb_internal_mvcc_timestamp)
        	JOIN defaultdb.public.table2@table2_expr_col2_6_col2_8_expr1_idx AS tab_190829
        		JOIN defaultdb.public.table2@table2_expr_col2_6_col2_8_expr1_idx AS tab_190830
        			JOIN defaultdb.public.seed AS tab_190831
        				JOIN defaultdb.public.seed AS tab_190832 ON (tab_190831._jsonb) = (tab_190832._jsonb)
        				JOIN defaultdb.public.seed@seed__int8__float8__date_idx AS tab_190833 ON
        						(tab_190832._jsonb) = (tab_190833._jsonb) AND (tab_190831._jsonb) = (tab_190833._jsonb)
        				JOIN defaultdb.public.seed@[0] AS tab_190834
        					JOIN defaultdb.public.seed@seed__int8__float8__date_idx AS tab_190835 ON
        							(tab_190834._interval) = (tab_190835._interval) ON
        						(tab_190831._jsonb) = (tab_190835._jsonb)
        						AND (tab_190831._jsonb) = (tab_190834._jsonb)
        						AND (tab_190833._int8) = (tab_190834._int8)
        						AND (tab_190833._decimal) = (tab_190834.crdb_internal_mvcc_timestamp)
        						AND (tab_190833._uuid) = (tab_190834._uuid) ON
        					(tab_190830.tableoid) = (tab_190833.tableoid)
        					AND (tab_190830.col2_0) = (tab_190835._inet)
        					AND (tab_190830.crdb_internal_mvcc_timestamp) = (tab_190833._decimal) ON
        				(tab_190829.col2_10) = (tab_190833._string) AND (tab_190829.col2_11) = (tab_190833._string) ON
        			(tab_190828._int4) = (tab_190835._int4)
        			AND (tab_190827.col2_3) = (tab_190829.col2_3)
        			AND (tab_190828._inet) = (tab_190830.col2_0);

Schema:

    rsg_test.go:596: To reproduce, use schema:
    rsg_test.go:598: 
        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 INT2 NOT NULL, col1_1 INTERVAL NOT NULL, col1_2 BOX2D NOT NULL, col1_3 INT4 NOT NULL, col1_4 NAME NULL, col1_5 REGNAMESPACE NOT NULL, col1_6 BOOL NOT NULL, col1_7 REGNAMESPACE NOT NULL, PRIMARY KEY (col1_1 DESC, col1_7 DESC, col1_6, col1_3 ASC, col1_5, col1_2 DESC, col1_0 ASC), col1_8 STRING NOT NULL AS (lower(CAST(col1_6 AS STRING))) STORED, col1_9 STRING NULL AS (lower(col1_4)) STORED, col1_10 STRING NOT NULL AS (CASE WHEN col1_7 IS NULL THEN e'U0\x12y R83':::STRING ELSE e'W[I#\x01\x17\x14r``':::STRING END) STORED, col1_11 STRING NOT NULL AS (lower(CAST(col1_6 AS STRING))) STORED, col1_12 INT4 NOT NULL AS (col1_3 + col1_0) STORED, INDEX (col1_10, col1_11 ASC, col1_9 ASC, col1_8, col1_7 DESC, col1_12 ASC));
        CREATE TABLE table2 (col2_0 INET NOT NULL, col2_1 GEOMETRY NULL, col2_2 REGNAMESPACE NULL, col2_3 JSONB, col2_4 REGCLASS, col2_5 GEOMETRY, col2_6 REGPROC NOT NULL, col2_7 GEOGRAPHY NOT NULL, col2_8 STRING NOT NULL AS (lower(CAST(col2_7 AS STRING))) STORED, col2_9 STRING AS (lower(CAST(col2_3 AS STRING))) VIRTUAL, col2_10 STRING NULL AS (lower(CAST(col2_1 AS STRING))) VIRTUAL, col2_11 STRING NULL AS (lower(CAST(col2_1 AS STRING))) VIRTUAL, INDEX (lower(CAST(col2_0 AS STRING)), col2_6 DESC, col2_8, lower(CAST(col2_7 AS STRING)) ASC) STORING (col2_1, col2_7), INVERTED INDEX (col2_4, lower(CAST(col2_0 AS STRING)) DESC, col2_9 ASC, col2_2, col2_7 DESC) WHERE (((table2.col2_10 <= e'\x00':::STRING) OR (table2.col2_11 <= e'\'':::STRING)) AND (table2.col2_8 <= e'\x00':::STRING)) OR (table2.col2_9 = e'\x00':::STRING));
        ALTER TABLE table1 INJECT STATISTICS e'[{"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 12518538, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 70000000}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 24243220, "histo_col_type": "", "name": "__auto__", "null_count": 36260359, "row_count": 70000000}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 39017011, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 70000000}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 10824958, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 70000000}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 65906153, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 70000000}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 54676710, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 70000000}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 51638716, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 70000000}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 25938514, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 70000000}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4892181, "histo_col_type": "", "name": "__auto__", "null_count": 67989548, "row_count": 70000000}, {"columns": ["col1_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 62602946, "histo_buckets": [{"distinct_range": 0, "num_eq": 8000, "num_range": 0, "upper_bound": "\\u0018``]*_\\u0019k}\\u000f"}, {"distinct_range": 6589858969646687000, "num_eq": 8548123783434361994, "num_range": 6589858969646686845, "upper_bound": "\\u001e\\u0016\\"!\\u0005?lNo"}, {"distinct_range": 0, "num_eq": 1067042268732831418, "num_range": 3401233918315177223, "upper_bound": "L:L\\u000eVqe"}, {"distinct_range": 2177.252787657412, "num_eq": 7628172473354287436, "num_range": 80000, "upper_bound": "\\\\"}, {"distinct_range": 0, "num_eq": 4834042435095910012, "num_range": 372428080775852166, "upper_bound": "jFN$_"}, {"distinct_range": 0, "num_eq": 7000000000, "num_range": 0, "upper_bound": "s?1TY3"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 0, "row_count": 70000000}, {"columns": ["col1_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 38619134, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 70000000}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 36839862, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 70000000}, {"columns": ["col1_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 31197580, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 70000000}]':::JSONB;
        ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 495, "histo_col_type": "", "name": "__auto__", "null_count": 387, "row_count": 1000}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 436, "histo_col_type": "", "name": "__auto__", "null_count": 91, "row_count": 1000}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 78, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000}, {"columns": ["col2_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 561, "histo_col_type": "", "name": "__auto__", "null_count": 289, "row_count": 1000}, {"columns": ["col2_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 594, "histo_col_type": "", "name": "__auto__", "null_count": 629, "row_count": 1000}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 747, "histo_col_type": "", "name": "__auto__", "null_count": 923, "row_count": 1000}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 998, "histo_col_type": "", "name": "__auto__", "null_count": 246, "row_count": 1000}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 152, "histo_col_type": "", "name": "__auto__", "null_count": 777, "row_count": 1000}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 922, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000}, {"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 911, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000}, {"columns": ["col2_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 956, "histo_col_type": "", "name": "__auto__", "null_count": 825, "row_count": 1000}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 792, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000}]':::JSONB;
        CREATE TYPE rand_typ_0 AS ENUM ('wvfiyt', 'ytyp', 'mvrqcl', 'w');
        CREATE TYPE rand_typ_1 AS ENUM ('bvo', 'cipy', 'auyuve');
        CREATE TYPE rand_typ_2 AS ENUM ('cztupe');
        CREATE TYPE rand_typ_3 AS ENUM ('ta', 'mpocyn', 'w', 'bne', 'vzeet', 'vtr');
        ;
    rsg_test.go:598: 
        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:600: 
    rsg_test.go:601: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith352567181
--- FAIL: TestRandomSyntaxSQLSmith (300.94s)
Reproduce

To reproduce, try:

make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1
Same failure on other branches

  • #74272 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
  • #70663 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-master]
Internal log

mjibson marked as alumn{us/a}; resolving to rafiss instead

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity avatar Jan 28 '22 06:01 cockroach-teamcity

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-21.2 @ 92dfb8a4370274257b99cd9bccbe3854e243c268:

Random syntax error:

    rsg_test.go:779: Crash detected: server panic: statement exec timeout

Query:

        SELECT
        	tab_474028.col2_18 AS col_1144833,
        	18435789829.29411036:::DECIMAL AS col_1144834,
        	e'k.\x1a':::STRING AS col_1144835,
        	1288924672:::OID AS col_1144836,
        	tab_474033.col1_3 AS col_1144837
        FROM
        	defaultdb.public.table4@[0] AS tab_474024
        	JOIN defaultdb.public.table2@table2_col2_17_col2_0_col2_15_col2_12_col2_9_col2_6_key AS tab_474025
        		JOIN defaultdb.public.table5 AS tab_474026
        			JOIN defaultdb.public.table5 AS tab_474027 ON
        					(tab_474026.col5_4) = (tab_474027.col5_4) AND (tab_474026.col5_0) = (tab_474027.col5_0) ON
        				(tab_474025.col2_3) = (tab_474026.col5_1)
        				AND (tab_474025.tableoid) = (tab_474027.col5_1)
        				AND (tab_474025.col2_3) = (tab_474027.col5_1)
        		JOIN defaultdb.public.table2@table2_col2_17_col2_0_col2_15_col2_12_col2_9_col2_6_key AS tab_474028 ON
        				(tab_474025.col2_18) = (tab_474028.col2_4) AND (tab_474025.col2_15) = (tab_474028.col2_4)
        		JOIN defaultdb.public.table4@[0] AS tab_474029 ON (tab_474027.col5_1) = (tab_474029.col4_2)
        		JOIN defaultdb.public.seed@seed__int8__float8__date_idx AS tab_474030 ON
        				(tab_474029.col4_8) = (tab_474030._int4)
        		JOIN defaultdb.public.table1@[0] AS tab_474033 ON (tab_474025.col2_3) = (tab_474033.col1_8) ON
        			(tab_474024.col4_2) = (tab_474025.tableoid)
        			AND (tab_474024.col4_14) = (tab_474025.col2_17)
        			AND (tab_474024.col4_16) = (tab_474030._string)
        ORDER BY
        	tab_474033.col1_14 ASC
        LIMIT
        	12:::INT8;

Schema:

    rsg_test.go:596: To reproduce, use schema:
    rsg_test.go:598: 
        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 INTERVAL NOT NULL, col1_1 TIMETZ NULL, col1_2 BOOL NOT NULL, col1_3 TIMETZ NOT NULL, col1_4 REGTYPE NULL, col1_5 TIMESTAMP NOT NULL, col1_6 REGCLASS NULL, col1_7 BIT(10) NOT NULL, col1_8 REGNAMESPACE, col1_9 TIMESTAMPTZ NULL, col1_10 INT8 NULL, col1_11 STRING NULL AS (CASE WHEN col1_6 IS NULL THEN e'[:3Ir\n':::STRING ELSE e'E\r':::STRING END) STORED, col1_12 STRING NOT NULL AS (lower(CAST(col1_2 AS STRING))) STORED, col1_13 STRING AS (CASE WHEN col1_8 IS NULL THEN e'\x7fZ>t{U':::STRING ELSE e'Z<8\x18':::STRING END) VIRTUAL, col1_14 STRING AS (CASE WHEN col1_8 IS NULL THEN '':::STRING ELSE e'B6k\x0b':::STRING END) VIRTUAL, col1_15 STRING AS (CASE WHEN col1_8 IS NULL THEN '':::STRING ELSE NULL END) STORED, FAMILY (col1_11, col1_6), FAMILY (col1_9, col1_8, col1_10, col1_7), FAMILY (col1_0), FAMILY (col1_12), FAMILY (col1_4, col1_3, col1_15, col1_5), FAMILY (col1_2, col1_1));
        CREATE TABLE table2 (col2_0 BIT(41), col2_1 DECIMAL NULL, col2_2 TIMESTAMPTZ NULL, col2_3 REGNAMESPACE, col2_4 STRING NULL, col2_5 INET NULL, col2_6 BOX2D, col2_7 FLOAT8, col2_8 STRING, col2_9 BIT(5) NOT NULL, col2_10 JSONB NULL, col2_11 DECIMAL NULL, col2_12 TIMESTAMPTZ NOT NULL, col2_13 INT2, col2_14 TIME NOT NULL, col2_15 STRING NOT NULL, col2_16 INTERVAL, col2_17 INT4 NULL, col2_18 STRING NOT NULL AS (lower(CAST(col2_9 AS STRING))) VIRTUAL, UNIQUE (col2_15, col2_0, col2_9 ASC, col2_3 DESC, col2_14 ASC) STORING (col2_1, col2_4, col2_8, col2_12, col2_13, col2_16) WHERE ((((table2.col2_11 < 'Infinity':::DECIMAL) AND (table2.col2_2 != '294276-12-31 23:59:59.999999+00:00':::TIMESTAMPTZ)) AND (table2.col2_17 > 1:::INT8)) AND (table2.col2_15 >= e'\'':::STRING)) AND (table2.col2_13 >= 1:::INT8), UNIQUE (col2_17, col2_0 DESC, col2_15 ASC, col2_12, col2_9, col2_6) WHERE (((((((((((table2.col2_7 = 1.7976931348623157e+308:::FLOAT8) AND (table2.col2_2 < '294276-12-31 23:59:59.999999+00:00':::TIMESTAMPTZ)) AND (table2.col2_15 >= e'\U00002603':::STRING)) AND (table2.col2_17 <= 2147483647:::INT8)) AND (table2.col2_13 != 1:::INT8)) AND (table2.col2_11 != 1:::DECIMAL)) AND (table2.col2_18 != '':::STRING)) AND (table2.col2_4 < e'\'':::STRING)) OR (table2.col2_12 >= '3000-01-01 00:00:00+00:00':::TIMESTAMPTZ)) OR (table2.col2_1 <= '-Infinity':::DECIMAL)) AND (table2.col2_14 = '24:00:00':::TIME)) OR (table2.col2_8 = e'\'':::STRING));
        CREATE TABLE table3 (col3_0 NAME, col3_1 GEOGRAPHY NOT NULL, col3_2 INTERVAL, col3_3 OID NULL, col3_4 INT8 NOT NULL, col3_5 UUID NOT NULL, col3_6 DECIMAL NOT NULL, col3_7 JSONB, col3_8 INT4 NOT NULL, PRIMARY KEY (col3_4), INVERTED INDEX (col3_2 ASC, (col3_8 + col3_4) DESC, col3_3 DESC, col3_1 DESC) WHERE (((table3.col3_6 <= (-1.234E+401):::DECIMAL) AND (table3.col3_4 > (-128):::INT8)) AND (table3.col3_0 != e'\'':::STRING)) OR (table3.col3_8 >= (-1):::INT8), FAMILY (col3_7), FAMILY (col3_4), FAMILY (col3_1, col3_0), FAMILY (col3_3, col3_2), FAMILY (col3_8), FAMILY (col3_5), FAMILY (col3_6));
        CREATE TABLE table4 (col4_0 FLOAT8 NULL, col4_1 STRING NOT NULL, col4_2 REGPROC NULL, col4_3 GEOMETRY NOT NULL, col4_4 INTERVAL, col4_5 REGPROCEDURE NOT NULL, col4_6 TIMESTAMPTZ NULL, col4_7 REGPROCEDURE, col4_8 INT4 NOT NULL, col4_9 BOX2D, col4_10 GEOGRAPHY NOT NULL, col4_11 DATE NULL, col4_12 STRING AS (CASE WHEN col4_7 IS NULL THEN e'\x13\x14\ng':::STRING ELSE e'zp&!3\x10\x1e':::STRING END) STORED, col4_13 STRING NOT NULL AS (lower(CAST(col4_10 AS STRING))) VIRTUAL, col4_14 INT4 NOT NULL AS (col4_8 + (-1900738117):::INT8) STORED, col4_15 STRING AS (lower(CAST(col4_9 AS STRING))) STORED, col4_16 STRING AS (lower(CAST(col4_9 AS STRING))) STORED, col4_17 STRING NOT NULL AS (lower(col4_1)) STORED, col4_18 STRING AS (CASE WHEN col4_7 IS NULL THEN e'Z}\x06P\\':::STRING ELSE e'\x17&^ZDv\x19':::STRING END) STORED, UNIQUE ((col4_0 + '+Inf':::FLOAT8) DESC, col4_2 ASC, (CASE WHEN col4_2 IS NULL THEN '':::STRING ELSE e'\x05YH\x15\x1b\b7':::STRING END), col4_18 DESC, col4_12 DESC, col4_6 DESC, col4_9 ASC, lower(col4_1) DESC) WHERE (((((((table4.col4_12 > e'\'':::STRING) OR (table4.col4_16 <= '"':::STRING)) OR (table4.col4_15 != '':::STRING)) AND (table4.col4_1 = e'\'':::STRING)) OR (table4.col4_18 <= 'X':::STRING)) OR (table4.col4_14 != 1:::INT8)) OR (table4.col4_8 >= 127:::INT8)) AND (table4.col4_17 = '':::STRING), UNIQUE (col4_6 DESC) STORING (col4_1, col4_11, col4_12, col4_15) WHERE (((((((((((table4.col4_15 < e'\U00002603':::STRING) AND (table4.col4_6 > '3000-01-01 00:00:00+00:00':::TIMESTAMPTZ)) AND (table4.col4_14 = 0:::INT8)) AND (table4.col4_0 > (-1.0):::FLOAT8)) OR (table4.col4_1 != e'\'':::STRING)) OR (table4.col4_17 <= e'\'':::STRING)) OR (table4.col4_12 <= '':::STRING)) AND (table4.col4_11 >= '1970-01-01':::DATE)) OR (table4.col4_8 != (-1):::INT8)) OR (table4.col4_18 >= '"':::STRING)) OR (table4.col4_16 = 'X':::STRING)) OR (table4.col4_13 >= '':::STRING), UNIQUE (col4_14 ASC, col4_8 DESC, (col4_0 + 1.650651382687731:::FLOAT8), (CASE WHEN col4_2 IS NULL THEN e'o\bVZ\tgXa\x15':::STRING ELSE e'\U00002603':::STRING END) DESC, col4_2, col4_15 ASC, col4_9 DESC, (CASE WHEN col4_2 IS NULL THEN e'!C/\\\f``k':::STRING ELSE e'\x1b':::STRING END) DESC, col4_12) STORING (col4_0, col4_4, col4_5, col4_7, col4_10, col4_11, col4_16) WHERE ((((((table4.col4_17 != e'\'':::STRING) AND (table4.col4_6 <= '-2000-01-01 00:00:00+00:00':::TIMESTAMPTZ)) OR (table4.col4_12 < e'\x00':::STRING)) AND (table4.col4_1 >= '':::STRING)) OR (table4.col4_13 <= e'\U00002603':::STRING)) OR (table4.col4_18 != 'X':::STRING)) AND (table4.col4_0 != 5e-324:::FLOAT8));
        CREATE TABLE table5 (col5_0 FLOAT4 NOT NULL, col5_1 REGCLASS NOT NULL, col5_2 BIT(45) NOT NULL, col5_3 VARCHAR NOT NULL, col5_4 FLOAT4 NOT NULL, col5_5 INET NOT NULL, PRIMARY KEY (col5_4 ASC, col5_1 DESC, col5_2 DESC, col5_5 ASC, col5_0 DESC), col5_6 FLOAT4 NOT NULL AS (col5_0 + 0.9862968325614929:::FLOAT8) VIRTUAL, col5_7 FLOAT4 NOT NULL AS (col5_4 + col5_0) STORED, col5_8 FLOAT4 NOT NULL AS (col5_0 + col5_4) STORED, col5_9 FLOAT4 NOT NULL AS (col5_0 + col5_4) STORED, col5_10 FLOAT4 NOT NULL AS (col5_0 + (-0.6475128531455994):::FLOAT8) STORED);
        ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 58112488071, "histo_col_type": "", "name": "__auto__", "null_count": 29790491091, "row_count": 70000000000}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 28341673056, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 70000000000}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 50948078709, "histo_col_type": "", "name": "__auto__", "null_count": 65028663087, "row_count": 70000000000}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 61469251831, "histo_col_type": "", "name": "__auto__", "null_count": 1670742379, "row_count": 70000000000}, {"columns": ["col1_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 57966388935, "histo_col_type": "", "name": "__auto__", "null_count": 37093643814, "row_count": 70000000000}, {"columns": ["col1_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 33401217826, "histo_col_type": "", "name": "__auto__", "null_count": 51264220060, "row_count": 70000000000}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 37789869814, "histo_col_type": "", "name": "__auto__", "null_count": 16083593691, "row_count": 70000000000}, {"columns": ["col1_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 31197737586, "histo_col_type": "", "name": "__auto__", "null_count": 30435373489, "row_count": 70000000000}, {"columns": ["col1_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 23117805850, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 70000000000}, {"columns": ["col1_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 64110436536, "histo_col_type": "", "name": "__auto__", "null_count": 37017510745, "row_count": 70000000000}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 25943449441, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 70000000000}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 8807517543, "histo_col_type": "", "name": "__auto__", "null_count": 41030893628, "row_count": 70000000000}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 56818258267, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 70000000000}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 27311255078, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 70000000000}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 40795284566, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 70000000000}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 19792170973, "histo_col_type": "", "name": "__auto__", "null_count": 46857152714, "row_count": 70000000000}]':::JSONB;
        ALTER TABLE table2 INJECT STATISTICS e'[{"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 59002108, "histo_col_type": "", "name": "__auto__", "null_count": 56659120, "row_count": 100000000}, {"columns": ["col2_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 38431068, "histo_col_type": "", "name": "__auto__", "null_count": 70936733, "row_count": 100000000}, {"columns": ["col2_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 75872027, "histo_buckets": [{"distinct_range": 0, "num_eq": 90, "num_range": 0, "upper_bound": ""}, {"distinct_range": 0, "num_eq": 2000000, "num_range": 300, "upper_bound": "\\u000b9|%"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 0, "row_count": 100000000}, {"columns": ["col2_16"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 23989167, "histo_col_type": "", "name": "__auto__", "null_count": 25822294, "row_count": 100000000}, {"columns": ["col2_18"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 12625832, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 100000000}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 81722687, "histo_col_type": "", "name": "__auto__", "null_count": 36132808, "row_count": 100000000}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5890869, "histo_col_type": "", "name": "__auto__", "null_count": 67290701, "row_count": 100000000}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 71285270, "histo_col_type": "", "name": "__auto__", "null_count": 33558087, "row_count": 100000000}, {"columns": ["col2_17"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 21852419, "histo_col_type": "", "name": "__auto__", "null_count": 73990014, "row_count": 100000000}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 78084102, "histo_col_type": "", "name": "__auto__", "null_count": 38875099, "row_count": 100000000}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 85576745, "histo_col_type": "", "name": "__auto__", "null_count": 85864725, "row_count": 100000000}, {"columns": ["col2_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 96701152, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 100000000}, {"columns": ["col2_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 86979917, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 100000000}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 49592978, "histo_col_type": "", "name": "__auto__", "null_count": 2897868, "row_count": 100000000}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 27954890, "histo_col_type": "", "name": "__auto__", "null_count": 23703913, "row_count": 100000000}, {"columns": ["col2_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 86989755, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 100000000}, {"columns": ["col2_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 57923755, "histo_col_type": "", "name": "__auto__", "null_count": 54138318, "row_count": 100000000}, {"columns": ["col2_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 69982203, "histo_col_type": "", "name": "__auto__", "null_count": 95681431, "row_count": 100000000}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 64209275, "histo_col_type": "", "name": "__auto__", "null_count": 14754870, "row_count": 100000000}]':::JSONB;
        ALTER TABLE table3 INJECT STATISTICS '[{"columns": ["col3_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 328, "histo_col_type": "", "name": "__auto__", "null_count": 383, "row_count": 900}, {"columns": ["col3_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 446, "histo_buckets": [{"distinct_range": 0, "num_eq": 0, "num_range": 0, "upper_bound": "-2795865132181743152"}, {"distinct_range": 2505451867388790000, "num_eq": 800000000, "num_range": 2505451867388789506, "upper_bound": "-1764132364788950296"}, {"distinct_range": 9000000000, "num_eq": 8930559039425875016, "num_range": 9000000000, "upper_bound": "-1579954109511752713"}, {"distinct_range": 674986139769995800, "num_eq": 9068833614772934519, "num_range": 1605777891933942038, "upper_bound": "-456275668414625419"}, {"distinct_range": 930779291319822700, "num_eq": 4448758803019957501, "num_range": 930779291319822745, "upper_bound": "3092261782135410766"}, {"distinct_range": 0, "num_eq": 0, "num_range": 1000000000, "upper_bound": "3950271251744930910"}, {"distinct_range": 0, "num_eq": 1000000000, "num_range": 600000000, "upper_bound": "4929431241442452064"}, {"distinct_range": 7000, "num_eq": 600000000, "num_range": 7000, "upper_bound": "6674921441760208583"}, {"distinct_range": 9933642437.722574, "num_eq": 0, "num_range": 90000000000, "upper_bound": "8899943501675096720"}], "histo_col_type": "INT8", "name": "__auto__", "null_count": 0, "row_count": 900}, {"columns": ["col3_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 350, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 900}, {"columns": ["col3_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 599, "histo_col_type": "", "name": "__auto__", "null_count": 329, "row_count": 900}, {"columns": ["col3_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 162, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 900}, {"columns": ["col3_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 68, "histo_col_type": "", "name": "__auto__", "null_count": 886, "row_count": 900}, {"columns": ["col3_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 326, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 900}, {"columns": ["col3_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 852, "histo_col_type": "", "name": "__auto__", "null_count": 414, "row_count": 900}, {"columns": ["col3_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 737, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 900}]':::JSONB;
        ALTER TABLE table4 INJECT STATISTICS '[{"columns": ["col4_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6923224, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 10000000}, {"columns": ["col4_16"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4857136, "histo_col_type": "", "name": "__auto__", "null_count": 1268392, "row_count": 10000000}, {"columns": ["col4_18"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6886033, "histo_col_type": "", "name": "__auto__", "null_count": 633232, "row_count": 10000000}, {"columns": ["col4_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7091788, "histo_col_type": "", "name": "__auto__", "null_count": 9291916, "row_count": 10000000}, {"columns": ["col4_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6282603, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 10000000}, {"columns": ["col4_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1106466, "histo_col_type": "", "name": "__auto__", "null_count": 1069637, "row_count": 10000000}, {"columns": ["col4_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5111320, "histo_col_type": "", "name": "__auto__", "null_count": 7643698, "row_count": 10000000}, {"columns": ["col4_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3958113, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 10000000}, {"columns": ["col4_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3214571, "histo_col_type": "", "name": "__auto__", "null_count": 9779254, "row_count": 10000000}, {"columns": ["col4_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6637548, "histo_col_type": "", "name": "__auto__", "null_count": 9479103, "row_count": 10000000}, {"columns": ["col4_17"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6584583, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 10000000}, {"columns": ["col4_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3862388, "histo_buckets": [{"distinct_range": 0, "num_eq": 1000, "num_range": 0, "upper_bound": "-2120047217"}, {"distinct_range": 0, "num_eq": 1178911616328384541, "num_range": 7318730576466564533, "upper_bound": "-1208932357"}, {"distinct_range": 1817620257977533400, "num_eq": 80, "num_range": 2537206593939105157, "upper_bound": "-1055680056"}, {"distinct_range": 4863.396412068546, "num_eq": 2535472791748847076, "num_range": 6000, "upper_bound": "-757332878"}, {"distinct_range": 0, "num_eq": 1279518404876067272, "num_range": 20000000, "upper_bound": "-505268719"}, {"distinct_range": 2329521230708547000, "num_eq": 0, "num_range": 5067255301489581037, "upper_bound": "-128"}, {"distinct_range": 3000, "num_eq": 2275307354699217667, "num_range": 3000, "upper_bound": "1926447103"}], "histo_col_type": "INT4", "name": "__auto__", "null_count": 0, "row_count": 10000000}, {"columns": ["col4_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5120486, "histo_col_type": "", "name": "__auto__", "null_count": 9128490, "row_count": 10000000}, {"columns": ["col4_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 234178, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 10000000}, {"columns": ["col4_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7353412, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 10000000}, {"columns": ["col4_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7467006, "histo_col_type": "", "name": "__auto__", "null_count": 6702418, "row_count": 10000000}, {"columns": ["col4_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2651306, "histo_col_type": "", "name": "__auto__", "null_count": 2268643, "row_count": 10000000}, {"columns": ["col4_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2618045, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 10000000}, {"columns": ["col4_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7788155, "histo_col_type": "", "name": "__auto__", "null_count": 1318387, "row_count": 10000000}]':::JSONB;
        ALTER TABLE table5 INJECT STATISTICS '[{"columns": ["col5_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 29292, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 30000}, {"columns": ["col5_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 9726, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 30000}, {"columns": ["col5_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 10429, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 30000}, {"columns": ["col5_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 20261, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 30000}, {"columns": ["col5_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 22692, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 30000}, {"columns": ["col5_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1310, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 30000}, {"columns": ["col5_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4311, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 30000}, {"columns": ["col5_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 23948, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 30000}, {"columns": ["col5_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 19571, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 30000}, {"columns": ["col5_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 8590, "histo_col_type": "FLOAT4", "name": "__auto__", "null_count": 0, "row_count": 30000}, {"columns": ["col5_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2899, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 30000}]':::JSONB;
        CREATE TYPE rand_typ_0 AS ENUM ('kn', 'enk', 'dsnpg', 'gwskn');
        ;
    rsg_test.go:598: 
        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:600: 
    rsg_test.go:601: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith076255479
--- FAIL: TestRandomSyntaxSQLSmith (351.20s)
Reproduce

To reproduce, try:

make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1
Same failure on other branches

  • #74272 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
  • #70663 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-master]
Internal log

mjibson marked as alumn{us/a}; resolving to rafiss instead

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity avatar Feb 09 '22 06:02 cockroach-teamcity

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-21.2 @ d7a023225d0db89453ebe3193d59678907e464f3:

Random syntax error:

    rsg_test.go:779: Crash detected: server panic: statement exec timeout

Query:

        SELECT
        	'26 years 8 mons 471 days 08:11:18.927101':::INTERVAL AS col_122464,
        	3157207986:::OID AS col_122465,
        	tab_52350.col4_7 AS col_122466,
        	tab_52364._float4 AS col_122467,
        	tab_52364._date AS col_122468,
        	(NULL::INTERVAL + '15:05:59.517409':::TIME::TIME)::TIME AS col_122469,
        	NULL AS col_122470,
        	(-32269):::INT8 AS col_122471,
        	2296341177:::OID AS col_122472,
        	tab_52360.col1_1 AS col_122473,
        	762929904:::INT8 AS col_122474,
        	tab_52361.tableoid AS col_122475,
        	NULL AS col_122476,
        	166942071:::INT8 AS col_122477,
        	NULL AS col_122478,
        	14516:::INT8 AS col_122479,
        	1434988358:::OID AS col_122480,
        	tab_52361.col4_11 AS col_122481,
        	tab_52350.col4_5 AS col_122482,
        	678642880:::INT8 AS col_122483,
        	(-7.398225335621694852E+28):::DECIMAL AS col_122484,
        	'\x035214':::BYTES AS col_122485,
        	tab_52360.col1_7 AS col_122486
        FROM
        	defaultdb.public.table4@table4_col4_8_col4_4_col4_6_col4_1_expr_col4_10_col4_7_col4_2_col4_9_col4_3_col4_0_idx
        		AS tab_52350,
        	defaultdb.public.table5 AS tab_52358
        	JOIN defaultdb.public.table5 AS tab_52359 ON
        			(tab_52358.col5_0) = (tab_52359.col5_0) AND (tab_52358.col5_1) = (tab_52359.col5_1)
        	JOIN defaultdb.public.table1@table1_col1_13_expr_col1_9_key AS tab_52360 ON
        			(tab_52358.col5_9) = (tab_52360.col1_6)
        			AND (tab_52359.col5_9) = (tab_52360.col1_18)
        			AND (tab_52359.col5_9) = (tab_52360.col1_2)
        	JOIN defaultdb.public.table4@[0] AS tab_52361 ON
        			(tab_52359.col5_9) = (tab_52361.col4_9) AND (tab_52359.col5_9) = (tab_52361.col4_2)
        	JOIN defaultdb.public.table3@[0] AS tab_52362 ON
        			(tab_52361.crdb_internal_mvcc_timestamp) = (tab_52362.col3_1)
        			AND (tab_52360.col1_8) = (tab_52362.col3_1)
        			AND (tab_52360.col1_13) = (tab_52362.tableoid)
        	JOIN defaultdb.public.seed@seed__int8__float8__date_idx AS tab_52363
        		JOIN defaultdb.public.seed@seed__int8__float8__date_idx AS tab_52364 ON (tab_52363._date) = (tab_52364._date) ON
        			(tab_52358.col5_9) = (tab_52363._string)
        			AND (tab_52360.col1_8) = (tab_52364._decimal)
        			AND (tab_52361.tableoid) = (tab_52363.tableoid)
        			AND (tab_52360.col1_17) = (tab_52363._string)
        WHERE
        	true
        ORDER BY
        	tab_52364.crdb_internal_mvcc_timestamp ASC, tab_52360.col1_4 ASC
        LIMIT
        	83:::INT8;

Schema:

    rsg_test.go:596: To reproduce, use schema:
    rsg_test.go:598: 
        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[] NULL, col1_1 TIMESTAMP, col1_2 "char", col1_3 OID NOT NULL, col1_4 OID, col1_5 INTERVAL NOT NULL, col1_6 CHAR NOT NULL, col1_7 REGTYPE NOT NULL, col1_8 DECIMAL NOT NULL, col1_9 REGPROC NULL, col1_10 DATE NULL, col1_11 INT8 NOT NULL, col1_12 REGTYPE NULL, col1_13 REGPROC, col1_14 INT4 NULL, col1_15 TIMESTAMP, PRIMARY KEY (col1_8 DESC, col1_6), col1_16 INT4 NULL AS (col1_14 + col1_11) VIRTUAL, col1_17 STRING NOT NULL AS (lower(col1_6)) VIRTUAL, col1_18 STRING NOT NULL AS (CASE WHEN col1_7 IS NULL THEN '~L':::STRING ELSE e'\x0fv*"Y/':::STRING END) VIRTUAL, INDEX (col1_11, col1_1 DESC, col1_4 ASC, col1_10, col1_17 ASC, col1_7, col1_3 ASC, col1_2, col1_9 ASC, (col1_11 + col1_14) DESC, (CASE WHEN col1_12 IS NULL THEN e'"4C\x12N<j9\x14':::STRING ELSE e'\'':::STRING END) DESC, lower(col1_6), col1_12, col1_13 ASC, col1_18 ASC), INDEX ((col1_14 + (-24183863):::INT8) ASC) STORING (col1_2, col1_3, col1_4, col1_5, col1_10) WHERE (((((((((table1.col1_14 < 1:::INT8) OR (table1.col1_18 < e'\x00':::STRING)) AND (table1.col1_16 >= (-2147483648):::INT8)) OR (table1.col1_11 != 127:::INT8)) AND (table1.col1_15 <= '0001-01-01 00:00:00':::TIMESTAMP)) OR (table1.col1_1 <= '3000-01-01 00:00:00':::TIMESTAMP)) AND (table1.col1_6 != 'X':::STRING)) OR (table1.col1_8 = '-Infinity':::DECIMAL)) OR (table1.col1_2 = '':::STRING)) AND (table1.col1_10 < '5874897-12-31':::DATE), UNIQUE (col1_7, col1_15 ASC, col1_17 DESC, col1_6 DESC, col1_5 ASC, (CASE WHEN col1_10 IS NULL THEN e'\U00002603':::STRING ELSE 'j':::STRING END) DESC, col1_10, col1_18 ASC) WHERE ((((((((((table1.col1_6 < '"':::STRING) OR (table1.col1_15 = '3000-01-01 00:00:00':::TIMESTAMP)) AND (table1.col1_8 != (-1):::DECIMAL)) AND (table1.col1_10 >= '-infinity':::DATE)) AND (table1.col1_17 > e'\x00':::STRING)) OR (table1.col1_14 < (-32768):::INT8)) OR (table1.col1_11 >= 0:::INT8)) AND (table1.col1_16 = (-1):::INT8)) AND (table1.col1_1 >= '-2000-01-01 00:00:00':::TIMESTAMP)) OR (table1.col1_18 = '':::STRING)) AND (table1.col1_2 >= e'\x00':::STRING), INDEX (col1_8, col1_9 ASC, col1_14, col1_2 ASC, (col1_11 + col1_14) ASC, col1_15 ASC, col1_18 DESC, col1_5 ASC, col1_3 DESC, col1_11 DESC, col1_6 ASC, col1_13, col1_17 ASC, col1_7 DESC, col1_16 DESC, col1_1), UNIQUE (col1_13 ASC, (CASE WHEN col1_7 IS NULL THEN 'X':::STRING ELSE '.LZdul':::STRING END) ASC, col1_9 DESC), INDEX (col1_11 DESC, col1_1 DESC, col1_7 ASC, col1_6 ASC) WHERE ((((table1.col1_15 <= '-2000-01-01 00:00:00':::TIMESTAMP) AND (table1.col1_16 <= (-1):::INT8)) OR (table1.col1_11 > (-9223372036854775807):::INT8)) OR (table1.col1_1 < '3000-01-01 00:00:00':::TIMESTAMP)) OR (table1.col1_2 > e'\x00':::STRING));
        CREATE TABLE table2 (col2_0 TIMESTAMPTZ NOT NULL, col2_1 OID NOT NULL, col2_2 FLOAT4 NOT NULL, col2_3 TIMESTAMP, col2_4 FLOAT4 NULL, col2_5 TIMESTAMPTZ NOT NULL, col2_6 OID NOT NULL, col2_7 REGPROC NULL, col2_8 BIT(27), PRIMARY KEY (col2_5 DESC, col2_6, col2_2 DESC), col2_9 STRING AS (CASE WHEN col2_3 IS NULL THEN 'Irh':::STRING ELSE 'u-_bk8':::STRING END) STORED, col2_10 STRING NULL AS (CASE WHEN col2_7 IS NULL THEN e'N\x12$[j':::STRING ELSE e'Lh1\x10G&\x1e':::STRING END) STORED);
        CREATE TABLE table3 (col3_0 UUID NOT NULL, col3_1 DECIMAL NULL, PRIMARY KEY (col3_0 ASC), UNIQUE (col3_0 DESC, col3_1 DESC) WHERE table3.col3_1 < (-1):::DECIMAL, UNIQUE (col3_1 ASC, lower(CAST(col3_0 AS STRING)) ASC), INDEX (col3_0 DESC, col3_1 ASC), UNIQUE (col3_0 DESC) WHERE table3.col3_1 > '-Infinity':::DECIMAL, UNIQUE (col3_0 ASC, col3_1 DESC), INDEX (lower(CAST(col3_0 AS STRING)), col3_0 ASC), INDEX (col3_1 DESC, col3_0 DESC) WHERE table3.col3_1 = (-1.234E+401):::DECIMAL, UNIQUE (col3_0 DESC, col3_1 ASC));
        CREATE TABLE table4 (col4_0 REGCLASS NOT NULL, col4_1 INT4 NOT NULL, col4_2 NAME, col4_3 INT2 NULL, col4_4 INET NULL, col4_5 GEOMETRY, col4_6 TIME NULL, col4_7 BYTES NOT NULL, col4_8 DECIMAL NOT NULL, col4_9 VARCHAR NOT NULL, col4_10 DATE NOT NULL, col4_11 INT4 NOT NULL AS (col4_1 + 0:::INT8) VIRTUAL, UNIQUE (col4_9 ASC) STORING (col4_4, col4_5, col4_8, col4_10), INDEX (col4_8, col4_4, col4_6 DESC, col4_1, (col4_3 + 0:::INT8) ASC, col4_10 DESC, col4_7 ASC, col4_2 DESC, col4_9, col4_3 DESC, col4_0 DESC) WHERE ((((((table4.col4_8 < 'Infinity':::DECIMAL) OR (table4.col4_9 != '':::STRING)) AND (table4.col4_2 != e'\'':::STRING)) OR (table4.col4_1 = 2147483647:::INT8)) AND (table4.col4_11 != (-1):::INT8)) AND (table4.col4_10 > 'infinity':::DATE)) OR (table4.col4_7 <= '\x58':::BYTES), FAMILY (col4_3), FAMILY (col4_9, col4_0, col4_6, col4_7), FAMILY (col4_8, col4_4), FAMILY (col4_10), FAMILY (col4_2), FAMILY (col4_5, col4_1));
        CREATE TABLE table5 (col5_0 FLOAT8 NOT NULL, col5_1 JSONB, col5_2 GEOMETRY, col5_3 REGROLE NULL, col5_4 INET NULL, col5_5 VARCHAR NULL, col5_6 TIMESTAMPTZ, col5_7 FLOAT4, col5_8 BYTES NOT NULL, col5_9 STRING NOT NULL AS (CASE WHEN col5_8 IS NULL THEN ' nO&Yq$1{':::STRING ELSE '':::STRING END) VIRTUAL, col5_10 STRING NOT NULL AS (CASE WHEN col5_8 IS NULL THEN 'n:':::STRING ELSE '"':::STRING END) VIRTUAL, col5_11 FLOAT8 AS (col5_0 + col5_7) STORED, col5_12 STRING AS (lower(CAST(col5_2 AS STRING))) VIRTUAL, col5_13 STRING AS (lower(CAST(col5_2 AS STRING))) STORED, col5_14 FLOAT8 AS (col5_0 + col5_7) STORED, INVERTED INDEX (col5_0 DESC, col5_9, col5_10, col5_13 ASC, col5_3 ASC, col5_14 ASC, col5_11 ASC, col5_6 ASC, col5_7, col5_8 DESC, col5_12 ASC, col5_1), FAMILY (col5_6), FAMILY (col5_5), FAMILY (col5_4), FAMILY (col5_3, col5_8), FAMILY (col5_2), FAMILY (col5_0), FAMILY (col5_7), FAMILY (col5_13), FAMILY (col5_11), FAMILY (col5_1, col5_14));
        ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 479693936, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 5000000000}, {"columns": ["col1_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4485436644, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 5000000000}, {"columns": ["col1_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4815786014, "histo_col_type": "", "name": "__auto__", "null_count": 3738239233, "row_count": 5000000000}, {"columns": ["col1_16"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4097057410, "histo_col_type": "", "name": "__auto__", "null_count": 4666550129, "row_count": 5000000000}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 178241606, "histo_col_type": "", "name": "__auto__", "null_count": 3306587475, "row_count": 5000000000}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4954225858, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 5000000000}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4144798686, "histo_buckets": [{"distinct_range": 0, "num_eq": 5524724655541000652, "num_range": 0, "upper_bound": "-33206999781.40794557"}, {"distinct_range": 0, "num_eq": 20000000, "num_range": 100000000, "upper_bound": "8.766655461274646094E+23"}], "histo_col_type": "DECIMAL", "name": "__auto__", "null_count": 0, "row_count": 5000000000}, {"columns": ["col1_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1150182821, "histo_col_type": "", "name": "__auto__", "null_count": 3616004871, "row_count": 5000000000}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2884372102, "histo_col_type": "", "name": "__auto__", "null_count": 3213622052, "row_count": 5000000000}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4158557864, "histo_buckets": [{"distinct_range": 0, "num_eq": 300000, "num_range": 0, "upper_bound": "13322358"}, {"distinct_range": 1679805747377201000, "num_eq": 9000000, "num_range": 6668176465143060059, "upper_bound": "947976585"}, {"distinct_range": 3496.9135811845554, "num_eq": 1000, "num_range": 20000, "upper_bound": "1466176862"}, {"distinct_range": 0, "num_eq": 8585301846186148639, "num_range": 500000, "upper_bound": "1713981859"}, {"distinct_range": 0, "num_eq": 4187052241960609040, "num_range": 8223540968556476509, "upper_bound": "2143631088"}, {"distinct_range": 0, "num_eq": 100, "num_range": 0, "upper_bound": "3095350812"}, {"distinct_range": 0, "num_eq": 121735420742157326, "num_range": 911538798398568130, "upper_bound": "4183155662"}], "histo_col_type": "REGTYPE", "name": "__auto__", "null_count": 0, "row_count": 5000000000}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3726791563, "histo_col_type": "", "name": "__auto__", "null_count": 3537498838, "row_count": 5000000000}, {"columns": ["col1_17"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1381018469, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 5000000000}, {"columns": ["col1_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 524864885, "histo_col_type": "", "name": "__auto__", "null_count": 1678021482, "row_count": 5000000000}, {"columns": ["col1_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 971834283, "histo_buckets": [{"distinct_range": 0, "num_eq": 8584068241594836737, "num_range": 0, "upper_bound": "2172657260"}, {"distinct_range": 815408774020841600, "num_eq": 5069221937028541592, "num_range": 5494012893593363045, "upper_bound": "2641804630"}], "histo_col_type": "REGPROC", "name": "__auto__", "null_count": 2683736285, "row_count": 5000000000}, {"columns": ["col1_18"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2161388332, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 5000000000}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4049817435, "histo_col_type": "", "name": "__auto__", "null_count": 4209848480, "row_count": 5000000000}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 301209540, "histo_col_type": "", "name": "__auto__", "null_count": 3373246113, "row_count": 5000000000}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4361850550, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 5000000000}, {"columns": ["col1_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2368542557, "histo_col_type": "", "name": "__auto__", "null_count": 3201642779, "row_count": 5000000000}]':::JSONB;
        ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 9954, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 20000}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 19048, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 20000}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1160, "histo_col_type": "", "name": "__auto__", "null_count": 7903, "row_count": 20000}, {"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 16280, "histo_col_type": "", "name": "__auto__", "null_count": 5137, "row_count": 20000}, {"columns": ["col2_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 12351, "histo_col_type": "", "name": "__auto__", "null_count": 11295, "row_count": 20000}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 18851, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 20000}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2364, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 20000}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 16968, "histo_col_type": "", "name": "__auto__", "null_count": 17988, "row_count": 20000}, {"columns": ["col2_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 15006, "histo_col_type": "", "name": "__auto__", "null_count": 8458, "row_count": 20000}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 11908, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 20000}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3009, "histo_col_type": "", "name": "__auto__", "null_count": 8479, "row_count": 20000}]':::JSONB;
        ALTER TABLE table3 INJECT STATISTICS '[{"columns": ["col3_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5450626266035497957, "histo_buckets": [{"distinct_range": 0, "num_eq": 70, "num_range": 0, "upper_bound": "00000000-0000-0000-0000-000000000000"}, {"distinct_range": 244881465.8430563, "num_eq": 5051444548823242156, "num_range": 400000000, "upper_bound": "288ebf03-2b2b-42c6-88c2-7d9cfbcba501"}, {"distinct_range": 0, "num_eq": 10000000, "num_range": 0, "upper_bound": "2e79145f-2323-4a2f-8516-8df3600b98e6"}, {"distinct_range": 1936868614051692500, "num_eq": 80000000, "num_range": 1936868614051692646, "upper_bound": "42984220-b019-4192-9d05-1a9de3c00680"}, {"distinct_range": 700000000, "num_eq": 3094164593387912499, "num_range": 700000000, "upper_bound": "667e22b2-f6c3-4a02-8d6a-ff65aea38c78"}, {"distinct_range": 5000, "num_eq": 6921107373468305830, "num_range": 5000, "upper_bound": "a970e657-3c81-462d-9a82-c856fdd2e41b"}, {"distinct_range": 0, "num_eq": 10000, "num_range": 2966515067788930339, "upper_bound": "ad35b86d-9718-4994-87ef-d482202402bf"}, {"distinct_range": 4236776524115655700, "num_eq": 100000, "num_range": 4937131072365555670, "upper_bound": "cdba4bf4-f08f-4bd9-b1e4-a57eac2d5c98"}], "histo_col_type": "UUID", "name": "__auto__", "null_count": 0, "row_count": 8159591904705467770}, {"columns": ["col3_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6913611612739659944, "histo_col_type": "DECIMAL", "name": "__auto__", "null_count": 19096547260548152, "row_count": 8159591904705467770}]':::JSONB;
        ALTER TABLE table4 INJECT STATISTICS e'[{"columns": ["col4_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2008596528443255496, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7024956036047120174}, {"columns": ["col4_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6157303769106606106, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7024956036047120174}, {"columns": ["col4_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2478877401286108996, "histo_col_type": "", "name": "__auto__", "null_count": 4399493287774910177, "row_count": 7024956036047120174}, {"columns": ["col4_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5616734720655503854, "histo_col_type": "", "name": "__auto__", "null_count": 2591016633407858904, "row_count": 7024956036047120174}, {"columns": ["col4_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1900703066520451876, "histo_col_type": "", "name": "__auto__", "null_count": 3200984441930827191, "row_count": 7024956036047120174}, {"columns": ["col4_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5668247282281908447, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7024956036047120174}, {"columns": ["col4_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2131118032260034694, "histo_buckets": [{"distinct_range": 0, "num_eq": 900, "num_range": 0, "upper_bound": ""}, {"distinct_range": 0, "num_eq": 0, "num_range": 2104302893248551662, "upper_bound": "\\u001eF"}, {"distinct_range": 2369787636026640000, "num_eq": 50, "num_range": 4424721888388944177, "upper_bound": "=\\u001c{l(\\u000e*a"}, {"distinct_range": 10, "num_eq": 798752926619878577, "num_range": 10, "upper_bound": "?qmt#"}, {"distinct_range": 4001170588614960000, "num_eq": 6000000000, "num_range": 4835709142429916738, "upper_bound": "X"}, {"distinct_range": 3238.0210109813556, "num_eq": 6000, "num_range": 10000, "upper_bound": "a\\t"}, {"distinct_range": 30000, "num_eq": 2746487503141748684, "num_range": 30000, "upper_bound": "a(3F+0"}, {"distinct_range": 1935039584955301600, "num_eq": 700, "num_range": 8416329021446844070, "upper_bound": "}"}], "histo_col_type": "VARCHAR", "name": "__auto__", "null_count": 0, "row_count": 7024956036047120174}, {"columns": ["col4_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6304492602817591086, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7024956036047120174}, {"columns": ["col4_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1609374623744669885, "histo_col_type": "", "name": "__auto__", "null_count": 3632800331097373232, "row_count": 7024956036047120174}, {"columns": ["col4_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3727947775290771073, "histo_col_type": "", "name": "__auto__", "null_count": 1662350736183307715, "row_count": 7024956036047120174}, {"columns": ["col4_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5624556710974298774, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7024956036047120174}, {"columns": ["col4_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1459046771719361062, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7024956036047120174}]':::JSONB;
        ALTER TABLE table5 INJECT STATISTICS '[{"columns": ["col5_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 14659, "histo_col_type": "", "name": "__auto__", "null_count": 11998, "row_count": 30000}, {"columns": ["col5_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 20146, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 30000}, {"columns": ["col5_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 11266, "histo_buckets": [{"distinct_range": 0, "num_eq": 3000000, "num_range": 0, "upper_bound": "-2.107603304057179"}, {"distinct_range": 0, "num_eq": 9123988858213538928, "num_range": 50000000000, "upper_bound": "-1.9529804919188984"}, {"distinct_range": 800000000, "num_eq": 5167114321862938682, "num_range": 800000000, "upper_bound": "-1.5206289357416116"}, {"distinct_range": 47784378519.64253, "num_eq": 40000, "num_range": 90000000000, "upper_bound": "-0.26654795649881935"}, {"distinct_range": 0, "num_eq": 6000000000, "num_range": 40000000, "upper_bound": "0.7193910147985376"}, {"distinct_range": 0, "num_eq": 1782446687943929180, "num_range": 4486252414941684728, "upper_bound": "1.0054807145491103"}, {"distinct_range": 0, "num_eq": 80000, "num_range": 0, "upper_bound": "3.4028234663852886e+38"}], "histo_col_type": "FLOAT8", "name": "__auto__", "null_count": 0, "row_count": 30000}, {"columns": ["col5_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 26351, "histo_col_type": "", "name": "__auto__", "null_count": 25455, "row_count": 30000}, {"columns": ["col5_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5074, "histo_col_type": "", "name": "__auto__", "null_count": 22764, "row_count": 30000}, {"columns": ["col5_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 16223, "histo_col_type": "", "name": "__auto__", "null_count": 23078, "row_count": 30000}, {"columns": ["col5_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 28132, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 30000}, {"columns": ["col5_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7092, "histo_col_type": "", "name": "__auto__", "null_count": 23420, "row_count": 30000}, {"columns": ["col5_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 11634, "histo_col_type": "", "name": "__auto__", "null_count": 24351, "row_count": 30000}, {"columns": ["col5_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1224, "histo_col_type": "", "name": "__auto__", "null_count": 3759, "row_count": 30000}, {"columns": ["col5_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 11602, "histo_col_type": "", "name": "__auto__", "null_count": 16603, "row_count": 30000}, {"columns": ["col5_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3643, "histo_col_type": "", "name": "__auto__", "null_count": 22013, "row_count": 30000}, {"columns": ["col5_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 948, "histo_col_type": "", "name": "__auto__", "null_count": 28598, "row_count": 30000}, {"columns": ["col5_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 21574, "histo_col_type": "", "name": "__auto__", "null_count": 16064, "row_count": 30000}, {"columns": ["col5_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 10788, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 30000}]':::JSONB;
        CREATE TYPE rand_typ_0 AS ENUM ('e', 'el', 'yjurh', 'ufal', 'quhf', 'arght');
        CREATE TYPE rand_typ_1 AS ENUM ('pwxq', 'hcpd', 'mwyudm', 'kfvgz');
        CREATE TYPE rand_typ_2 AS ENUM ('vsyfy', 'egina', 'paav', 'urxv');
        CREATE TYPE rand_typ_3 AS ENUM ('nedp');
        CREATE TYPE rand_typ_4 AS ENUM ('isuc');
        ;
    rsg_test.go:598: 
        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:600: 
    rsg_test.go:601: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith481252334
--- FAIL: TestRandomSyntaxSQLSmith (300.84s)
Reproduce

To reproduce, try:

make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1
Same failure on other branches

  • #74272 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
  • #70663 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-master]
Internal log

mjibson marked as alumn{us/a}; resolving to rafiss instead

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity avatar Feb 14 '22 06:02 cockroach-teamcity

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-21.2 @ d625926de309d74b43acc2e1fb11bf4fba607c25:

Random syntax error:

    rsg_test.go:779: Crash detected: server panic: pq: internal error: ordering column group (7,17) contains non-equivalent columns (op values)

Query:

        WITH
        	with_60999 (col_346317)
        		AS (
        			SELECT
        				*
        			FROM
        				(
        					VALUES
        						(
        							inet_contains_or_equals('2d36:f3a:7b9c:ccd4:3354:ba5a:8318:58c/16':::INET::INET, '135.21.153.74/9':::INET::INET)::BOOL
        						)
        				)
        					AS tab_149344 (col_346317)
        		),
        	with_61000 (col_346318)
        		AS (
        			SELECT
        				*
        			FROM
        				(
        					VALUES
        						(127:::INT8),
        						((-2454818118622037033):::INT8),
        						(1598667705869789204:::INT8),
        						((-7207941494310799883):::INT8),
        						(7721142708385648004:::INT8),
        						(1:::INT8)
        				)
        					AS tab_149345 (col_346318)
        		)
        SELECT
        	e' 6?;P\x01wP\x1d':::STRING AS col_346319,
        	'':::STRING AS col_346320,
        	cte_ref_17745.col_346317 AS col_346321,
        	NULL AS col_346322
        FROM
        	defaultdb.public.table1 AS tab_149346
        	JOIN defaultdb.public.table1 AS tab_149347 ON (tab_149346.col1_4) = (tab_149347.col1_4),
        	with_60999 AS cte_ref_17745,
        	with_60999 AS cte_ref_17746
        WHERE
        	cte_ref_17745.col_346317
        ORDER BY
        	tab_149346.col1_4 DESC,
        	cte_ref_17746.col_346317 ASC,
        	cte_ref_17746.col_346317 ASC,
        	cte_ref_17746.col_346317 ASC,
        	tab_149347.col1_4 DESC
        LIMIT
        	90:::INT8;

Schema:

    rsg_test.go:596: To reproduce, use schema:
    rsg_test.go:598: 
        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, col1_1 DATE, col1_2 TIMESTAMPTZ NOT NULL, col1_3 NAME NOT NULL, col1_4 STRING AS (lower(CAST(col1_0 AS STRING))) STORED, UNIQUE (col1_4 DESC, col1_3 DESC, col1_1) STORING (col1_2), UNIQUE (col1_3, col1_4, col1_1 ASC, col1_2 DESC), INDEX (col1_4 ASC, col1_1 DESC, col1_3 ASC, col1_2), INVERTED INDEX (col1_4 DESC, col1_0 DESC) WHERE ((table1.col1_4 = '"':::STRING) AND (table1.col1_2 >= '0001-01-01 00:00:00+00:00':::TIMESTAMPTZ)) AND (table1.col1_3 > e'\x00':::STRING), INVERTED INDEX (col1_2, col1_1 ASC, col1_4 DESC, col1_0), INDEX (col1_3, col1_4 DESC) WHERE (((table1.col1_2 != '0001-01-01 00:00:00+00:00':::TIMESTAMPTZ) OR (table1.col1_3 < '':::STRING)) AND (table1.col1_4 = '':::STRING)) OR (table1.col1_1 != 'infinity':::DATE));
        CREATE TABLE table2 (col2_0 NAME[] NOT NULL, col2_1 UUID, col2_2 BIT(42) NULL, col2_3 GEOGRAPHY NOT NULL, col2_4 REGROLE, col2_5 GEOGRAPHY NOT NULL, col2_6 INT8 NOT NULL, col2_7 VARCHAR NOT NULL, col2_8 REGPROCEDURE NULL, col2_9 "char", col2_10 REGNAMESPACE, col2_11 STRING AS (lower(CAST(col2_1 AS STRING))) STORED, col2_12 STRING AS (CASE WHEN col2_10 IS NULL THEN '':::STRING ELSE e'{<]w_V\x0e2':::STRING END) VIRTUAL, INDEX (col2_2 DESC, col2_11) STORING (col2_1, col2_4, col2_7) WHERE table2.col2_6 = (-32768):::INT8, INDEX (col2_1 DESC), UNIQUE (col2_2, col2_12) WHERE (((table2.col2_6 = (-9223372036854775807):::INT8) AND (table2.col2_12 != e'\'':::STRING)) AND (table2.col2_11 <= '"':::STRING)) AND (table2.col2_9 < e'\x00':::STRING), UNIQUE (col2_6 DESC, col2_2, col2_7) WHERE ((((table2.col2_9 = e'\U00002603':::STRING) OR (table2.col2_11 <= 'X':::STRING)) OR (table2.col2_12 > e'\'':::STRING)) AND (table2.col2_6 <= (-2147483648):::INT8)) AND (table2.col2_7 >= e'\U00002603':::STRING));
        ALTER TABLE table1 INJECT STATISTICS e'[{"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 239494146633517444, "histo_col_type": "", "name": "__auto__", "null_count": 424115669116023811, "row_count": 2393017692090912536}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1784177202403575555, "histo_col_type": "", "name": "__auto__", "null_count": 1542759774400898066, "row_count": 2393017692090912536}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2161285960111450528, "histo_buckets": [{"distinct_range": 0, "num_eq": 40000, "num_range": 0, "upper_bound": "1979-10-30 14:04:41.00041+00:00"}, {"distinct_range": 0, "num_eq": 4856944701890935410, "num_range": 100000000, "upper_bound": "1994-08-20 08:57:50.000077+00:00"}, {"distinct_range": 5829000185065600000, "num_eq": 6509216692200394726, "num_range": 5829000185065600428, "upper_bound": "1996-02-15 03:56:03.000164+00:00"}], "histo_col_type": "TIMESTAMPTZ", "name": "__auto__", "null_count": 0, "row_count": 2393017692090912536}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1416259559402373084, "histo_col_type": "NAME", "name": "__auto__", "null_count": 0, "row_count": 2393017692090912536}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2321462269328779095, "histo_buckets": [{"distinct_range": 0, "num_eq": 1000000, "num_range": 0, "upper_bound": ".\\r``\\u0002\\rhv\\u000f"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 2310977672641416269, "row_count": 2393017692090912536}]':::JSONB;
        ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1296268290191140504, "histo_buckets": [{"distinct_range": 0, "num_eq": 6681010904447355, "num_range": 0, "upper_bound": "-9110747737642159722"}, {"distinct_range": 1185752999285822200, "num_eq": 1370409246995601616, "num_range": 4900738434779872008, "upper_bound": "-3371584998527551081"}], "histo_col_type": "INT8", "name": "__auto__", "null_count": 0, "row_count": 2392512354431662468}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 908187072660305029, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2392512354431662468}, {"columns": ["col2_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 995137810267885394, "histo_col_type": "", "name": "__auto__", "null_count": 1219644338453663105, "row_count": 2392512354431662468}, {"columns": ["col2_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1809009396328988151, "histo_col_type": "", "name": "__auto__", "null_count": 2322351009183874069, "row_count": 2392512354431662468}, {"columns": ["col2_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1305973193900356164, "histo_col_type": "", "name": "__auto__", "null_count": 2288516591984022071, "row_count": 2392512354431662468}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1189300438151874500, "histo_col_type": "UUID", "name": "__auto__", "null_count": 1869227017150691672, "row_count": 2392512354431662468}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 688019851218182445, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2392512354431662468}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1621228006098357015, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2392512354431662468}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1709393893582358776, "histo_col_type": "", "name": "__auto__", "null_count": 1325007491852479086, "row_count": 2392512354431662468}, {"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 857360898824471883, "histo_col_type": "", "name": "__auto__", "null_count": 782694168198814905, "row_count": 2392512354431662468}, {"columns": ["col2_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1605810946718401191, "histo_col_type": "", "name": "__auto__", "null_count": 957047073451669458, "row_count": 2392512354431662468}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 289641240893068775, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2392512354431662468}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2299446376178085704, "histo_buckets": [{"distinct_range": 0, "num_eq": 700000, "num_range": 0, "upper_bound": "001101011100101111100000011001100101100001"}, {"distinct_range": 6874694040523066, "num_eq": 40000, "num_range": 838441455279605860, "upper_bound": "001110011000001000111100001000001000111010"}, {"distinct_range": 78124017.31966838, "num_eq": 5446233035130360938, "num_range": 200000000, "upper_bound": "010010100010000001000000001001000001001100"}, {"distinct_range": 5620569.476532128, "num_eq": 7625388513332803585, "num_range": 6000000, "upper_bound": "011010001000100110001100000001011111100000"}, {"distinct_range": 8926766.929109167, "num_eq": 8950031002634823306, "num_range": 10000000, "upper_bound": "100010101011001001101111111100011011110001"}, {"distinct_range": 8334967120863581000, "num_eq": 2000, "num_range": 8334967120863580875, "upper_bound": "101001011011000111100111100000110110000100"}, {"distinct_range": 775308.8667110266, "num_eq": 1000, "num_range": 800000, "upper_bound": "101100101101111001101100011111101000011010"}, {"distinct_range": 0, "num_eq": 5000000000, "num_range": 1140187453511828080, "upper_bound": "111100001101010010000100010111110100011011"}, {"distinct_range": 6000, "num_eq": 2194460531385252597, "num_range": 6000, "upper_bound": "111100101110100011010100010101011000100011"}], "histo_col_type": "BIT(42)", "name": "__auto__", "null_count": 337157981586328740, "row_count": 2392512354431662468}]':::JSONB;
        CREATE TYPE rand_typ_0 AS ENUM ('uzfnp', 'yxq', 'tptv', 'oko', 'wrilki', 'wbp');
        CREATE TYPE rand_typ_1 AS ENUM ('gahkx', 'qsnl', 'imvlb', 'yfl', 'jobfnr');
        CREATE TYPE rand_typ_2 AS ENUM ('cuhwcg', 'wbala', 'c', 'wwfck', 'gfozom');
        CREATE TYPE rand_typ_3 AS ENUM ('gnre', 'ryj', 'woyb', 'kbymto', 'fxri', 'dxhr');
        CREATE TYPE rand_typ_4 AS ENUM ('ze', 'qhxcb', 'hsxfy', 'nyiy', 'inoo', 'zil');
        ;
    rsg_test.go:598: 
        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:600: 
    rsg_test.go:601: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith000171404
--- FAIL: TestRandomSyntaxSQLSmith (301.48s)
Reproduce

To reproduce, try:

make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1
Same failure on other branches

  • #74272 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
  • #70663 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-master]
Internal log

mjibson marked as alumn{us/a}; resolving to rafiss instead

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity avatar Feb 17 '22 06:02 cockroach-teamcity

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-21.2 @ 0bb1218f1c16dbebda16ace42d2d682b22aa3c96:

Random syntax error:

    rsg_test.go:779: Crash detected: server panic: statement exec timeout

Query:

        SELECT
        	3748123410:::OID AS col_863926,
        	tab_401772.col2_0 AS col_863927,
        	tab_401777.col5_2 AS col_863928,
        	e'\x13\x12xP':::STRING AS col_863929,
        	tab_401781.col3_2 AS col_863930,
        	3.847418936710210978E+22:::DECIMAL AS col_863931,
        	tab_401777.col5_2 AS col_863932,
        	1962236998:::OID AS col_863933,
        	tab_401782.col1_2 AS col_863934,
        	tab_401782.col1_5 AS col_863935,
        	tab_401782.col1_0 AS col_863936,
        	tab_401779.col2_0 AS col_863937,
        	tab_401777.col5_1 AS col_863938,
        	tab_401778.crdb_internal_mvcc_timestamp AS col_863939,
        	tab_401778.col5_5 AS col_863940
        FROM
        	defaultdb.public.table2 AS tab_401772
        	JOIN defaultdb.public.table1 AS tab_401773 ON (tab_401772.col2_0) = (tab_401773.col1_1)
        	JOIN defaultdb.public.table5@table5_col5_4_col5_0_idx AS tab_401777
        		JOIN defaultdb.public.table5@table5_col5_4_col5_0_idx AS tab_401778
        			JOIN defaultdb.public.table2 AS tab_401779
        				JOIN defaultdb.public.table1 AS tab_401780 ON (tab_401779.col2_0) = (tab_401780.col1_1)
        				JOIN defaultdb.public.table3@primary AS tab_401781 ON
        						(tab_401780.col1_1) = (tab_401781.tableoid) AND (tab_401779.col2_0) = (tab_401781.tableoid)
        				JOIN defaultdb.public.table1@[0] AS tab_401782 ON (tab_401780.col1_1) = (tab_401782.col1_1) ON
        					(tab_401778.col5_0) = (tab_401780.col1_1) ON
        				(tab_401777.col5_0) = (tab_401780.col1_1) AND (tab_401777.col5_1) = (tab_401781.tableoid) ON
        			(tab_401773.col1_1) = (tab_401781.tableoid)
        ORDER BY
        	tab_401778.col5_0 ASC, tab_401782.crdb_internal_mvcc_timestamp ASC;

Schema:

    rsg_test.go:596: To reproduce, use schema:
    rsg_test.go:598: 
        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 OID NOT NULL, col1_2 FLOAT8 NOT NULL, col1_3 FLOAT8 NOT NULL, col1_4 INET NOT NULL, col1_5 BOX2D NOT NULL, col1_6 FLOAT8 NOT NULL AS (col1_3 + col1_2) STORED, INVERTED INDEX (col1_1 ASC, col1_6 ASC, (col1_3 + col1_2) DESC, col1_3 DESC, col1_0 ASC) WHERE table1.col1_3 = 3.4028234663852886e+38:::FLOAT8, FAMILY (col1_4), FAMILY (col1_0), FAMILY (col1_6), FAMILY (col1_1), FAMILY (col1_5, col1_3, col1_2));
        CREATE TABLE table2 (col2_0 REGPROC NOT NULL, col2_1 VARCHAR NOT NULL, col2_2 VARCHAR NOT NULL, col2_3 BYTES NOT NULL, col2_4 DATE NOT NULL, col2_5 CHAR NOT NULL, col2_6 REGPROC NULL, col2_7 BIT(25) NOT NULL, col2_8 INTERVAL NOT NULL, col2_9 INT8, col2_10 REGNAMESPACE, col2_11 REGTYPE, col2_12 INT2 NULL, PRIMARY KEY (col2_7 ASC, col2_5 DESC, col2_3 DESC, col2_8 DESC, col2_4 DESC), col2_13 STRING NOT NULL AS (CASE WHEN col2_0 IS NULL THEN e'\f\x7f.\x05\x7f\x03MSG':::STRING ELSE e'\x16V\x07:b\x1af9e':::STRING END) VIRTUAL, INDEX (col2_7, col2_3 ASC, col2_13), UNIQUE (col2_6 DESC) STORING (col2_1, col2_2, col2_9, col2_11, col2_12), UNIQUE (col2_8 DESC, col2_1, col2_5, col2_9 ASC, col2_2 ASC, col2_11 ASC, col2_13 DESC, (col2_12 + col2_9) DESC) STORING (col2_0, col2_12) WHERE (((((((table2.col2_12 > 127:::INT8) OR (table2.col2_13 >= e'\x00':::STRING)) AND (table2.col2_1 >= 'X':::STRING)) AND (table2.col2_2 <= '"':::STRING)) AND (table2.col2_3 != '\xff':::BYTES)) OR (table2.col2_5 > e'\x00':::STRING)) AND (table2.col2_9 = 2147483647:::INT8)) OR (table2.col2_4 <= '-infinity':::DATE), UNIQUE (col2_0 ASC, col2_13 DESC, col2_11, col2_12), UNIQUE (col2_10) STORING (col2_0, col2_1, col2_9, col2_11, col2_12) WHERE (((((((table2.col2_5 >= e'\x00':::STRING) AND (table2.col2_3 != '\x22':::BYTES)) OR (table2.col2_9 > 0:::INT8)) OR (table2.col2_13 > 'X':::STRING)) AND (table2.col2_1 < e'\U00002603':::STRING)) OR (table2.col2_4 < '1970-01-01':::DATE)) AND (table2.col2_2 >= e'\U00002603':::STRING)) OR (table2.col2_12 < (-32768):::INT8), UNIQUE (col2_1 DESC, col2_5 DESC, col2_3, (col2_9 + col2_12), col2_4, col2_11 ASC, col2_13, col2_2 ASC), UNIQUE (col2_2, col2_12 DESC, col2_9 DESC, col2_8 DESC, (CASE WHEN col2_6 IS NULL THEN e'/\x19/4':::STRING ELSE '{sd1^}':::STRING END) ASC, col2_13, col2_0), INDEX (col2_10, lower(CAST(col2_7 AS STRING)) DESC, col2_7 DESC, col2_1, col2_13 DESC, col2_9, col2_8 DESC, col2_4, col2_3, col2_6, col2_11 ASC, col2_2, col2_12 ASC) WHERE (((((((table2.col2_4 = '1970-01-01':::DATE) OR (table2.col2_5 > '"':::STRING)) AND (table2.col2_9 != 32767:::INT8)) OR (table2.col2_3 < '\x00':::BYTES)) OR (table2.col2_2 > e'\U00002603':::STRING)) OR (table2.col2_13 != e'\'':::STRING)) OR (table2.col2_12 >= (-128):::INT8)) OR (table2.col2_1 != 'X':::STRING), UNIQUE (col2_0 DESC, (col2_9 + col2_12) DESC, col2_6 DESC, col2_12 DESC, col2_5, col2_7, col2_9, col2_11 DESC, col2_10 ASC, col2_4 DESC) WHERE (((((table2.col2_13 < e'\U00002603':::STRING) OR (table2.col2_1 < '':::STRING)) AND (table2.col2_4 < 'infinity':::DATE)) AND (table2.col2_5 != e'\'':::STRING)) AND (table2.col2_2 < e'\x00':::STRING)) OR (table2.col2_3 < '\x22':::BYTES), FAMILY (col2_2, col2_6), FAMILY (col2_4, col2_10, col2_12), FAMILY (col2_9, col2_5), FAMILY (col2_0, col2_11), FAMILY (col2_8, col2_7, col2_1), FAMILY (col2_3), UNIQUE (col2_1));
        CREATE TABLE table3 (col3_0 FLOAT4 NOT NULL, col3_1 BOX2D NOT NULL, col3_2 TIMESTAMPTZ NOT NULL, PRIMARY KEY (col3_0 DESC, col3_1 ASC, col3_2), INDEX (col3_0, col3_2 DESC, col3_1 ASC) WHERE (table3.col3_2 = '-2000-01-01 00:00:00+00:00':::TIMESTAMPTZ) OR (table3.col3_0 < 0.0:::FLOAT8), INDEX (col3_2 ASC, col3_0 ASC, col3_1 ASC) WHERE (table3.col3_2 >= '3000-01-01 00:00:00+00:00':::TIMESTAMPTZ) OR (table3.col3_0 != (-1.0):::FLOAT8), UNIQUE (col3_1, col3_2, col3_0 DESC), INDEX ((col3_0 + (-1.4622809886932373):::FLOAT8) ASC, col3_1 ASC, lower(CAST(col3_1 AS STRING)) ASC), UNIQUE (col3_1 DESC), INDEX (col3_0 ASC) WHERE (table3.col3_2 <= '-2000-01-01 00:00:00+00:00':::TIMESTAMPTZ) AND (table3.col3_0 < 1.0:::FLOAT8), UNIQUE (col3_1 ASC, col3_0 DESC, col3_2 DESC) WHERE (table3.col3_0 >= '+Inf':::FLOAT8) AND (table3.col3_2 != '294276-12-31 23:59:59.999999+00:00':::TIMESTAMPTZ));
        CREATE TABLE table4 (col4_0 DATE NOT NULL, PRIMARY KEY (col4_0 ASC), INDEX (col4_0 ASC), UNIQUE (col4_0 DESC));
        CREATE TABLE table5 (col5_0 REGROLE NOT NULL, col5_1 REGTYPE, col5_2 JSONB NULL, col5_3 TIMESTAMP NOT NULL, col5_4 VARCHAR NOT NULL, col5_5 STRING NOT NULL AS (CASE WHEN col5_3 IS NULL THEN e'n\x15\x06#\x17':::STRING ELSE e'\x19&=\x1f\x0b\x0eXb':::STRING END) VIRTUAL, INDEX (col5_4, col5_0 DESC) STORING (col5_2) WHERE table5.col5_5 = 'X':::STRING, FAMILY (col5_2, col5_4, col5_0), FAMILY (col5_1, col5_3));
        ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 161821948, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 400000000}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 60400471, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 400000000}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 54521676, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 400000000}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 166337983, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 400000000}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 380338407, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 400000000}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 214542867, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 400000000}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 33061330, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 400000000}]':::JSONB;
        ALTER TABLE table2 INJECT STATISTICS e'[{"columns": ["col2_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 47905282674322779, "histo_buckets": [{"distinct_range": 0, "num_eq": 50000000000, "num_range": 0, "upper_bound": "2166954194"}, {"distinct_range": 271.65226395986303, "num_eq": 70, "num_range": 600, "upper_bound": "2372288141"}, {"distinct_range": 6500923034898108000, "num_eq": 1000000000, "num_range": 6500923034898108575, "upper_bound": "2497096784"}, {"distinct_range": 0, "num_eq": 8000000000, "num_range": 0, "upper_bound": "2637344681"}, {"distinct_range": 671584299323563500, "num_eq": 6000000000, "num_range": 3153991594191899952, "upper_bound": "3209457595"}, {"distinct_range": 52167.45598321562, "num_eq": 7803196561799420901, "num_range": 90000, "upper_bound": "3769839846"}, {"distinct_range": 817183160858601300, "num_eq": 10000, "num_range": 1467394310092885390, "upper_bound": "4045497012"}], "histo_col_type": "REGNAMESPACE", "name": "__auto__", "null_count": 213831797534790074, "row_count": 2415207483620791937}, {"columns": ["col2_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 89574387708610895, "histo_col_type": "", "name": "__auto__", "null_count": 952897227949289699, "row_count": 2415207483620791937}, {"columns": ["col2_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1361687206781995579, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2415207483620791937}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 787842539746419892, "histo_buckets": [{"distinct_range": 0, "num_eq": 1000, "num_range": 0, "upper_bound": ""}, {"distinct_range": 0, "num_eq": 40000000000, "num_range": 0, "upper_bound": "\\u000f\\u001f*6\\t"}, {"distinct_range": 3000, "num_eq": 5000, "num_range": 3000, "upper_bound": "%\\u0002[3Cfz"}, {"distinct_range": 300000, "num_eq": 7000, "num_range": 300000, "upper_bound": "*>\\u000er\\u0018~ h"}, {"distinct_range": 12562579783.435518, "num_eq": 8738778342626872931, "num_range": 30000000000, "upper_bound": "/u"}, {"distinct_range": 0, "num_eq": 4093223437996789190, "num_range": 4664128189786006410, "upper_bound": "d_\\t(Y,ta~"}, {"distinct_range": 0, "num_eq": 8740293154472018575, "num_range": 5938189984942703440, "upper_bound": "y"}, {"distinct_range": 4248593909735223300, "num_eq": 212939084575903236, "num_range": 4248593909735223112, "upper_bound": "}A"}], "histo_col_type": "VARCHAR", "name": "__auto__", "null_count": 0, "row_count": 2415207483620791937}, {"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1020867733706194173, "histo_buckets": [{"distinct_range": 0, "num_eq": 8000000000, "num_range": 0, "upper_bound": "-55 years -5 mons -346 days -14:16:39.354143"}, {"distinct_range": 10000000, "num_eq": 600000, "num_range": 10000000, "upper_bound": "-28 years -8 mons -732 days -04:20:26.471694"}, {"distinct_range": 0, "num_eq": 900000000, "num_range": 5860969960419586214, "upper_bound": "-27 years -9 mons -473 days -00:44:40.419027"}, {"distinct_range": 9063424104270522000, "num_eq": 373195796611008839, "num_range": 9063424104270522748, "upper_bound": "26 years 8 mons 361 days 01:29:51.187368"}, {"distinct_range": 0, "num_eq": 8628175735443272708, "num_range": 3529871638293349586, "upper_bound": "49 years 3 mons 480 days 19:02:38.162257"}], "histo_col_type": "INTERVAL", "name": "__auto__", "null_count": 0, "row_count": 2415207483620791937}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 434544111939620519, "histo_buckets": [{"distinct_range": 0, "num_eq": 2999696275814106684, "num_range": 0, "upper_bound": "0"}, {"distinct_range": 0, "num_eq": 999415088002050953, "num_range": 0, "upper_bound": "1017442614"}, {"distinct_range": 4563262643891341000, "num_eq": 6530574776625780855, "num_range": 4563262643891340953, "upper_bound": "1241698949"}, {"distinct_range": 0, "num_eq": 0, "num_range": 8368032343759450175, "upper_bound": "1302269435"}, {"distinct_range": 0, "num_eq": 4683657636423588791, "num_range": 1857657162336498468, "upper_bound": "2113969352"}, {"distinct_range": 0, "num_eq": 40000000000, "num_range": 8375069952383891864, "upper_bound": "2563327323"}, {"distinct_range": 0, "num_eq": 3532895135813419297, "num_range": 0, "upper_bound": "3762751029"}], "histo_col_type": "REGPROC", "name": "__auto__", "null_count": 1536973372588413100, "row_count": 2415207483620791937}, {"columns": ["col2_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1214650250411691856, "histo_col_type": "", "name": "__auto__", "null_count": 1491961666307580782, "row_count": 2415207483620791937}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1164951670850349164, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2415207483620791937}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1510694345594035169, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2415207483620791937}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 926851768398792375, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2415207483620791937}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2298251301707838046, "histo_buckets": [{"distinct_range": 0, "num_eq": 1000, "num_range": 0, "upper_bound": "0000100100011100111000111"}, {"distinct_range": 53.30014261791846, "num_eq": 161763198332648514, "num_range": 70, "upper_bound": "0000110010001010110010000"}, {"distinct_range": 12263216.971764417, "num_eq": 2784823388812844757, "num_range": 100000000, "upper_bound": "0101011011000111011001110"}, {"distinct_range": 0, "num_eq": 100000000, "num_range": 3913527442195550744, "upper_bound": "1110101001101011010010010"}, {"distinct_range": 6000, "num_eq": 3213825157897665059, "num_range": 6000, "upper_bound": "1111000100011001100100001"}, {"distinct_range": 2815288299240359400, "num_eq": 500000000, "num_range": 3765972292088422309, "upper_bound": "1111100100001011000010100"}], "histo_col_type": "BIT(25)", "name": "__auto__", "null_count": 0, "row_count": 2415207483620791937}, {"columns": ["col2_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 206680415877681449, "histo_col_type": "", "name": "__auto__", "null_count": 313879069930885697, "row_count": 2415207483620791937}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 845073253370802139, "histo_col_type": "VARCHAR", "name": "__auto__", "null_count": 0, "row_count": 2415207483620791937}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 347708779954354202, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 2415207483620791937}]':::JSONB;
        ALTER TABLE table3 INJECT STATISTICS '[{"columns": ["col3_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 134807848329403109, "histo_buckets": [{"distinct_range": 0, "num_eq": 70, "num_range": 0, "upper_bound": "-1.9947282075881958"}, {"distinct_range": 22120083806.15295, "num_eq": 0, "num_range": 50000000000, "upper_bound": "-1.1666347980499268"}, {"distinct_range": 7991688642478792000, "num_eq": 4773966732631181184, "num_range": 7991688642478791182, "upper_bound": "-0.5749599933624268"}, {"distinct_range": 74931330347.7555, "num_eq": 9144596680177006118, "num_range": 100000000000, "upper_bound": "-0.5119979381561279"}, {"distinct_range": 0, "num_eq": 0, "num_range": 500000, "upper_bound": "-0.3713502883911133"}, {"distinct_range": 0, "num_eq": 7000000000, "num_range": 6100829145895495811, "upper_bound": "-0.11708433926105499"}, {"distinct_range": 506086559703775740, "num_eq": 8506899107121076378, "num_range": 506086559703775734, "upper_bound": "0.6409775018692017"}, {"distinct_range": 1203595240784780800, "num_eq": 7176870932941603116, "num_range": 1203595240784780880, "upper_bound": "1.1883771419525146"}, {"distinct_range": 2793345053918781400, "num_eq": 4311188214109312674, "num_range": 2793345053918781456, "upper_bound": "1.9344149827957153"}], "histo_col_type": "FLOAT4", "name": "__auto__", "null_count": 0, "row_count": 601406772593114864}, {"columns": ["col3_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 310468184917212265, "histo_buckets": [{"distinct_range": 0, "num_eq": 90, "num_range": 0, "upper_bound": "BOX(-0.4047979426306725 -0.1980938807695109,-0.019148288334837837 0.9118516991689145)"}, {"distinct_range": 28543414.464347593, "num_eq": 300, "num_range": 80000000, "upper_bound": "BOX(0.02406016556728663 -1.5610244315607291,0.19278968368180063 -0.41484677619230315)"}, {"distinct_range": 6998269271724454000, "num_eq": 4907404394687648001, "num_range": 7678681178871910244, "upper_bound": "BOX(0.3332114985192969 -0.6464538300890672,0.46584150949870007 0.4936027355601388)"}], "histo_col_type": "BOX2D", "name": "__auto__", "null_count": 0, "row_count": 601406772593114864}, {"columns": ["col3_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 387512931505137754, "histo_buckets": [{"distinct_range": 0, "num_eq": 30000000000, "num_range": 0, "upper_bound": "1986-08-22 14:22:05.000033+00:00"}], "histo_col_type": "TIMESTAMPTZ", "name": "__auto__", "null_count": 0, "row_count": 601406772593114864}]':::JSONB;
        ALTER TABLE table4 INJECT STATISTICS '[{"columns": ["col4_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 54679246094, "histo_buckets": [{"distinct_range": 0, "num_eq": 6886556336769478767, "num_range": 0, "upper_bound": "1974-09-19"}, {"distinct_range": 72.73333468076886, "num_eq": 5489321783300386454, "num_range": 80, "upper_bound": "1976-06-26"}, {"distinct_range": 0, "num_eq": 100000000, "num_range": 100000000, "upper_bound": "1977-05-05"}, {"distinct_range": 100000000000, "num_eq": 3152441637198697227, "num_range": 100000000000, "upper_bound": "1979-07-20"}, {"distinct_range": 0, "num_eq": 6878124865486239190, "num_range": 0, "upper_bound": "1986-08-14"}, {"distinct_range": 0, "num_eq": 70000000, "num_range": 560573493279213016, "upper_bound": "1990-03-04"}, {"distinct_range": 319.02320099852244, "num_eq": 2246825892574783892, "num_range": 1000, "upper_bound": "1990-12-28"}, {"distinct_range": 0, "num_eq": 9045134213856006972, "num_range": 8343394692959363253, "upper_bound": "1992-10-03"}, {"distinct_range": 177766937.41025338, "num_eq": 6236941571047398161, "num_range": 1000000000, "upper_bound": "1993-01-06"}], "histo_col_type": "DATE", "name": "__auto__", "null_count": 0, "row_count": 60000000000}]':::JSONB;
        ALTER TABLE table5 INJECT STATISTICS e'[{"columns": ["col5_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 12497270, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 70000000}, {"columns": ["col5_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 55218002, "histo_col_type": "", "name": "__auto__", "null_count": 59645922, "row_count": 70000000}, {"columns": ["col5_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 16933078, "histo_col_type": "", "name": "__auto__", "null_count": 31917848, "row_count": 70000000}, {"columns": ["col5_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 52365911, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 70000000}, {"columns": ["col5_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 32785649, "histo_buckets": [{"distinct_range": 0, "num_eq": 60000, "num_range": 0, "upper_bound": "\\t@\\rG/"}, {"distinct_range": 0, "num_eq": 3152854965128141333, "num_range": 8543793097820417535, "upper_bound": "\\u000c%"}, {"distinct_range": 163160928.9565113, "num_eq": 30000, "num_range": 300000000, "upper_bound": "\\u0016B"}, {"distinct_range": 0, "num_eq": 3340559801826462096, "num_range": 6043984751949980628, "upper_bound": "*\\u000cXX_\\u001e"}, {"distinct_range": 0, "num_eq": 6297293164211642420, "num_range": 3000000000, "upper_bound": "-jf"}, {"distinct_range": 500000000, "num_eq": 300000000, "num_range": 500000000, "upper_bound": "0<&t\\u0018M\\u0001\\u0016@"}, {"distinct_range": 12763.187331471561, "num_eq": 2421631171016522870, "num_range": 30000, "upper_bound": "j``dO>M\\u0016"}], "histo_col_type": "VARCHAR", "name": "__auto__", "null_count": 0, "row_count": 70000000}, {"columns": ["col5_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 9012345, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 70000000}]':::JSONB;
        ALTER TABLE table5 ADD FOREIGN KEY (col5_4) REFERENCES table2 (col2_1) ON UPDATE RESTRICT;
        CREATE TYPE rand_typ_0 AS ENUM ('eqi', 'g', 'jzqw', 'gvhry', 'ldje');
        CREATE TYPE rand_typ_1 AS ENUM ('adoqe');
        CREATE TYPE rand_typ_2 AS ENUM ('hmlj');
        CREATE TYPE rand_typ_3 AS ENUM ('wgqjvm');
        ;
    rsg_test.go:598: 
        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:600: 
    rsg_test.go:601: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith759547265
--- FAIL: TestRandomSyntaxSQLSmith (300.97s)
Reproduce

To reproduce, try:

make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1
Same failure on other branches

  • #74272 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
  • #70663 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-master]
Internal log

mjibson marked as alumn{us/a}; resolving to rafiss instead

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity avatar Feb 20 '22 06:02 cockroach-teamcity

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-21.2 @ 08814ae47e600692591605f9f811701e638981aa:

Random syntax error:

    rsg_test.go:779: Crash detected: server panic: statement exec timeout

Query:

        SELECT
        	tab_419989.col5_2 AS col_958976,
        	true AS col_958977,
        	5.088307198799486493E+27:::DECIMAL AS col_958978,
        	tab_419994.col2_15 AS col_958979,
        	1515342668:::INT8 AS col_958980,
        	tab_419991._string AS col_958981,
        	0:::DECIMAL AS col_958982,
        	28050:::INT8 AS col_958983,
        	NULL AS col_958984,
        	tab_419991._float8 AS col_958985,
        	tab_419994.col2_18 AS col_958986,
        	e'Q\x05}':::STRING AS col_958987,
        	tab_419994.col2_12 AS col_958988,
        	e'\x00':::STRING AS col_958989,
        	tab_419994.col2_16 AS col_958990
        FROM
        	defaultdb.public.table1@table1_col1_2_col1_0_col1_1_key AS tab_419985
        	JOIN defaultdb.public.table1@table1_col1_2_col1_0_col1_1_key AS tab_419986
        		JOIN defaultdb.public.table4@[0] AS tab_419987
        			JOIN defaultdb.public.table1@table1_col1_1_key AS tab_419988
        				JOIN defaultdb.public.table5@table5_col5_2_col5_1_col5_0_key AS tab_419989
        					INNER JOIN defaultdb.public.table1@[0] AS tab_419990
        						JOIN defaultdb.public.seed@[0] AS tab_419991 ON (tab_419990.col1_2) = (tab_419991._int2) ON
        							true ON (tab_419988.tableoid) = (tab_419989.tableoid) ON
        					(tab_419987.tableoid) = (tab_419988.tableoid)
        					AND (tab_419987.col4_6) = (tab_419989.tableoid)
        					AND (tab_419987.tableoid) = (tab_419989.col5_1)
        					AND (tab_419987.crdb_internal_mvcc_timestamp) = (tab_419991._decimal)
        					AND (tab_419987.col4_6) = (tab_419991.tableoid)
        					AND (tab_419987.col4_12) = (tab_419991._string)
        			JOIN defaultdb.public.table1 AS tab_419992
        				JOIN defaultdb.public.table2 AS tab_419993 ON (tab_419992.col1_1) = (tab_419993.col2_5)
        				JOIN defaultdb.public.table2@table2_expr_key AS tab_419994 ON
        						(tab_419993.col2_5) = (tab_419994.col2_14)
        						AND (tab_419993.col2_5) = (tab_419994.col2_11)
        						AND (tab_419992.col1_1) = (tab_419994.col2_11)
        						AND (tab_419993.col2_5) = (tab_419994.col2_17)
        						AND (tab_419992.col1_1) = (tab_419994.col2_13) ON
        					(tab_419991._jsonb) = (tab_419994.col2_4) AND (tab_419991._int2) = (tab_419994.col2_16) ON
        				(tab_419986.col1_0) = (tab_419987.col4_2) AND (tab_419986.col1_1) = (tab_419987.col4_15) ON
        			(tab_419985.col1_0) = (tab_419994.col2_12) AND (tab_419985.col1_0) = (tab_419986.col1_0)
        	JOIN defaultdb.public.table1 AS tab_419995
        		JOIN defaultdb.public.table5 AS tab_419996 ON (tab_419995.col1_1) = (tab_419996.col5_2) ON
        			(tab_419994.col2_13) = (tab_419995.col1_1);

Schema:

    rsg_test.go:596: To reproduce, use schema:
    rsg_test.go:598: 
        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 INT2 NOT NULL, col1_1 VARCHAR NOT NULL, PRIMARY KEY (col1_0 DESC, col1_1 ASC), col1_2 INT2 NOT NULL AS (col1_0 + 11135:::INT8) STORED, UNIQUE (col1_2 DESC, col1_0, col1_1), INDEX (col1_1 ASC, col1_2 ASC) WHERE table1.col1_2 != (-1):::INT8, FAMILY (col1_1), FAMILY (col1_0), FAMILY (col1_2), UNIQUE (col1_1));
        CREATE TABLE table2 (col2_0 INT2 NOT NULL, col2_1 UUID NOT NULL, col2_2 BIT(30) NULL, col2_3 TIME NOT NULL, col2_4 JSONB, col2_5 CHAR NULL, col2_6 INT2, col2_7 TIMESTAMPTZ[] NOT NULL, col2_8 REGPROCEDURE NULL, col2_9 GEOGRAPHY, col2_10 VARCHAR NOT NULL, col2_11 STRING NOT NULL AS (lower(col2_10)) STORED, col2_12 INT2 AS (col2_6 + col2_0) VIRTUAL, col2_13 STRING NOT NULL AS (lower(col2_10)) VIRTUAL, col2_14 STRING NOT NULL AS (lower(CAST(col2_1 AS STRING))) VIRTUAL, col2_15 INT2 AS (col2_6 + col2_0) VIRTUAL, col2_16 INT2 AS (col2_0 + col2_6) VIRTUAL, col2_17 STRING AS (lower(CAST(col2_9 AS STRING))) STORED, col2_18 STRING NOT NULL AS (lower(col2_10)) VIRTUAL, UNIQUE ((CASE WHEN col2_7 IS NULL THEN e'M\x16\x15kvd;X/':::STRING ELSE e'\x02OW':::STRING END)), FAMILY (col2_0), FAMILY (col2_9), FAMILY (col2_11), FAMILY (col2_2), FAMILY (col2_7, col2_6, col2_4), FAMILY (col2_8), FAMILY (col2_17), FAMILY (col2_5, col2_10), FAMILY (col2_1), FAMILY (col2_3), UNIQUE (col2_5, col2_8));
        CREATE TABLE table3 (col3_0 INET NOT NULL, col3_1 UUID, col3_2 STRING NOT NULL, col3_3 REGCLASS, col3_4 BOOL NULL, col3_5 NAME NOT NULL, col3_6 JSONB, col3_7 BIT(20) NOT NULL, col3_8 INT8, col3_9 STRING NOT NULL AS (lower(col3_2)) STORED, col3_10 STRING NOT NULL AS (lower(CAST(col3_0 AS STRING))) VIRTUAL, col3_11 STRING AS (lower(CAST(col3_1 AS STRING))) VIRTUAL, col3_12 INT8 AS (col3_8 + (-2123245107354204078):::INT8) VIRTUAL, col3_13 STRING NOT NULL AS (lower(CAST(col3_0 AS STRING))) STORED, col3_14 STRING AS (CASE WHEN col3_3 IS NULL THEN e'_F#\'_H':::STRING ELSE e'\x1bMN? \x1aw':::STRING END) STORED, col3_15 STRING AS (lower(CAST(col3_1 AS STRING))) STORED, col3_16 STRING NOT NULL AS (lower(col3_2)) STORED, INDEX (col3_0, col3_16) WHERE ((((((((((table3.col3_4 AND (table3.col3_12 != (-9223372036854775807):::INT8)) AND (table3.col3_10 = '"':::STRING)) OR (table3.col3_9 > '':::STRING)) OR (table3.col3_15 < '':::STRING)) OR (table3.col3_16 <= 'X':::STRING)) AND (table3.col3_14 = '':::STRING)) OR (table3.col3_13 >= 'X':::STRING)) OR (table3.col3_11 < 'X':::STRING)) AND (table3.col3_5 <= e'\'':::STRING)) AND (table3.col3_2 <= 'X':::STRING)) AND (table3.col3_8 >= (-32768):::INT8), INVERTED INDEX (col3_0 DESC, col3_8 DESC, col3_16 DESC, col3_4, lower(CAST(col3_6 AS STRING)) DESC, col3_14 DESC, col3_2 DESC, col3_5 ASC, col3_6 ASC) WHERE (((((((((((NOT table3.col3_4) AND (table3.col3_13 >= 'X':::STRING)) OR (table3.col3_12 < (-2147483648):::INT8)) AND (table3.col3_10 != e'\'':::STRING)) OR (table3.col3_11 != '"':::STRING)) AND (table3.col3_2 < e'\'':::STRING)) OR (table3.col3_5 > 'X':::STRING)) OR (table3.col3_8 > (-9223372036854775807):::INT8)) OR (table3.col3_16 <= e'\'':::STRING)) AND (table3.col3_14 = e'\x00':::STRING)) AND (table3.col3_9 < '':::STRING)) OR (table3.col3_15 >= e'\'':::STRING), INDEX (col3_7 ASC, col3_3 ASC, col3_13 ASC, lower(CAST(col3_6 AS STRING)), col3_0, col3_12 ASC, col3_5, col3_8 ASC) STORING (col3_1, col3_4, col3_6, col3_9, col3_14, col3_15, col3_16));
        CREATE TABLE table4 (col4_0 JSONB NOT NULL, col4_1 GEOGRAPHY NOT NULL, col4_2 INT4 NOT NULL, col4_3 TIMESTAMPTZ NOT NULL, col4_4 "char" NOT NULL, col4_5 BYTES NULL, col4_6 REGCLASS, col4_7 BIT(10) NULL, col4_8 FLOAT8 NULL, col4_9 CHAR NULL, col4_10 GEOMETRY NULL, col4_11 STRING NULL AS (lower(CAST(col4_10 AS STRING))) STORED, col4_12 STRING NULL AS (CASE WHEN col4_5 IS NULL THEN NULL ELSE NULL END) VIRTUAL, col4_13 STRING NOT NULL AS (lower(CAST(col4_0 AS STRING))) VIRTUAL, col4_14 BOOL NOT NULL AS (true) STORED, col4_15 STRING NOT NULL AS (CASE WHEN col4_3 IS NULL THEN 'jmZ*':::STRING ELSE ';p':::STRING END) STORED, INVERTED INDEX (col4_5, col4_11 ASC, col4_8 ASC, (col4_8 + 0.685579419530818:::FLOAT8), col4_2, col4_15 DESC, col4_10 ASC) WHERE (((table4.col4_8 >= 3.4028234663852886e+38:::FLOAT8) OR (table4.col4_12 = e'\'':::STRING)) AND (table4.col4_3 <= '3000-01-01 00:00:00+00:00':::TIMESTAMPTZ)) OR (table4.col4_2 != 0:::INT8));
        CREATE TABLE table5 (col5_0 BOOL NOT NULL, col5_1 OID NULL, col5_2 STRING NULL AS (lower(CAST(col5_1 AS STRING))) VIRTUAL, INDEX (col5_0, col5_1 DESC), UNIQUE (col5_2 DESC, col5_1 ASC) WHERE (table5.col5_2 = 'X':::STRING) AND (NOT table5.col5_0), UNIQUE (col5_2, lower(CAST(col5_0 AS STRING)) DESC, col5_1 DESC) WHERE table5.col5_2 < e'\'':::STRING, INDEX (col5_0) STORING (col5_1) WHERE table5.col5_0 AND (table5.col5_2 != e'\U00002603':::STRING), UNIQUE (col5_2 DESC, col5_1 DESC, col5_0));
        ALTER TABLE table1 INJECT STATISTICS e'[{"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1711145605419940420, "histo_buckets": [{"distinct_range": 0, "num_eq": 4520213393117391366, "num_range": 0, "upper_bound": "-27070"}, {"distinct_range": 0, "num_eq": 5458856314659894707, "num_range": 0, "upper_bound": "-16427"}, {"distinct_range": 4383163016549806000, "num_eq": 5320829760012663823, "num_range": 5943939825008045052, "upper_bound": "-8214"}, {"distinct_range": 2963295968826935000, "num_eq": 8233474050261006749, "num_range": 4174171592443471355, "upper_bound": "-3291"}, {"distinct_range": 0, "num_eq": 5702472886325306450, "num_range": 1000000000, "upper_bound": "7018"}, {"distinct_range": 0, "num_eq": 5680119119040572432, "num_range": 7000000000, "upper_bound": "21333"}, {"distinct_range": 0, "num_eq": 30000000, "num_range": 0, "upper_bound": "25790"}, {"distinct_range": 41255352954.18898, "num_eq": 3306083573562345655, "num_range": 90000000000, "upper_bound": "30384"}], "histo_col_type": "INT2", "name": "__auto__", "null_count": 0, "row_count": 5879711432327925361}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2509594926419786730, "histo_buckets": [{"distinct_range": 0, "num_eq": 600, "num_range": 0, "upper_bound": ",j$X\\n7t/"}], "histo_col_type": "VARCHAR", "name": "__auto__", "null_count": 0, "row_count": 5879711432327925361}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 774409195385894132, "histo_buckets": [{"distinct_range": 0, "num_eq": 600000000, "num_range": 0, "upper_bound": "-7283"}, {"distinct_range": 1454228509485694700, "num_eq": 70, "num_range": 1454228509485694659, "upper_bound": "-1378"}, {"distinct_range": 0, "num_eq": 50000000000, "num_range": 7857556282652445958, "upper_bound": "427"}], "histo_col_type": "INT2", "name": "__auto__", "null_count": 0, "row_count": 5879711432327925361}]':::JSONB;
        ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4043161912350489072, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6351687562251630407}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2118219519240684092, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6351687562251630407}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1939869298791021519, "histo_col_type": "", "name": "__auto__", "null_count": 1680067922882233802, "row_count": 6351687562251630407}, {"columns": ["col2_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1126550224085547002, "histo_col_type": "", "name": "__auto__", "null_count": 5412769696075397596, "row_count": 6351687562251630407}, {"columns": ["col2_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 156293133682032975, "histo_col_type": "", "name": "__auto__", "null_count": 5016453025662373405, "row_count": 6351687562251630407}, {"columns": ["col2_16"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3580838297387875207, "histo_col_type": "", "name": "__auto__", "null_count": 4145082930944615011, "row_count": 6351687562251630407}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3226448104295080000, "histo_col_type": "", "name": "__auto__", "null_count": 2103944038743377404, "row_count": 6351687562251630407}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2751459631029013993, "histo_col_type": "", "name": "__auto__", "null_count": 3945873286865908810, "row_count": 6351687562251630407}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6132445830318665884, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6351687562251630407}, {"columns": ["col2_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2223803352196596400, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6351687562251630407}, {"columns": ["col2_18"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4954177221420653323, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6351687562251630407}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1939721111207163331, "histo_col_type": "", "name": "__auto__", "null_count": 2744725805740224334, "row_count": 6351687562251630407}, {"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2071054626745203453, "histo_col_type": "", "name": "__auto__", "null_count": 3753991435772665810, "row_count": 6351687562251630407}, {"columns": ["col2_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2805281512841472864, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6351687562251630407}, {"columns": ["col2_17"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2396520043880909524, "histo_col_type": "", "name": "__auto__", "null_count": 855421913831474390, "row_count": 6351687562251630407}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2529790085237957932, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6351687562251630407}, {"columns": ["col2_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5442340549463525171, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6351687562251630407}, {"columns": ["col2_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2394609627476341257, "histo_col_type": "", "name": "__auto__", "null_count": 4669217691404065072, "row_count": 6351687562251630407}, {"columns": ["col2_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4237211774151727948, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 6351687562251630407}]':::JSONB;
        ALTER TABLE table3 INJECT STATISTICS '[{"columns": ["col3_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6690547407107929901, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8752431395252475426}, {"columns": ["col3_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2722791022324576656, "histo_col_type": "", "name": "__auto__", "null_count": 523960574963305764, "row_count": 8752431395252475426}, {"columns": ["col3_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4162644996451510141, "histo_col_type": "", "name": "__auto__", "null_count": 6416374134201566677, "row_count": 8752431395252475426}, {"columns": ["col3_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 493525451975839030, "histo_col_type": "", "name": "__auto__", "null_count": 5781873989083419328, "row_count": 8752431395252475426}, {"columns": ["col3_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 8368240398185063888, "histo_col_type": "INET", "name": "__auto__", "null_count": 0, "row_count": 8752431395252475426}, {"columns": ["col3_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2538024336415310885, "histo_col_type": "", "name": "__auto__", "null_count": 3158238843209687266, "row_count": 8752431395252475426}, {"columns": ["col3_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6692656218189813712, "histo_col_type": "", "name": "__auto__", "null_count": 4011390446460166649, "row_count": 8752431395252475426}, {"columns": ["col3_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7641085678283725413, "histo_col_type": "", "name": "__auto__", "null_count": 1567364093673459511, "row_count": 8752431395252475426}, {"columns": ["col3_16"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1541480511986898421, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8752431395252475426}, {"columns": ["col3_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 8241204357736048880, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8752431395252475426}, {"columns": ["col3_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 8534331926352355441, "histo_col_type": "", "name": "__auto__", "null_count": 4219107947242566077, "row_count": 8752431395252475426}, {"columns": ["col3_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1788344779973337764, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8752431395252475426}, {"columns": ["col3_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1776874121867125333, "histo_col_type": "", "name": "__auto__", "null_count": 4195504739748956932, "row_count": 8752431395252475426}, {"columns": ["col3_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2956789116527468161, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8752431395252475426}, {"columns": ["col3_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4142656874324083268, "histo_buckets": [{"distinct_range": 0, "num_eq": 60000000000, "num_range": 0, "upper_bound": "01010110101000100100"}, {"distinct_range": 0, "num_eq": 2000000, "num_range": 2113934446276153, "upper_bound": "11101011101110011011"}], "histo_col_type": "BIT(20)", "name": "__auto__", "null_count": 0, "row_count": 8752431395252475426}, {"columns": ["col3_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3087952588488944692, "histo_col_type": "", "name": "__auto__", "null_count": 6381813648390664981, "row_count": 8752431395252475426}, {"columns": ["col3_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6858121596805052094, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 8752431395252475426}]':::JSONB;
        ALTER TABLE table4 INJECT STATISTICS e'[{"columns": ["col4_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 199626, "histo_col_type": "", "name": "__auto__", "null_count": 74789, "row_count": 200000}, {"columns": ["col4_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 161694, "histo_col_type": "", "name": "__auto__", "null_count": 188625, "row_count": 200000}, {"columns": ["col4_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 40503, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 200000}, {"columns": ["col4_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 161650, "histo_buckets": [{"distinct_range": 0, "num_eq": 7041272318677507787, "num_range": 0, "upper_bound": "\\\\x2ac6dc76"}, {"distinct_range": 0, "num_eq": 80000000000, "num_range": 40000000000, "upper_bound": "\\\\x5f77"}, {"distinct_range": 3000000000, "num_eq": 200000000, "num_range": 3000000000, "upper_bound": "\\\\x85"}, {"distinct_range": 525860621851049200, "num_eq": 6536837110679312285, "num_range": 2265659908642448618, "upper_bound": "\\\\x97aecbb02c41"}, {"distinct_range": 0, "num_eq": 6504123670370320790, "num_range": 742700094408956997, "upper_bound": "\\\\xb69fa7a94dbd1fef3e"}, {"distinct_range": 8741799770302616000, "num_eq": 800000000, "num_range": 8741799770302615894, "upper_bound": "\\\\xc182fcf372"}, {"distinct_range": 179042301164708220, "num_eq": 1760225284692205884, "num_range": 223762880064561159, "upper_bound": "\\\\xc2e3b65bdc2940b3"}, {"distinct_range": 8920253000306028000, "num_eq": 5738371056714439887, "num_range": 8920253000306027666, "upper_bound": "\\\\xc34b8dada2c912ac8f"}], "histo_col_type": "BYTES", "name": "__auto__", "null_count": 71960, "row_count": 200000}, {"columns": ["col4_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 22357, "histo_col_type": "", "name": "__auto__", "null_count": 97952, "row_count": 200000}, {"columns": ["col4_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 189112, "histo_col_type": "", "name": "__auto__", "null_count": 152172, "row_count": 200000}, {"columns": ["col4_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 115657, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 200000}, {"columns": ["col4_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 62073, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 200000}, {"columns": ["col4_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 39834, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 200000}, {"columns": ["col4_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 180905, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 200000}, {"columns": ["col4_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 162273, "histo_col_type": "", "name": "__auto__", "null_count": 79481, "row_count": 200000}, {"columns": ["col4_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 105725, "histo_col_type": "", "name": "__auto__", "null_count": 71712, "row_count": 200000}, {"columns": ["col4_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 172899, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 200000}, {"columns": ["col4_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 73665, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 200000}, {"columns": ["col4_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 130330, "histo_col_type": "", "name": "__auto__", "null_count": 124697, "row_count": 200000}, {"columns": ["col4_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 161040, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 200000}]':::JSONB;
        ALTER TABLE table5 INJECT STATISTICS e'[{"columns": ["col5_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1109974610166072065, "histo_buckets": [{"distinct_range": 0, "num_eq": 50000, "num_range": 0, "upper_bound": "false"}], "histo_col_type": "BOOL", "name": "__auto__", "null_count": 0, "row_count": 1578481275963420123}, {"columns": ["col5_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 606382297190222517, "histo_col_type": "", "name": "__auto__", "null_count": 40229421363658957, "row_count": 1578481275963420123}, {"columns": ["col5_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 501384314791387881, "histo_buckets": [{"distinct_range": 0, "num_eq": 1000000000, "num_range": 0, "upper_bound": ""}, {"distinct_range": 60, "num_eq": 7306064408682399434, "num_range": 60, "upper_bound": "&l"}, {"distinct_range": 0, "num_eq": 400000000, "num_range": 100000000, "upper_bound": "\'"}, {"distinct_range": 88276341199.5784, "num_eq": 5867278011530352704, "num_range": 90000000000, "upper_bound": ">D5"}, {"distinct_range": 20000000, "num_eq": 0, "num_range": 20000000, "upper_bound": "C"}, {"distinct_range": 193886350924483740, "num_eq": 4893047447563618627, "num_range": 4023008509209740004, "upper_bound": "U\'[b[zp"}, {"distinct_range": 47.371582466406196, "num_eq": 6822466320377875964, "num_range": 200, "upper_bound": "r\\u001b{\\u001eh?"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 419223359158539509, "row_count": 1578481275963420123}]':::JSONB;
        ALTER TABLE table4 ADD FOREIGN KEY (col4_4, col4_6) REFERENCES table2 (col2_5, col2_8) ON DELETE RESTRICT ON UPDATE RESTRICT;
        ALTER TABLE table3 ADD FOREIGN KEY (col3_5) REFERENCES table1 (col1_1) ON DELETE RESTRICT ON UPDATE CASCADE;
        CREATE TYPE rand_typ_0 AS ENUM ('jjal', 'fmaxs');
        CREATE TYPE rand_typ_1 AS ENUM ('o', 'v');
        CREATE TYPE rand_typ_2 AS ENUM ('wcvzfe', 'qv', 'x');
        ;
    rsg_test.go:598: 
        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:600: 
    rsg_test.go:601: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith969804362
--- FAIL: TestRandomSyntaxSQLSmith (301.08s)
Reproduce

To reproduce, try:

make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1
Same failure on other branches

  • #74272 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
  • #70663 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-master]
Internal log

mjibson marked as alumn{us/a}; resolving to rafiss instead

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity avatar Mar 08 '22 06:03 cockroach-teamcity

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-21.2 @ 4892ac485fcb5f6a9e1bd2ead07f6fdaf02e4efe:

Random syntax error:

    rsg_test.go:779: Crash detected: server panic: statement exec timeout

Query:

        WITH
        	with_91188 (col_480325)
        		AS (
        			SELECT
        				*
        			FROM
        				(
        					VALUES
        						('1970-05-25':::DATE),
        						('1991-08-10':::DATE),
        						(('1992-10-07':::DATE::DATE + 4375211931793818102:::INT8::INT8)::DATE)
        				)
        					AS tab_222388 (col_480325)
        		),
        	with_91189 (col_480326)
        		AS (
        			SELECT
        				*
        			FROM
        				(VALUES (B'0100000010000010111'), (B'0000000000000000000'), (B'1110001010100001001'))
        					AS tab_222389 (col_480326)
        			EXCEPT
        				SELECT
        					*
        				FROM
        					(VALUES (B'1110111110000010001'), (NULL), (NULL), (B'0111001110101100011'))
        						AS tab_222390 (col_480327)
        		)
        SELECT
        	count(*) AS col_480328
        FROM
        	defaultdb.public.table1@[0] AS tab_222391
        WHERE
        	'00000000-0000-0000-0000-000000000000':::UUID::UUID
        	NOT IN (
        			SELECT
        				tab_222393._uuid::UUID AS col_480332
        			FROM
        				defaultdb.public.table1@primary AS tab_222392,
        				defaultdb.public.seed@[0] AS tab_222393
        				JOIN defaultdb.public.seed@[0] AS tab_222397 ON
        						(tab_222393.crdb_internal_mvcc_timestamp) = (tab_222397._decimal)
        				JOIN defaultdb.public.table1@[0] AS tab_222398
        					JOIN defaultdb.public.table3@table3_col3_14_col3_8_col3_3_col3_6_col3_2_col3_12_col3_4_col3_0_col3_5_col3_9_col3_13_col3_11_col3_10_col3_7_idx
        							AS tab_222399 ON
        							(tab_222398.crdb_internal_mvcc_timestamp) = (tab_222399.crdb_internal_mvcc_timestamp) ON
        						(tab_222397._int8) = (tab_222399.col3_5)
        						AND (tab_222397._float8) = (tab_222399.col3_6)
        						AND (tab_222393._decimal) = (tab_222399.col3_7)
        						AND (tab_222397._decimal) = (tab_222399.crdb_internal_mvcc_timestamp)
        				JOIN defaultdb.public.table3@[0] AS tab_222400
        					JOIN defaultdb.public.table3 AS tab_222401
        						JOIN defaultdb.public.table3 AS tab_222402 ON
        								(tab_222401.col3_14) = (tab_222402.col3_12)
        								AND (tab_222401.col3_1) = (tab_222402.col3_4) ON
        							(tab_222400.col3_4) = (tab_222401.col3_1) ON
        						(tab_222397._string) = (tab_222400.col3_8)
        						AND (tab_222399.col3_3) = (tab_222400.col3_3)
        						AND (tab_222399.col3_2) = (tab_222400.col3_2)
        				JOIN defaultdb.public.table3@table3_col3_14_col3_8_col3_3_col3_6_col3_2_col3_12_col3_4_col3_0_col3_5_col3_9_col3_13_col3_11_col3_10_col3_7_idx
        						AS tab_222403 ON (tab_222393._string) = (tab_222403.col3_12)
        			ORDER BY
        				tab_222399.col3_13 ASC, tab_222403.col3_1, tab_222400.col3_10 ASC, tab_222402.col3_4 DESC
        			LIMIT
        				94:::INT8
        		)
        GROUP BY
        	tab_222391.col1_0
        HAVING
        	bool_and(true::BOOL)::BOOL
        ORDER BY
        	tab_222391.col1_0 ASC, tab_222391.col1_0
        LIMIT
        	61:::INT8;

Schema:

    rsg_test.go:596: To reproduce, use schema:
    rsg_test.go:598: 
        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 BOX2D NOT NULL, PRIMARY KEY (col1_0), INDEX (col1_0 ASC));
        CREATE TABLE table2 (col2_0 "char" NULL, col2_1 BOX2D[] NOT NULL, col2_2 FLOAT4 NULL, col2_3 STRING NOT NULL AS (CASE WHEN col2_1 IS NULL THEN e'A\x06O\x1a\x04':::STRING ELSE 'q3j':::STRING END) VIRTUAL, INDEX (col2_2 DESC, (col2_2 + 0.2612948417663574:::FLOAT8) DESC, col2_3 DESC) WHERE table2.col2_2 != '+Inf':::FLOAT8, UNIQUE ((true), col2_0), UNIQUE (col2_3 ASC) STORING (col2_1) WHERE ((table2.col2_0 = e'\'':::STRING) OR (table2.col2_3 != 'X':::STRING)) AND (table2.col2_2 > 0.0:::FLOAT8), INDEX (col2_2 ASC) STORING (col2_0, col2_1), UNIQUE ((col2_2 + (-1.2534747123718262):::FLOAT8) DESC, col2_3, col2_0 DESC) WHERE table2.col2_2 < '-Inf':::FLOAT8);
        CREATE TABLE table3 (col3_0 TIMESTAMP NOT NULL, col3_1 INET NOT NULL, col3_2 REGCLASS NULL, col3_3 TIMETZ NOT NULL, col3_4 INET NOT NULL, col3_5 INT4 NOT NULL, col3_6 FLOAT4 NOT NULL, col3_7 DECIMAL NOT NULL, PRIMARY KEY (col3_7 DESC, col3_6 DESC, col3_1 ASC, col3_3 DESC, col3_5 DESC, col3_4), col3_8 STRING NOT NULL AS (lower(CAST(col3_3 AS STRING))) VIRTUAL, col3_9 STRING NOT NULL AS (lower(CAST(col3_1 AS STRING))) VIRTUAL, col3_10 STRING NULL AS (CASE WHEN col3_2 IS NULL THEN '':::STRING ELSE e'aV\x03+\x13':::STRING END) VIRTUAL, col3_11 FLOAT4 NOT NULL AS (col3_6 + (-1.5525178909301758):::FLOAT8) VIRTUAL, col3_12 STRING NOT NULL AS (CASE WHEN col3_0 IS NULL THEN e'cJ:\\':::STRING ELSE 'q4':::STRING END) VIRTUAL, col3_13 STRING NOT NULL AS (lower(CAST(col3_1 AS STRING))) VIRTUAL, col3_14 STRING NOT NULL AS (lower(CAST(col3_1 AS STRING))) STORED, UNIQUE (col3_12 DESC, col3_14 DESC) STORING (col3_0, col3_2) WHERE (((((((((table3.col3_5 >= (-1):::INT8) AND (table3.col3_12 <= '"':::STRING)) AND (table3.col3_14 <= e'\x00':::STRING)) OR (table3.col3_13 > e'\'':::STRING)) AND (table3.col3_9 <= e'\U00002603':::STRING)) OR (table3.col3_10 >= e'\x00':::STRING)) AND (table3.col3_0 >= '3000-01-01 00:00:00':::TIMESTAMP)) AND (table3.col3_3 >= '00:00:00+15:59:00':::TIMETZ)) AND (table3.col3_8 = '':::STRING)) OR (table3.col3_7 > 0:::DECIMAL), UNIQUE (col3_6, col3_11, col3_14 DESC, lower(CAST(col3_4 AS STRING)) DESC, (col3_7 + (-624493141.2060449797):::DECIMAL) DESC, col3_2 DESC, col3_9 ASC, col3_13 ASC, col3_7, col3_12 ASC, col3_8 ASC, col3_0 DESC), INDEX (col3_14 DESC, col3_8 DESC, col3_3 DESC, col3_6, col3_2, col3_12, col3_4, col3_0, col3_5, col3_9 DESC, col3_13 ASC, col3_11, col3_10 ASC, col3_7 ASC), UNIQUE (col3_13 ASC, col3_12 DESC, col3_8 ASC, col3_7) STORING (col3_0, col3_2, col3_14) WHERE (((((((((((table3.col3_13 = e'\x00':::STRING) OR (table3.col3_11 < 1.0:::FLOAT8)) OR (table3.col3_14 <= '"':::STRING)) OR (table3.col3_5 >= (-32768):::INT8)) OR (table3.col3_6 = 0.0:::FLOAT8)) OR (table3.col3_12 != '':::STRING)) OR (table3.col3_0 = '-4713-11-24 00:00:00':::TIMESTAMP)) OR (table3.col3_10 <= '':::STRING)) AND (table3.col3_9 <= '':::STRING)) OR (table3.col3_3 < '24:00:00-15:59:00':::TIMETZ)) AND (table3.col3_8 < 'X':::STRING)) AND (table3.col3_7 > 'Infinity':::DECIMAL));
        ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 545, "histo_buckets": [{"distinct_range": 0, "num_eq": 300, "num_range": 0, "upper_bound": "BOX(-1.4284314617751952 -0.9818963703340253,1.3280688449276505 1.1635862639138888)"}, {"distinct_range": 8773588263837948000, "num_eq": 888396696237846083, "num_range": 8773588263837947557, "upper_bound": "BOX(-1.014450843131435 0.10456195358616513,-0.13844523601946962 1.190319594658061)"}, {"distinct_range": 3776689748716058600, "num_eq": 80000000000, "num_range": 3776689748716058867, "upper_bound": "BOX(-0.9752599069948484 -0.7517756709198397,0.8785988754543037 1.5051509576391346)"}, {"distinct_range": 5765362331893504000, "num_eq": 100000, "num_range": 5765362331893504011, "upper_bound": "BOX(-0.830533872110415 -0.7937141336598902,0.813280107359291 0.31380940814001185)"}, {"distinct_range": 1835604308387112200, "num_eq": 800000, "num_range": 1835604308387112081, "upper_bound": "BOX(-0.676759103449942 -0.19001340233038722,0.6994582242371147 0.4419383266189759)"}, {"distinct_range": 0, "num_eq": 800, "num_range": 8000000000, "upper_bound": "BOX(0.4020186829383301 -1.0987106942990348,1.3718203918444742 -0.687511028235557)"}], "histo_col_type": "BOX2D", "name": "__auto__", "null_count": 0, "row_count": 600}]':::JSONB;
        ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 81, "histo_col_type": "", "name": "__auto__", "null_count": 42, "row_count": 100}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 89, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 100}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 65, "histo_buckets": [{"distinct_range": 0, "num_eq": 0, "num_range": 0, "upper_bound": "-2.493654251098633"}, {"distinct_range": 770.2043975982992, "num_eq": 8092802175521931521, "num_range": 1000, "upper_bound": "-0.8808956742286682"}, {"distinct_range": 4903.195931535291, "num_eq": 0, "num_range": 10000, "upper_bound": "-0.60722815990448"}, {"distinct_range": 8176973246084607000, "num_eq": 3802315756175115259, "num_range": 8176973246084606582, "upper_bound": "0.2967924475669861"}], "histo_col_type": "FLOAT4", "name": "__auto__", "null_count": 72, "row_count": 100}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 82, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 100}]':::JSONB;
        ALTER TABLE table3 INJECT STATISTICS e'[{"columns": ["col3_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 890948432355884409, "histo_buckets": [{"distinct_range": 0, "num_eq": 50, "num_range": 0, "upper_bound": "69.2652966336699354"}, {"distinct_range": 10000000, "num_eq": 8000000000, "num_range": 10000000, "upper_bound": "8006.176089248106802"}, {"distinct_range": 0, "num_eq": 3154650470804861966, "num_range": 3421464920827702872, "upper_bound": "37997.34578468595883"}], "histo_col_type": "DECIMAL", "name": "__auto__", "null_count": 0, "row_count": 921681671308350468}, {"columns": ["col3_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 285303461569932634, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 921681671308350468}, {"columns": ["col3_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 688540655587906177, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 921681671308350468}, {"columns": ["col3_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 715377235337674344, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 921681671308350468}, {"columns": ["col3_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 813717321234107304, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 921681671308350468}, {"columns": ["col3_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 795918928174422847, "histo_col_type": "", "name": "__auto__", "null_count": 184174573082721699, "row_count": 921681671308350468}, {"columns": ["col3_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 685431747547700180, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 921681671308350468}, {"columns": ["col3_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 621683544016465475, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 921681671308350468}, {"columns": ["col3_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 866621985505193987, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 921681671308350468}, {"columns": ["col3_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 241333558848998699, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 921681671308350468}, {"columns": ["col3_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 586230457256786830, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 921681671308350468}, {"columns": ["col3_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 766738773578986576, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 921681671308350468}, {"columns": ["col3_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 489230718811797098, "histo_col_type": "", "name": "__auto__", "null_count": 482311742053470697, "row_count": 921681671308350468}, {"columns": ["col3_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 440377342138709111, "histo_buckets": [{"distinct_range": 0, "num_eq": 2640795775018196122, "num_range": 0, "upper_bound": "-1.357818365097046"}, {"distinct_range": 900000000, "num_eq": 6000, "num_range": 900000000, "upper_bound": "-1.0"}, {"distinct_range": 35104574894.12838, "num_eq": 7887559345527546452, "num_range": 100000000000, "upper_bound": "-0.8858724236488342"}, {"distinct_range": 0, "num_eq": 6687255464831484632, "num_range": 200000, "upper_bound": "0.044929664582014084"}, {"distinct_range": 5719476044243941000, "num_eq": 3000000, "num_range": 7458673027035331914, "upper_bound": "0.5428006649017334"}, {"distinct_range": 27885344500156600, "num_eq": 8709818774333957785, "num_range": 4016410094971073028, "upper_bound": "1.3350409269332886"}, {"distinct_range": 0, "num_eq": 1000000000, "num_range": 3412056646199362573, "upper_bound": "1.5550317764282227"}], "histo_col_type": "FLOAT4", "name": "__auto__", "null_count": 0, "row_count": 921681671308350468}, {"columns": ["col3_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 887982221524883370, "histo_buckets": [{"distinct_range": 0, "num_eq": 10000000000, "num_range": 0, "upper_bound": ".g&\\u0014q*"}, {"distinct_range": 0, "num_eq": 5000, "num_range": 600000, "upper_bound": "\x7f\\u001dh]@>Lj"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 0, "row_count": 921681671308350468}]':::JSONB;
        CREATE TYPE rand_typ_0 AS ENUM ('bq', 'fccz', 'tl', 'nnpmqc', 'adilcy');
        CREATE TYPE rand_typ_1 AS ENUM ('zxkqi', 'ig', 'ihhm');
        CREATE TYPE rand_typ_2 AS ENUM ('fjsqfc', 'q', 'w', 'mcgx', 'p', 'rvf');
        ;
    rsg_test.go:598: 
        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:600: 
    rsg_test.go:601: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith069121410
--- FAIL: TestRandomSyntaxSQLSmith (300.87s)
Reproduce

To reproduce, try:

make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1
Same failure on other branches

  • #74272 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
  • #70663 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-master]
Internal log

mjibson marked as alumn{us/a}; resolving to rafiss instead

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity avatar Mar 18 '22 05:03 cockroach-teamcity

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-21.2 @ a5a88a4db163f0915ae65649aa0264c7a913fbfb:

        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 NAME[] NOT NULL, col1_1 NAME, col1_2 BYTES, col1_3 INT4 NOT NULL, col1_4 BIT(34) NULL, col1_5 REGPROCEDURE NULL, col1_6 JSONB NOT NULL, col1_7 JSONB NULL, col1_8 UUID NULL, col1_9 REGNAMESPACE NOT NULL, col1_10 BOOL NOT NULL, col1_11 BYTES, col1_12 FLOAT8 NOT NULL, col1_13 REGROLE NOT NULL, col1_14 REGROLE NOT NULL, col1_15 TIME NULL, col1_16 FLOAT8 NOT NULL AS (col1_12 + (-0.07926286908561803):::FLOAT8) VIRTUAL, col1_17 STRING NULL AS (lower(CAST(col1_7 AS STRING))) STORED, col1_18 STRING AS (CASE WHEN col1_11 IS NULL THEN e'"S0[*/\n':::STRING ELSE e'\x04WQ\x19':::STRING END) VIRTUAL, FAMILY (col1_13, col1_2, col1_10, col1_5, col1_7), FAMILY (col1_8, col1_15, col1_11), FAMILY (col1_3, col1_17, col1_0, col1_14, col1_6), FAMILY (col1_9), FAMILY (col1_12, col1_4, col1_1));
        CREATE TABLE table2 (col2_0 TIMESTAMP NULL, col2_1 GEOMETRY NULL, col2_2 VARCHAR NOT NULL, col2_3 TIME, col2_4 VARCHAR, col2_5 GEOMETRY NOT NULL, col2_6 TIMETZ NULL, col2_7 BOOL NOT NULL, col2_8 STRING NULL AS (lower(CAST(col2_6 AS STRING))) VIRTUAL, col2_9 STRING NULL AS (lower(CAST(col2_1 AS STRING))) VIRTUAL, col2_10 STRING NULL AS (lower(CAST(col2_6 AS STRING))) VIRTUAL, col2_11 STRING NOT NULL AS (lower(col2_2)) STORED, col2_12 STRING NULL AS (lower(CAST(col2_1 AS STRING))) VIRTUAL, col2_13 STRING NULL AS (lower(CAST(col2_6 AS STRING))) VIRTUAL, FAMILY (col2_2), FAMILY (col2_5), FAMILY (col2_3), FAMILY (col2_0, col2_7, col2_11, col2_4, col2_6, col2_1));
        ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 545297024363361040, "histo_col_type": "", "name": "__auto__", "null_count": 406622466119424580, "row_count": 972849642657129611}, {"columns": ["col1_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 587101255795293838, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 972849642657129611}, {"columns": ["col1_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 186165526901785878, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 972849642657129611}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 685926087517959048, "histo_col_type": "", "name": "__auto__", "null_count": 274633498624041611, "row_count": 972849642657129611}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 512417813432178967, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 972849642657129611}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 697899265293395931, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 972849642657129611}, {"columns": ["col1_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 554755064043702710, "histo_col_type": "", "name": "__auto__", "null_count": 870980207018416104, "row_count": 972849642657129611}, {"columns": ["col1_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 464278220720159954, "histo_col_type": "", "name": "__auto__", "null_count": 893962702081995871, "row_count": 972849642657129611}, {"columns": ["col1_17"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 956101847221312410, "histo_col_type": "", "name": "__auto__", "null_count": 823086706153597700, "row_count": 972849642657129611}, {"columns": ["col1_18"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 35372814168169730, "histo_col_type": "", "name": "__auto__", "null_count": 670891940901007097, "row_count": 972849642657129611}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 40740325692576080, "histo_col_type": "", "name": "__auto__", "null_count": 84090109899933155, "row_count": 972849642657129611}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 92418298323713488, "histo_col_type": "", "name": "__auto__", "null_count": 43471993408507342, "row_count": 972849642657129611}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 740345761204183286, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 972849642657129611}, {"columns": ["col1_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 581446147133473502, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 972849642657129611}, {"columns": ["col1_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 441629820234882773, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 972849642657129611}, {"columns": ["col1_16"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 621456158204050477, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 972849642657129611}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 893764650208034201, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 972849642657129611}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 314417506109463081, "histo_col_type": "", "name": "__auto__", "null_count": 844353409388187161, "row_count": 972849642657129611}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 827115717802451385, "histo_col_type": "", "name": "__auto__", "null_count": 695936290840548580, "row_count": 972849642657129611}]':::JSONB;
        ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2560910, "histo_col_type": "", "name": "__auto__", "null_count": 831607, "row_count": 5000000}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 909758, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 5000000}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1244796, "histo_col_type": "", "name": "__auto__", "null_count": 2116906, "row_count": 5000000}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2558408, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 5000000}, {"columns": ["col2_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4436711, "histo_col_type": "", "name": "__auto__", "null_count": 4687176, "row_count": 5000000}, {"columns": ["col2_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2435056, "histo_col_type": "", "name": "__auto__", "null_count": 1784598, "row_count": 5000000}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 687690, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 5000000}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 107294, "histo_col_type": "", "name": "__auto__", "null_count": 3863056, "row_count": 5000000}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2037099, "histo_col_type": "", "name": "__auto__", "null_count": 1430902, "row_count": 5000000}, {"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4556984, "histo_col_type": "", "name": "__auto__", "null_count": 3795818, "row_count": 5000000}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2924781, "histo_col_type": "", "name": "__auto__", "null_count": 335856, "row_count": 5000000}, {"columns": ["col2_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3647903, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 5000000}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4663304, "histo_col_type": "", "name": "__auto__", "null_count": 843267, "row_count": 5000000}, {"columns": ["col2_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4010078, "histo_col_type": "", "name": "__auto__", "null_count": 4917772, "row_count": 5000000}]':::JSONB;
        CREATE TYPE rand_typ_0 AS ENUM ('gxojuo');
        CREATE TYPE rand_typ_1 AS ENUM ('zyw', 'a', 'bazmcv');
        CREATE TYPE rand_typ_2 AS ENUM ('buxnre', 'pnkjw', 'bwpl', 'bj', 'mgajt', 'u');
        CREATE TYPE rand_typ_3 AS ENUM ('vij', 'lq', 'pdymb', 'jfwcmv', 'zjm', 'col');
        ;
    rsg_test.go:598: 
        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:600: 
    rsg_test.go:601: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith311630884
--- FAIL: TestRandomSyntaxSQLSmith (346.99s)
Reproduce

To reproduce, try:

make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1
Same failure on other branches

  • #74272 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
  • #70663 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-master]
Internal log

mjibson marked as alumn{us/a}; resolving to rafiss instead

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity avatar Mar 22 '22 05:03 cockroach-teamcity

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-21.2 @ 0404196bd03e7a972022f9f7d2153c45eb0431b4:

Random syntax error:

    rsg_test.go:779: Crash detected: server panic: pq: internal error: node inner-join with MaxCost added to the memo

Query:

        WITH
        	with_192193 (col_947870)
        		AS (
        			SELECT
        				NULL AS col_947870
        			FROM
        				defaultdb.public.table1@[0] AS tab_471307
        				JOIN defaultdb.public.table1@table1_col1_1_idx AS tab_471308 ON
        						(tab_471307.col1_0) = (tab_471308.col1_0),
        				defaultdb.public.table2@[0] AS tab_471309,
        				defaultdb.public.table3@table3_col3_2_col3_6_col3_3_key AS tab_471310
        			WHERE
        				tab_471310.col3_13
        		),
        	with_192194 (col_947871, col_947872)
        		AS (
        			SELECT
        				NULL AS col_947871, 9661:::INT8 AS col_947872
        			FROM
        				with_192193 AS cte_ref_55480,
        				with_192193 AS cte_ref_55481,
        				defaultdb.public.table5@[0] AS tab_471311,
        				with_192193 AS cte_ref_55482
        		),
        	with_192195 (col_947873)
        		AS (
        			SELECT
        				*
        			FROM
        				(
        					VALUES
        						('mfolhx':::rand_typ_0),
        						(NULL),
        						('lte':::rand_typ_0),
        						('lte':::rand_typ_0),
        						('qgpl':::rand_typ_0)
        				)
        					AS tab_471312 (col_947873)
        		)
        SELECT
        	'orkntk':::rand_typ_1 AS col_947874, cte_ref_55483.col_947872 AS col_947875, NULL AS col_947876
        FROM
        	with_192194 AS cte_ref_55483, with_192194 AS cte_ref_55484, defaultdb.public.table1@[0] AS tab_471313
        ORDER BY
        	cte_ref_55484.col_947871 DESC, cte_ref_55483.col_947871 ASC
        LIMIT
        	91:::INT8;

Schema:

    rsg_test.go:596: To reproduce, use schema:
    rsg_test.go:598: 
        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 VARCHAR NOT NULL, col1_1 INT2, PRIMARY KEY (col1_0 ASC), UNIQUE (col1_1 ASC) WHERE table1.col1_0 != 'X':::STRING, INDEX (col1_0 ASC, lower(col1_0) ASC), INDEX (col1_1 DESC, col1_0), INDEX ((col1_1 + (-22627):::INT8) ASC, col1_1) WHERE table1.col1_0 != 'X':::STRING, INDEX (col1_1 ASC), INDEX (col1_0 DESC, col1_1 DESC), INDEX (lower(col1_0) ASC, col1_1 DESC) WHERE (table1.col1_1 <= 0:::INT8) AND (table1.col1_0 > '':::STRING), FAMILY (col1_0, col1_1));
        CREATE TABLE table2 (col2_0 GEOGRAPHY NOT NULL, INVERTED INDEX (col2_0 DESC), INVERTED INDEX (col2_0), INVERTED INDEX (col2_0), INVERTED INDEX (col2_0 ASC), INVERTED INDEX (col2_0), INVERTED INDEX (col2_0), INVERTED INDEX (col2_0), INVERTED INDEX (col2_0), INVERTED INDEX (col2_0 ASC));
        CREATE TABLE table3 (col3_0 NAME NULL, col3_1 INET NOT NULL, col3_2 REGPROCEDURE NOT NULL, col3_3 REGPROCEDURE NULL, col3_4 REGROLE NOT NULL, col3_5 OID NULL, col3_6 FLOAT8 NULL, col3_7 REGTYPE, col3_8 REGNAMESPACE NOT NULL, col3_9 REGPROCEDURE, col3_10 INTERVAL NOT NULL, col3_11 INTERVAL NOT NULL, col3_12 BIT(28) NULL, col3_13 BOOL, col3_14 REGNAMESPACE NOT NULL, col3_15 TIME, col3_16 STRING NOT NULL, col3_17 REGPROCEDURE NULL, PRIMARY KEY (col3_16, col3_11 DESC, col3_1 ASC, col3_8), FAMILY (col3_6), FAMILY (col3_14), FAMILY (col3_10), FAMILY (col3_12, col3_7, col3_5, col3_3), FAMILY (col3_2, col3_4), FAMILY (col3_11), FAMILY (col3_16), FAMILY (col3_13, col3_15), FAMILY (col3_9, col3_8, col3_17, col3_0), FAMILY (col3_1), UNIQUE (col3_2, col3_6, col3_3));
        CREATE TABLE table4 (col4_0 REGROLE NOT NULL, col4_1 FLOAT4, col4_2 REGPROCEDURE NOT NULL, PRIMARY KEY (col4_0, col4_2 DESC), INDEX (col4_2 DESC), INDEX (col4_1 DESC, col4_0 ASC, col4_2 DESC), UNIQUE (col4_1 DESC), INDEX (col4_0) WHERE table4.col4_1 > '-Inf':::FLOAT8, INDEX (col4_0, col4_2), INDEX (col4_2 ASC, (CASE WHEN col4_0 IS NULL THEN e'\x00':::STRING ELSE e'\x04|6':::STRING END), col4_0 ASC) WHERE table4.col4_1 >= '+Inf':::FLOAT8);
        CREATE TABLE table5 (col5_0 TIMESTAMP NOT NULL, PRIMARY KEY (col5_0 ASC), INDEX (col5_0 DESC) WHERE table5.col5_0 = '-4713-11-24 00:00:00':::TIMESTAMP, INDEX (col5_0), INDEX (col5_0) WHERE table5.col5_0 < '3000-01-01 00:00:00':::TIMESTAMP, UNIQUE (col5_0 DESC) WHERE table5.col5_0 < '294276-12-31 23:59:59.999999':::TIMESTAMP, INDEX (col5_0), UNIQUE (col5_0), UNIQUE (col5_0 DESC));
        ALTER TABLE table1 INJECT STATISTICS e'[{"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7119085737405171196, "histo_buckets": [{"distinct_range": 0, "num_eq": 40000000000, "num_range": 0, "upper_bound": ":\\u0003P|3p\\u00175"}, {"distinct_range": 0, "num_eq": 222015564665526551, "num_range": 700000000, "upper_bound": "Q9Y"}, {"distinct_range": 70000000, "num_eq": 30000, "num_range": 70000000, "upper_bound": "Rnd%\\\\\\u0015U\\u001cK"}, {"distinct_range": 63650081730.08633, "num_eq": 3000, "num_range": 90000000000, "upper_bound": "X"}, {"distinct_range": 7000, "num_eq": 8682284084322914921, "num_range": 7000, "upper_bound": "o3!"}], "histo_col_type": "VARCHAR", "name": "__auto__", "null_count": 0, "row_count": 7692901828974380560}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7143690772219488798, "histo_buckets": [{"distinct_range": 0, "num_eq": 236943067404570687, "num_range": 0, "upper_bound": "-28578"}, {"distinct_range": 9146246139300947000, "num_eq": 30, "num_range": 9146246139300946818, "upper_bound": "-25157"}, {"distinct_range": 0, "num_eq": 6507658115206742756, "num_range": 6291898957311082632, "upper_bound": "-23396"}, {"distinct_range": 0, "num_eq": 80000, "num_range": 5000000000, "upper_bound": "-9875"}, {"distinct_range": 3346653700600211000, "num_eq": 1215619937214618426, "num_range": 4074359910461597007, "upper_bound": "-9820"}, {"distinct_range": 4267697231291450400, "num_eq": 8608662118042002456, "num_range": 6041378024619970004, "upper_bound": "-1"}, {"distinct_range": 8364629171008037000, "num_eq": 3000, "num_range": 8364629171008037336, "upper_bound": "1657"}, {"distinct_range": 635088370437078000, "num_eq": 413299683760672261, "num_range": 635088370437078031, "upper_bound": "2332"}], "histo_col_type": "INT2", "name": "__auto__", "null_count": 4181155629231117685, "row_count": 7692901828974380560}]':::JSONB;
        ALTER TABLE table2 INJECT STATISTICS e'[{"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1322096865027228933, "histo_buckets": [{"distinct_range": 0, "num_eq": 300000, "num_range": 0, "upper_bound": "\\\\x42fd100000000000000000c00168f1efe94ee6bff714f7a773d8ca400921325243a0293ff8ad78e7dd0ab8"}, {"distinct_range": 20000000, "num_eq": 700000, "num_range": 20000000, "upper_bound": "\\\\x42fd100000000000000000c00921fb54442d18bfee5796aa0a7ab8400921fb54442d183ff78990757a2b43"}, {"distinct_range": 7057620211938278000, "num_eq": 400, "num_range": 7057620211938277949, "upper_bound": "\\\\x42fd100000000000000000c00921fb54442d18bff844fec755ffdb400921fb54442d183ff92180b3dfca84"}, {"distinct_range": 6397674128314599000, "num_eq": 4000000000, "num_range": 6397674128314599902, "upper_bound": "\\\\x42fd100000000000000000c00921fb54442d18bff8f0ea92d978b5400921fb54442d183ff8e9f9222983e9"}, {"distinct_range": 2003197905264498200, "num_eq": 400000000, "num_range": 3096656780209687576, "upper_bound": "\\\\x42fd100000000000000000c00921fb54442d18bff9070629b40f78400921fb54442d183ff8f13873c299b8"}, {"distinct_range": 4036825312636444700, "num_eq": 8176375601444096297, "num_range": 4036825312636444854, "upper_bound": "\\\\x42fd1001441540804bd5013f91df46a2529d393f91df46a2529d39"}, {"distinct_range": 759389.9174694014, "num_eq": 476908335214688292, "num_range": 9000000, "upper_bound": "\\\\x42fd300000000000000000c00168f1efe94ee6bff714f7a773d8ca400921325243a0293ff8ad78e7dd0ab8"}, {"distinct_range": 0, "num_eq": 20000, "num_range": 70000000, "upper_bound": "\\\\x42fd300000000000000000c00921fb54442d18bfee5796aa0a7ab8400921fb54442d183ff78990757a2b43"}, {"distinct_range": 0, "num_eq": 700000000, "num_range": 5679269164673115146, "upper_bound": "\\\\x42fd300000000000000000c00921fb54442d18bff844fec755ffdb400921fb54442d183ff92180b3dfca84"}, {"distinct_range": 0, "num_eq": 8000000, "num_range": 5000, "upper_bound": "\\\\x42fd300000000000000000c00921fb54442d18bff8f0ea92d978b5400921fb54442d183ff8e9f9222983e9"}, {"distinct_range": 7775797475023667000, "num_eq": 4993922967420469006, "num_range": 7775797475023667148, "upper_bound": "\\\\x42fd300000000000000000c00921fb54442d18bff9070629b40f78400921fb54442d183ff8f13873c299b8"}, {"distinct_range": 9180569451147146000, "num_eq": 80, "num_range": 9180569451147146552, "upper_bound": "\\\\x42fd445805f53d02a863013fed269e058d43ec3ff455d10f445a09"}, {"distinct_range": 19474.075591510125, "num_eq": 1150187301635180488, "num_range": 20000, "upper_bound": "\\\\x42fd500000000000000000c00168f1efe94ee6bff714f7a773d8ca400921325243a0293ff8ad78e7dd0ab8"}, {"distinct_range": 2000000000, "num_eq": 2250134872200360574, "num_range": 2000000000, "upper_bound": "\\\\x42fd500000000000000000c00921fb54442d18bfee5796aa0a7ab8400921fb54442d183ff78990757a2b43"}, {"distinct_range": 0, "num_eq": 100000000, "num_range": 0, "upper_bound": "\\\\x42fd500000000000000000c00921fb54442d18bff844fec755ffdb400921fb54442d183ff92180b3dfca84"}, {"distinct_range": 3200907961809969700, "num_eq": 0, "num_range": 3200907961809969792, "upper_bound": "\\\\x42fd500000000000000000c00921fb54442d18bff8f0ea92d978b5400921fb54442d183ff8e9f9222983e9"}, {"distinct_range": 7735464843.940222, "num_eq": 0, "num_range": 9000000000, "upper_bound": "\\\\x42fd500000000000000000c00921fb54442d18bff9070629b40f78400921fb54442d183ff8f13873c299b8"}, {"distinct_range": 2786494533694595000, "num_eq": 530924046823026576, "num_range": 2786494533694595119, "upper_bound": "\\\\x42fd700000000000000000c00168f1efe94ee6bff714f7a773d8ca400921325243a0293ff8ad78e7dd0ab8"}, {"distinct_range": 3000000000, "num_eq": 500000, "num_range": 3000000000, "upper_bound": "\\\\x42fd700000000000000000c00921fb54442d18bff844fec755ffdb400921fb54442d183ff92180b3dfca84"}, {"distinct_range": 2455532452674532000, "num_eq": 4174796155586238007, "num_range": 3586340062365234213, "upper_bound": "\\\\x42fd700000000000000000c00921fb54442d18bff8f0ea92d978b5400921fb54442d183ff8e9f9222983e9"}, {"distinct_range": 0, "num_eq": 7000, "num_range": 900, "upper_bound": "\\\\x42fd700000000000000000c00921fb54442d18bff9070629b40f78400921fb54442d183ff8f13873c299b8"}, {"distinct_range": 0, "num_eq": 3746964661552645114, "num_range": 8000, "upper_bound": "\\\\x42fd8c0000000000000000c00168f1efe94ee6bff714f7a773d8ca400921325243a0293ff8ad78e7dd0ab8"}, {"distinct_range": 0, "num_eq": 5772135243205081308, "num_range": 8000000, "upper_bound": "\\\\x42fd900000000000000000c00921fb54442d18bfee5796aa0a7ab8400921fb54442d183ff78990757a2b43"}, {"distinct_range": 20000000000, "num_eq": 9000000, "num_range": 20000000000, "upper_bound": "\\\\x42fd900000000000000000c00921fb54442d18bff844fec755ffdb400921fb54442d183ff92180b3dfca84"}, {"distinct_range": 483008938527867700, "num_eq": 9195379419308882687, "num_range": 2341812818444102430, "upper_bound": "\\\\x42fd900000000000000000c00921fb54442d18bff8f0ea92d978b5400921fb54442d183ff8e9f9222983e9"}, {"distinct_range": 208727172729359680, "num_eq": 6129726217547821902, "num_range": 1181286853218755740, "upper_bound": "\\\\x42fd900000000000000000c00921fb54442d18bff9070629b40f78400921fb54442d183ff8f13873c299b8"}, {"distinct_range": 0, "num_eq": 50, "num_range": 6951744759189734277, "upper_bound": "\\\\x42fdb00000000000000000c00168f1efe94ee6bff714f7a773d8ca400921325243a0293ff8ad78e7dd0ab8"}, {"distinct_range": 129.2323239969039, "num_eq": 500, "num_range": 200, "upper_bound": "\\\\x42fdb00000000000000000c00921fb54442d18bfee5796aa0a7ab8400921fb54442d183ff78990757a2b43"}, {"distinct_range": 4049178414176231000, "num_eq": 6022388364855334090, "num_range": 6291114837125650596, "upper_bound": "\\\\x42fdb00000000000000000c00921fb54442d18bff844fec755ffdb400921fb54442d183ff92180b3dfca84"}, {"distinct_range": 4054341975213515300, "num_eq": 0, "num_range": 6974818738480741988, "upper_bound": "\\\\x42fdb00000000000000000c00921fb54442d18bff8f0ea92d978b5400921fb54442d183ff8e9f9222983e9"}, {"distinct_range": 20, "num_eq": 5136407351419971828, "num_range": 20, "upper_bound": "\\\\x42fdb00000000000000000c00921fb54442d18bff9070629b40f78400921fb54442d183ff8f13873c299b8"}], "histo_col_type": "BYTES", "name": "__auto__", "null_count": 0, "row_count": 2713658347305788776}]':::JSONB;
        ALTER TABLE table3 INJECT STATISTICS '[{"columns": ["col3_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 254253815052084643, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 352517652769604372}, {"columns": ["col3_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 318773770636547205, "histo_col_type": "", "name": "__auto__", "null_count": 184167387383377841, "row_count": 352517652769604372}, {"columns": ["col3_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 102565922582727315, "histo_col_type": "", "name": "__auto__", "null_count": 310148967953470765, "row_count": 352517652769604372}, {"columns": ["col3_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 301214245934496997, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 352517652769604372}, {"columns": ["col3_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 231520204949569583, "histo_col_type": "", "name": "__auto__", "null_count": 100132734704938952, "row_count": 352517652769604372}, {"columns": ["col3_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 318519759486535181, "histo_col_type": "", "name": "__auto__", "null_count": 313333394396167660, "row_count": 352517652769604372}, {"columns": ["col3_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 70371213374413502, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 352517652769604372}, {"columns": ["col3_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 89153218806627821, "histo_col_type": "", "name": "__auto__", "null_count": 221601618947943539, "row_count": 352517652769604372}, {"columns": ["col3_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 177989084965918599, "histo_col_type": "", "name": "__auto__", "null_count": 15891035264739156, "row_count": 352517652769604372}, {"columns": ["col3_16"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 56840616754983807, "histo_col_type": "STRING", "name": "__auto__", "null_count": 0, "row_count": 352517652769604372}, {"columns": ["col3_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 92913619667989304, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 352517652769604372}, {"columns": ["col3_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 339518599233201746, "histo_col_type": "", "name": "__auto__", "null_count": 333302800809736081, "row_count": 352517652769604372}, {"columns": ["col3_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 86970533884538793, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 352517652769604372}, {"columns": ["col3_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 68567736379246472, "histo_col_type": "", "name": "__auto__", "null_count": 215995974290961777, "row_count": 352517652769604372}, {"columns": ["col3_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 194198081403841507, "histo_col_type": "", "name": "__auto__", "null_count": 153153750066872084, "row_count": 352517652769604372}, {"columns": ["col3_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 61479536127822959, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 352517652769604372}, {"columns": ["col3_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 97006708569171679, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 352517652769604372}, {"columns": ["col3_17"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 191276823770249733, "histo_col_type": "", "name": "__auto__", "null_count": 98709037689153446, "row_count": 352517652769604372}]':::JSONB;
        ALTER TABLE table4 INJECT STATISTICS '[{"columns": ["col4_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3600, "histo_buckets": [{"distinct_range": 0, "num_eq": 900000, "num_range": 0, "upper_bound": "0"}, {"distinct_range": 0, "num_eq": 6000000000, "num_range": 10, "upper_bound": "1258843497"}, {"distinct_range": 326679440920692540, "num_eq": 3554332029840438737, "num_range": 7380072634943706854, "upper_bound": "1314210555"}, {"distinct_range": 0, "num_eq": 1000000000, "num_range": 40, "upper_bound": "1791990931"}, {"distinct_range": 186.24784580628307, "num_eq": 70000, "num_range": 200, "upper_bound": "2985459445"}, {"distinct_range": 776228005858324400, "num_eq": 7784762319452571153, "num_range": 776228005858324384, "upper_bound": "3225079950"}], "histo_col_type": "REGPROCEDURE", "name": "__auto__", "null_count": 0, "row_count": 5000}, {"columns": ["col4_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 79, "histo_buckets": [{"distinct_range": 0, "num_eq": 4779408697413252009, "num_range": 0, "upper_bound": "0"}, {"distinct_range": 0, "num_eq": 5477033410914613303, "num_range": 646396468445424782, "upper_bound": "3584310642"}], "histo_col_type": "REGROLE", "name": "__auto__", "null_count": 0, "row_count": 5000}, {"columns": ["col4_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4072, "histo_buckets": [{"distinct_range": 0, "num_eq": 0, "num_range": 0, "upper_bound": "0.7386921048164368"}, {"distinct_range": 5000, "num_eq": 70000000000, "num_range": 5000, "upper_bound": "1.5077911615371704"}], "histo_col_type": "FLOAT4", "name": "__auto__", "null_count": 1425, "row_count": 5000}]':::JSONB;
        ALTER TABLE table5 INJECT STATISTICS '[{"columns": ["col5_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 273536247757355834, "histo_buckets": [{"distinct_range": 0, "num_eq": 1793253444676580395, "num_range": 0, "upper_bound": "1984-01-01 19:35:29.000084"}, {"distinct_range": 41337502916.766525, "num_eq": 30, "num_range": 100000000000, "upper_bound": "3000-01-01 00:00:00"}], "histo_col_type": "TIMESTAMP", "name": "__auto__", "null_count": 0, "row_count": 7945276622078780200}]':::JSONB;
        ALTER TABLE table4 ADD FOREIGN KEY (col4_2, col4_1, col4_0) REFERENCES table3 (col3_2, col3_6, col3_3);
        CREATE TYPE rand_typ_0 AS ENUM ('lte', 'vkupv', 'qgpl', 'mfolhx');
        CREATE TYPE rand_typ_1 AS ENUM ('kfq', 'uhw', 'orkntk');
        CREATE TYPE rand_typ_2 AS ENUM ('zvcag', 'fcqr');
        ;
    rsg_test.go:598: 
        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:600: 
    rsg_test.go:601: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith275695223
--- FAIL: TestRandomSyntaxSQLSmith (339.37s)
Reproduce

To reproduce, try:

make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1
Same failure on other branches

  • #74272 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
  • #70663 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-master]
Internal log

mjibson marked as alumn{us/a}; resolving to rafiss instead

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity avatar Mar 25 '22 05:03 cockroach-teamcity

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-21.2 @ 791fd46847e4db8b989fd19974d9c79e917a6826:

Random syntax error:

    rsg_test.go:779: Crash detected: server panic: statement exec timeout

Query:

        SELECT
        	tab_120200._float8 AS col_294307,
        	tab_120194.col1_3 AS col_294308,
        	tab_120199._inet AS col_294309,
        	tab_120204._float4 AS col_294310,
        	(-1.7253626585006714):::FLOAT8 AS col_294311,
        	54892712962.58589789:::DECIMAL AS col_294312,
        	tab_120204._int4 AS col_294313,
        	'2010-04-06 09:57:10.000453+00:00':::TIMESTAMPTZ AS col_294314,
        	(-0.06039930424093898):::FLOAT8 AS col_294315,
        	e'\x16Z<@\x12Z':::STRING AS col_294316,
        	(-8350703955805632228):::INT8 AS col_294317,
        	tab_120194.col1_10 AS col_294318,
        	215011918:::OID AS col_294319,
        	tab_120199._interval AS col_294320,
        	tab_120196.col1_11 AS col_294321,
        	tab_120199._date AS col_294322,
        	(-0.9639778733253479):::FLOAT8 AS col_294323,
        	tab_120196.col1_14 AS col_294324
        FROM
        	defaultdb.public.table1@[0] AS tab_120194,
        	defaultdb.public.table1@[0] AS tab_120195
        	JOIN defaultdb.public.table1@table1_col1_14_col1_11_expr_col1_12_col1_4_expr1_col1_13_col1_6_col1_9_col1_8_col1_1_col1_10_col1_7_col1_0_idx
        			AS tab_120196
        		JOIN defaultdb.public.seed@seed__int8__float8__date_idx AS tab_120197
        			JOIN defaultdb.public.table1@table1_col1_9_col1_8_col1_13_col1_3_col1_7_col1_5_col1_6_key AS tab_120198 ON
        					(tab_120197._int4) = (tab_120198.col1_12)
        			JOIN defaultdb.public.seed@[0] AS tab_120199
        				JOIN defaultdb.public.seed AS tab_120200
        					JOIN defaultdb.public.seed AS tab_120201 ON (tab_120200._int8) = (tab_120201._int8)
        					LEFT JOIN defaultdb.public.seed AS tab_120202
        						JOIN defaultdb.public.seed AS tab_120203 ON (tab_120202._jsonb) = (tab_120203._jsonb) ON true
        					JOIN defaultdb.public.seed@[0] AS tab_120204 ON
        							(tab_120201._float8) = (tab_120204._float4)
        							AND (tab_120200._float8) = (tab_120204._float4)
        							AND (tab_120203._jsonb) = (tab_120204._jsonb)
        							AND (tab_120201._float8) = (tab_120204._float8)
        							AND (tab_120200._float8) = (tab_120204._float8)
        							AND (tab_120200._float8) = (tab_120204._float8) ON
        						(tab_120199.crdb_internal_mvcc_timestamp) = (tab_120204._decimal) ON
        					(tab_120197._enum) = (tab_120204._enum)
        					AND (tab_120198.col1_8) = (tab_120199._int4)
        					AND (tab_120197._float8) = (tab_120204._float4)
        					AND (tab_120198.col1_6) = (tab_120199.tableoid) ON (tab_120196.col1_8) = (tab_120198.col1_8) ON
        			(tab_120195.col1_12) = (tab_120198.col1_12) AND (tab_120195.col1_8) = (tab_120199._int8)
        ORDER BY
        	tab_120197._decimal
        LIMIT
        	35:::INT8;

Schema:

    rsg_test.go:596: To reproduce, use schema:
    rsg_test.go:598: 
        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 VARCHAR, col1_1 TIMETZ NOT NULL, col1_2 FLOAT4 NOT NULL, col1_3 STRING NULL, col1_4 REGROLE NULL, col1_5 TIME NOT NULL, col1_6 OID NOT NULL, col1_7 BIT(28) NOT NULL, col1_8 INT8 NOT NULL, col1_9 INET NOT NULL, PRIMARY KEY (col1_9 DESC, col1_5, col1_6, col1_2 ASC, col1_1), col1_10 STRING NOT NULL AS (lower(CAST(col1_7 AS STRING))) STORED, col1_11 STRING NOT NULL AS (lower(CAST(col1_9 AS STRING))) VIRTUAL, col1_12 INT8 NOT NULL AS (col1_8 + (-689285548115498369):::INT8) STORED, col1_13 STRING AS (lower(col1_0)) STORED, col1_14 FLOAT4 NOT NULL AS (col1_2 + 0.44531455636024475:::FLOAT8) VIRTUAL, UNIQUE (col1_9 DESC, col1_8 ASC, col1_13 ASC, col1_3, col1_7 ASC, col1_5, col1_6), UNIQUE (col1_13), INDEX (col1_11 DESC, lower(CAST(col1_1 AS STRING)) DESC), INDEX (col1_14 DESC, col1_11 DESC, lower(CAST(col1_7 AS STRING)) ASC, col1_12 DESC, col1_4, (CASE WHEN col1_4 IS NULL THEN '':::STRING ELSE e'\f7/':::STRING END) ASC, col1_13 DESC, col1_6 ASC, col1_9 ASC, col1_8, col1_1 DESC, col1_10 ASC, col1_7 DESC, col1_0 DESC), FAMILY (col1_6), FAMILY (col1_9, col1_3, col1_12, col1_10, col1_1, col1_13), FAMILY (col1_8), FAMILY (col1_0, col1_4, col1_7, col1_5, col1_2));
        ALTER TABLE table1 INJECT STATISTICS e'[{"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1687367831335609902, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7568521586635023412}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3093137507783944583, "histo_col_type": "", "name": "__auto__", "null_count": 4485939691767033108, "row_count": 7568521586635023412}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3516078003638536542, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7568521586635023412}, {"columns": ["col1_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2736331399177889037, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7568521586635023412}, {"columns": ["col1_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3648490876081219918, "histo_buckets": [{"distinct_range": 0, "num_eq": 700, "num_range": 0, "upper_bound": ""}, {"distinct_range": 0, "num_eq": 6000, "num_range": 5648038844479339334, "upper_bound": "4{\\n"}, {"distinct_range": 4254507593.4278874, "num_eq": 6548878578667725335, "num_range": 10000000000, "upper_bound": "P\\u0010D\\u00034f\\r)\\u0008"}, {"distinct_range": 200, "num_eq": 50, "num_range": 200, "upper_bound": "~mRVXrxEc"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 3338691450144533127, "row_count": 7568521586635023412}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5905531654180361076, "histo_col_type": "", "name": "__auto__", "null_count": 2139620837121174201, "row_count": 7568521586635023412}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2227138645823104516, "histo_col_type": "", "name": "__auto__", "null_count": 52789560331894769, "row_count": 7568521586635023412}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7312802552505991523, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7568521586635023412}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3313096278269957608, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7568521586635023412}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2120683878244221768, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7568521586635023412}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4266179963760040266, "histo_buckets": [{"distinct_range": 0, "num_eq": 8209547626259625871, "num_range": 0, "upper_bound": "42.196.229.211/2"}, {"distinct_range": 20778442052.914307, "num_eq": 4845409215600897224, "num_range": 50000000000, "upper_bound": "231.106.91.54/5"}, {"distinct_range": 734363010909820700, "num_eq": 9000000000, "num_range": 734363010909820638, "upper_bound": "15.96.60.38/17"}, {"distinct_range": 0, "num_eq": 4000000, "num_range": 4823242543769212862, "upper_bound": "51.119.24.0/19"}], "histo_col_type": "INET", "name": "__auto__", "null_count": 0, "row_count": 7568521586635023412}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6372746454619295751, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7568521586635023412}, {"columns": ["col1_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5140213936716312509, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7568521586635023412}, {"columns": ["col1_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6617918340779155579, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7568521586635023412}, {"columns": ["col1_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4056628793611803955, "histo_buckets": [{"distinct_range": 0, "num_eq": 3000, "num_range": 0, "upper_bound": "NaN"}, {"distinct_range": 28.42325094220468, "num_eq": 1000000000, "num_range": 50, "upper_bound": "-0.9507577419281006"}, {"distinct_range": 2518258733809538600, "num_eq": 50000, "num_range": 2518258733809538497, "upper_bound": "-0.8901451826095581"}, {"distinct_range": 16140168.603595916, "num_eq": 30, "num_range": 60000000, "upper_bound": "-0.7748452425003052"}, {"distinct_range": 4178648664926159000, "num_eq": 800000000, "num_range": 4178648664926159042, "upper_bound": "-0.11452816426753998"}, {"distinct_range": 0, "num_eq": 1404579504338825997, "num_range": 0, "upper_bound": "0.3051684498786926"}, {"distinct_range": 2974131454397063700, "num_eq": 0, "num_range": 8361022042816353024, "upper_bound": "0.9089487791061401"}, {"distinct_range": 77644918.83712645, "num_eq": 1061630780592333525, "num_range": 100000000, "upper_bound": "1.93111252784729"}], "histo_col_type": "FLOAT4", "name": "__auto__", "null_count": 0, "row_count": 7568521586635023412}]':::JSONB;
        CREATE TYPE rand_typ_0 AS ENUM ('evlxc', 'qsiyx', 'pfdlnh', 'vvna', 're', 'vt');
        CREATE TYPE rand_typ_1 AS ENUM ('h', 'td', 'afkmlj');
        ;
    rsg_test.go:598: 
        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:600: 
    rsg_test.go:601: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith728334967
--- FAIL: TestRandomSyntaxSQLSmith (361.40s)
Reproduce

To reproduce, try:

make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1
Same failure on other branches

  • #74272 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]
  • #70663 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot T-sql-queries branch-master]
Internal log

mjibson marked as alumn{us/a}; resolving to rafiss instead

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity avatar Mar 27 '22 05:03 cockroach-teamcity