cockroachdb / cockroach

CockroachDB - the open source, cloud-native distributed SQL database.
https://www.cockroachlabs.com
Other
29.51k stars 3.7k forks source link

sql/tests: TestRandomSyntaxSQLSmith failed [NPE in SpanFromContext] #69683

Closed cockroach-teamcity closed 2 years ago

cockroach-teamcity commented 2 years ago

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ 15b773c71f92d643795e34c922717fde0447f9cd:

Random syntax error:

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

Query:

        WITH
            with_68990 (col_396369) AS (SELECT * FROM (VALUES (2020289494:::OID)) AS tab_168076 (col_396369)),
            with_68991 (col_396370)
                AS (
                    SELECT
                        *
                    FROM
                        (
                            VALUES
                                (
                                    '0105000060E61000000800000001020000400300000084AD844E509A52409C6A86CFFA1D5540FCE3030EEF0AF4412D2B4784B11A50C0C8D75C2D00FB47407407BB02D9FFFD41DC96E6116ECE5CC0FC1C6FDB806953408AE564B92DB1F3C10102000040050000003D6BC94878D95AC04A560DC1AD6C3FC0F649E14F2428FFC11445903351DD47C00074A03CFFAA04C0727D9D700A98EFC15CFD066A4C9B6140B3E430BF980647C07C4AB7333199E741CA9C51D7BE8854C01EF91F70C9735340BA00DB6313B100429550C39F90E25CC0402CCC7EEAFB374008DFA0A82979DF41010200004006000000E428FD75A2C74940A601FA0F9F044BC08059E1A3FEF2CE41D065C029ED4C62400ADC288221023CC00009D9734A2BEA41589845D01BA140C052B7FF56780D504004DC9C4FA161F5C180B47267EA6E3BC0C8545E1F0CF6364040FAC5FA7EE1B8C1B6147AF38D6C61C08EEB2327BE1355409F0F6BD8DE92FFC181823F37C0185CC028E0F79FD1B54E4038978B31EC47F8C1010200004002000000783EE2017E923BC020515532D96D0BC0E8669CCAD404EA41E4C8395281885EC0403E8791A5423240207F8600D2EDC0C101020000400500000097FFC63F7B0B64C0402EC584DC7103C0C81404AB62DC0042B9F6595AB29761C0E6B9EB67FE8B51C04A9A5D9F8F2BE3C19182597E532558C06C6851C2FF2154C0703559C8DE5DC84148748DD4E3B664400099E45CF66A26C074D2952DC23EFD416874090283EF5D409028CFE52F093440E4043F3A69F30042010200004003000000044B70D9165164406883E12010D326C0141AF53BC6AEE4C158121025219C5E401C37A16B6C315040C2BCCB1803AFF5C1E44BF96BFA0B594038BA8BC203482540021759F1D7B4F1410102000040030000004E4256A57144624090FC0CD5AFC939C0E4047FDDE530FB415EA9D9CBFB98654014056AFFD9443AC0EC670C02A5A3FC4170207CA7BD4B6140501804916D311CC0B0D4A77F5A14D341010200004006000000E423DA36BA1F43406D8A6086E5BA4EC0F8C33A8B7DFBF0413CFB298E8E7B6540A835E86BF01542C06E88393DD25600C21CE9D1569F8E5740B8FF8EC1B76C2EC0E82A5F2307E7E6C178B996D97CD15640E0554460ECFF3740F83AE08932FD00C25A9F277896C85140B069206B055B3B40A0B2B1A6AC2DD341C0B903B7B13727C0925F54F17840524040B6138F9B0DC141':::GEOGRAPHY
                                ),
                                (
                                    '0107000020E61000000300000001010000000000000000004440000000000000244001020000000300000000000000000024400000000000002440000000000000344000000000000034400000000000002440000000000000444001030000000100000004000000000000000000444000000000000044400000000000003440000000000080464000000000008046400000000000003E4000000000000044400000000000004440':::GEOGRAPHY
                                ),
                                ('0101000020E610000069093E7EF9E55AC0E02A1668BF861D40':::GEOGRAPHY),
                                (
                                    CASE
                                    WHEN true THEN '0101000020E6100000000000000000F87F000000000000F87F':::GEOGRAPHY
                                    ELSE '01060000A0E6100000050000000103000080010000000B000000034A3D45856F65C08A2C5CD6E17F49C088696359809AFC415B39A738BAFD52C006B479285EA44FC0A09556DD4DB8F64180527D2F9D4D27C00CB3330FB35455C0A490DC52EFE1F0415095DCF62E993140F79AAC3A444042C0C4333742D3E2F0419E6583E63F1C6340541A23B4F75B4CC0AB90ADCF360E02C2A83B8C2E63636140E33AFF503DA848C0F083EBA56F17D74124415EC68056604010AEB21FB6FC4740B49D2CA90CABF04160BEEFA9A7C032C0E4D3B1E2796A4D401478746A189800C2200797A7F58A34C06CA62C709CCE4C40408A1F94C496C641DF34B3A2DA2660C0E0AB2D53ECE84B400AF4C3C3FFE1F9C1034A3D45856F65C08A2C5CD6E17F49C088696359809AFC4101030000800100000009000000ABC5F9AFF43662C0043058C39DE84DC0BC1846639C7CF641EBC1C498811D60C03AF688647A6956C02651CC650EA4F441C8F71AEAC42F5F40897B21F28DF842C032D79BBDDB00EDC1049294FCF95F624072DF2D048BBE54401C5BA11C37130042FAD103D589AA6240921257119407564090F3AAB5C773F94180B9E569127C2C40F4953EEB89294D40804C4F71F4DCEC41C0834977CD5131C034EA8A4973E7364020F721C36BC7F0C11A7811A44B3361C0808A21AEF7272440C08E69FB8972F5C1ABC5F9AFF43662C0043058C39DE84DC0BC1846639C7CF641010300008001000000080000007F1D29A2D01D62C0AAA45462FCF651C03C717A69AF1FE34110C136C235A859C075D32A6D05DC53C0353D246D19F600C29023F8FDAA8741405FDD8A73EA9554C0DA6644734D68F441901D464F34E13F40E8C12ACFD01748C050FC9DB65DB5C941F89F692AE5D161408890172518C82940881E01679FF2D741582BF908AD5A5B400EB698DA4ECD554080869460B855CD41CE0D3BB8EF655FC040C99FC41126F7BF0C8A1E638D49F4417F1D29A2D01D62C0AAA45462FCF651C03C717A69AF1FE3410103000080010000000C00000064A68B7F543B42C0B0721577107E294056425BF7B2C501C29C3743DBE45465C03648990A649E40C0EEAF3B01EFCCF4411DDEF396471457C05B5EB9AAEDD146C058CA75A110E4EC41547F1DD6698556400BA8A4F6D48B4BC0DEDCC9386970F8C1C48E165304075D40544D7F258BF73AC008FDBA668283ECC1E01363BA546E6540F8EE25BB0DED4E40401CEB4257B8BEC10013D0261EF5494074471029B717474032FBAA4F9C00ECC118F4A67693244240CCE1166007684F4008F4313A852E014200ADF6C7A39D154026E1ABD7C42E5140E456E88FA66DEDC1E03C077A79D257C0DA26A948FE425340FA2FC499678BF14102613002E29355C0F255AB48F7894140FF732B66DCA700C264A68B7F543B42C0B0721577107E294056425BF7B2C501C20103000080010000000600000080611624077F1E402A18630A620B41C000093E2EDBA69EC136DB5E9C66696240AF7B356AB3AC4AC0B804D417E1EFD0418433FB42B0E05940B6AD5AF303DD5240CE685CC21EAE014204F596883E634740A8A55F6D66035440C2158E54C60E024268AA2C13575A40C05424AB15C1213E406C5191DBFDBDFAC180611624077F1E402A18630A620B41C000093E2EDBA69EC1':::GEOGRAPHY
                                    END
                                ),
                                (
                                    st_buffer('0101000020E6100000000000000000F87F000000000000F87F':::GEOGRAPHY::GEOGRAPHY, 0.5111383155657849:::FLOAT8::FLOAT8, (-1813746913798163462):::INT8::INT8)::GEOGRAPHY
                                )
                        )
                            AS tab_168077 (col_396370)
                    EXCEPT
                        SELECT
                            *
                        FROM
                            (
                                VALUES
                                    (
                                        '0102000020E6100000030000005012B5E8740426C057B0B1B89B6746C014FC4A160DD86440C052B88C1AF913C0002E8BD14ABDF5BF60342657CAF25440':::GEOGRAPHY
                                    ),
                                    (
                                        '01060000E0E61000000100000001030000C00100000004000000BFD15516BE1F59C0302852D98E1313C0BE3FFDB83BDFF54180C64A407175CEC168FFDB5DE04F3CC0B49439DBA9003B4030D3334A864CE1C1C83DF1A6C8F7FD4132A1D67F446E61C0B4EAC13F043250402A9BE793414C0142BB47857148DFFEC1BFD15516BE1F59C0302852D98E1313C0BE3FFDB83BDFF54180C64A407175CEC1':::GEOGRAPHY
                                    ),
                                    ('01010000A0E610000080B99B0E91C757C04ABF8B44A03D4140882D676210D0D2C1':::GEOGRAPHY),
                                    (
                                        '01060000E0E61000000700000001030000C001000000080000002002266D79332940A05605C014211B408CBA470CA9A1E641D29150E7F765EBC1B4489E9116395740A02E6EB1935F4DC09E80942B235602C25625FC86B19FF04118860CD9AAA4614010A934AA9993134036B9C08170690242C0D140508357CF4108D9709BEEFD5840AC834D248706304004BE17208A50F241EA174CB0021502C21C8DFBFFEC864B40C2550DEAF4D25040D8D20055A905E5C1C4279C5D844100427618239D18854AC026B76B0364165640A4DA5832915C0042B0E9C12951DFFC419805BB2B002A4CC04C85F22C687F5040FA393F904BE6E2C1280AA92C95D9FD412002266D79332940A05605C014211B408CBA470CA9A1E641D29150E7F765EBC101030000C00100000006000000F37A74A879EC5DC0E8E1CAC7B5AA27C0161712066D80E1C1F4D88228D44AF94134D9A4E9C7C640403E368360C10349C09F8760EFA84AF2C10E4DFBE9F114F7C12C16529D6270424065EB678520D344C0A3A5322C195EF4C1C0DEDB9E36D10042D1415641D07F57C0FA17AAFD3BBD5040DE907225FA380042CE7E00C8F0810042CE47360CE95C5AC09021F425071B1A40AACCF8AD6822E0C1007516E4077BCF41F37A74A879EC5DC0E8E1CAC7B5AA27C0161712066D80E1C1F4D88228D44AF94101030000C0010000000B000000C86F34E61F5162C0F083D647367C32C0B074BD2D5A4AD041D6CAFE445F93F4C188879A368F033D401219C932E02554C096C23FCD88F0F041B4C548DEF8BFF34178F5DDC2E8AA60409B3D586C039951C0484257CD2B78F241FAFDB2FAD88002C28CDD21B17D1B6640E7C3763ED9F140C016F9B0F1F266EAC12069445DE8C6B74172C99A574BA6644030ACBE474B0215C0888E93758ADAE3411011409AF596E541F88E174AB18D5440E01E053C2234284064FF5321560FEBC15C5F811682F3FB41C81F521207B856400CB13F5140DB3E40B060E5565BBDC841162D1A7A3FA8EEC1706FF15C55F6394088FEF750C4B63240E8A84B7ED9DE00C218629405AB71EDC1F031F53889262AC0FC2C3F3712A63A40007CFE5B8494A841C0A3687CE431FE41C01A5EF396A324C020730E9C483E1C40D049929BA76BF741BC07F382087300C2C86F34E61F5162C0F083D647367C32C0B074BD2D5A4AD041D6CAFE445F93F4C101030000C0010000000A000000A841D783100D48C000805C1AF4EF03C0584C7360DC45FD4160F0616C47AFDCC1A0888D7FA22A2F40604D48FB85471DC02E6A1BB195D7F9C17C2380FF5B71F441F8EC53FF598A5F4030AF3A11DA6F2540F488223ECAE4EBC14A409137EC80F6419E5655EB10266440CC1AC1508A754C40E89FF2029E08FB41BC3D8D2634ACE04148E833E8EF9A3FC04C432A77626F4A4006D826DE5615F441EAF0A2D5EB31FA41F30ABC96869E54C06E2DF8ACB493554094626D8474E2E44142CA419CDA6801420B96FAD6B6F056C0E659EF3C644A524000F532747E6C8EC1786172E61CCDF9C1F750340ED0CC5EC020DAB34C452D48405850761EDD20FA41D05F57ADB716CDC19C9ACE6552CD64C024C2CC1CA4604440D451453F7F09FB41A00B9BE7AD31EAC1A841D783100D48C000805C1AF4EF03C0584C7360DC45FD4160F0616C47AFDCC101030000C00100000009000000843D715A846E65C05F14F28BFFC240C0E0C8C3F9D1A2DDC188FB517F56EDECC1A795EDD94BF95AC040493D1A62D140C0C0096BA659BCC64160663C713FC1F6C1C82E7AB10EC741C0C4B01428537437C0C0BD2882CBC3D941CF469F208196F2C1EC8B250377BE5B401887580B34D54FC092F0F11DF1A3EEC140B151085A2EECC130F0EFC1625C444060EC0A91E55C2BC0D0054C0A7D7EDCC1D8503B2A2AE2D3C11454D553720A5F4010CD020CEC7E22C072C84163878AF141841A4E71C7E4D8C1463FC738D7ED6440C4F11ECEF0914E405CB74C6A5BB6E5C18029E6D84E55B6C190E6127FD20C37C04C3EFE9786F0444009233D4A1C0CF0C1509FFC79FEB8CC41843D715A846E65C05F14F28BFFC240C0E0C8C3F9D1A2DDC188FB517F56EDECC101030000C00100000006000000F5C5C46FDCC45DC0D4FB41FC49664CC09AC1243C4561FA41D008FF32A21302C298338E7BE51D35400CBC5A288EA834C0A042B88DCC1FD0C1620A4B492C05F7C15C79332D284F624090E71C1D1C142C409CA356FEFF24004240A1119291A4A5C1544808EB9DCB5A40FEAB626852CD404060DD216E3B4DF441A60647070999E6C14A43AEBE76EB65C08C6E38C009603140E88509306412DF41747542F88C03FCC1F5C5C46FDCC45DC0D4FB41FC49664CC09AC1243C4561FA41D008FF32A21302C201030000C0010000000A00000074D564A4F99C56C066B47E0357B655C060F728172F11FB414C323D8E3A65FE4100727187C31120C059802FBFD2E844C0F2D9ABBFF44901425A412FF71AC8F341929E4186EBF950401C39B39573A855C0E88F93C172CFE2413277CF8FC01AE0C1587447ADAB0D62400C25BDE6BDED4740444CA9ABE5D7D8C19AC725889FE70142CE0A7B972B326140745F111D38144F40083ACC91F621D4C126D6258049BFE0C1760A0CB7C99A5140382494BB9C8A4D4068E605991EBADFC1EC9391AEC299EB4108A2EC30E94A4440A07DC99C9D794F408029C4509D47A4411CF6E31D0244014289D133A6078F5CC08CCE6D519375494020B5992B7A57B741A0D2EB3C85BBB4417855C5BF8CDE3FC0A812267A0FD832408FD2DCE57B0201C2F8A1B5184C03FB4174D564A4F99C56C066B47E0357B655C060F728172F11FB414C323D8E3A65FE41':::GEOGRAPHY
                                    ),
                                    ('0104000020E610000000000000':::GEOGRAPHY)
                            )
                                AS tab_168078 (col_396371)
                )
        SELECT
            tab_168082.crdb_internal_idx_expr_2 AS col_396372, tab_168088.crdb_internal_mvcc_timestamp AS col_396373
        FROM
            with_68991 AS cte_ref_20209,
            defaultdb.public.table1@[0] AS tab_168079
            JOIN defaultdb.public.table5 AS tab_168080
                JOIN defaultdb.public.table5 AS tab_168081 ON
                        (tab_168080.col5_4) = (tab_168081.col5_4) AND (tab_168080.col5_1) = (tab_168081.col5_1)
                JOIN defaultdb.public.table4@table4_col4_4_col4_13_col4_0_col4_14_col4_6_idx AS tab_168082 ON
                        (tab_168081.col5_1) = (tab_168082.col4_11)
                JOIN defaultdb.public.table5@primary AS tab_168083 ON (tab_168080.col5_1) = (tab_168083.col5_1)
                JOIN defaultdb.public.seed@[0] AS tab_168084 ON
                        (tab_168082.col4_8) = (tab_168084._int8)
                        AND (tab_168082.col4_11) = (tab_168084._string)
                        AND (tab_168082.col4_1) = (tab_168084._int2)
                        AND (tab_168082.col4_6) = (tab_168084._date)
                        AND (tab_168080.col5_1) = (tab_168084._string)
                        AND (tab_168082.col4_1) = (tab_168084._int8)
                JOIN defaultdb.public.table3 AS tab_168085
                    JOIN defaultdb.public.table2 AS tab_168086 ON (tab_168085.col3_3) = (tab_168086.col2_8)
                    JOIN defaultdb.public.table1@[0] AS tab_168087 ON
                            (tab_168085.col3_3) = (tab_168087.col1_7) AND (tab_168086.col2_8) = (tab_168087.col1_7) ON
                        (tab_168082.col4_16) = (tab_168085.col3_3) ON
                    (tab_168079.col1_6) = (tab_168084._float8)
                    AND (tab_168079.col1_2) = (tab_168083.col5_2)
                    AND (tab_168079.col1_4) = (tab_168084._uuid)
                    AND (tab_168079.col1_0) = (tab_168083.col5_0),
            defaultdb.public.table1@[0] AS tab_168088
        LIMIT
            84:::INT8;

Schema:

    rsg_test.go:593: To reproduce, use schema:
    rsg_test.go:595: 
        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 GEOMETRY NULL, col1_2 INT4, col1_3 GEOGRAPHY NOT NULL, col1_4 UUID NULL, col1_5 INTERVAL, col1_6 FLOAT8 NOT NULL, col1_7 STRING NULL AS (lower(CAST(col1_1 AS STRING))) STORED, FAMILY (col1_6), FAMILY (col1_0), FAMILY (col1_7), FAMILY (col1_2, col1_5), FAMILY (col1_4), FAMILY (col1_1, col1_3));
        CREATE TABLE table2 (col2_0 INET NOT NULL, col2_1 TIMETZ NULL, col2_2 REGPROCEDURE NOT NULL, col2_3 STRING NOT NULL, col2_4 REGTYPE NOT NULL, col2_5 TIMESTAMP, PRIMARY KEY (col2_0 ASC, col2_2 DESC, col2_4, col2_3 ASC), col2_6 STRING NULL AS (lower(CAST(col2_1 AS STRING))) STORED, col2_7 STRING NOT NULL AS (lower(CAST(col2_2 AS STRING))) STORED, col2_8 STRING NOT NULL AS (lower(CAST(col2_0 AS STRING))) VIRTUAL, col2_9 STRING NOT NULL AS (lower(CAST(col2_0 AS STRING))) STORED, INDEX (col2_4 ASC, col2_2 DESC, col2_3 DESC) STORING (col2_1, col2_6, col2_9) WHERE ((((((table2.col2_5 <= '-4713-11-24 00:00:00':::TIMESTAMP) AND (table2.col2_9 > e'\'':::STRING)) AND (table2.col2_6 < '':::STRING)) AND (table2.col2_8 < '':::STRING)) AND (table2.col2_3 <= e'\U00002603':::STRING)) AND (table2.col2_1 <= '00:00:00+15:59:00':::TIMETZ)) OR (table2.col2_7 != e'\'':::STRING), UNIQUE (col2_8 ASC, col2_5 DESC, col2_7 ASC, col2_0 ASC), UNIQUE (col2_2, col2_7 DESC, col2_9 ASC), INDEX (col2_6, col2_7 ASC, col2_9 ASC, col2_8 DESC, col2_1 DESC, col2_5, col2_2 ASC, col2_3, col2_0, col2_4 DESC) WHERE ((((((table2.col2_8 <= e'\x00':::STRING) AND (table2.col2_1 = '00:00:00+15:59:00':::TIMETZ)) AND (table2.col2_3 >= '"':::STRING)) AND (table2.col2_7 <= e'\'':::STRING)) AND (table2.col2_6 <= 'X':::STRING)) OR (table2.col2_9 <= 'X':::STRING)) AND (table2.col2_5 = '-4713-11-24 00:00:00':::TIMESTAMP), INDEX (col2_7, col2_4 ASC, col2_3 ASC) STORING (col2_1, col2_6, col2_9) WHERE table2.col2_8 = '':::STRING, INDEX (col2_4 ASC, lower(CAST(col2_2 AS STRING)) ASC, col2_7, col2_1 ASC), INDEX (col2_9, col2_6 DESC, col2_0, col2_5 DESC, lower(CAST(col2_5 AS STRING)), col2_8, col2_4 ASC, col2_7 ASC, col2_2 DESC) STORING (col2_1) WHERE ((((((table2.col2_6 <= e'\U00002603':::STRING) OR (table2.col2_3 > e'\U00002603':::STRING)) AND (table2.col2_5 <= '-2000-01-01 00:00:00':::TIMESTAMP)) OR (table2.col2_9 > e'\U00002603':::STRING)) OR (table2.col2_7 != '':::STRING)) OR (table2.col2_1 != '00:00:00+15:59:00':::TIMETZ)) OR (table2.col2_8 < 'X':::STRING));
        CREATE TABLE table3 (col3_0 BOX2D NOT NULL, col3_1 GEOMETRY NULL, col3_2 VARCHAR, col3_3 STRING NOT NULL AS (lower(CAST(col3_0 AS STRING))) STORED, INDEX (col3_0 ASC, col3_3) STORING (col3_1), INDEX (lower(CAST(col3_1 AS STRING)), lower(CAST(col3_0 AS STRING)) ASC) STORING (col3_0, col3_2, col3_3), UNIQUE (col3_2), INDEX (col3_3, col3_0 DESC), FAMILY (col3_2, col3_0), FAMILY (col3_3, col3_1));
        CREATE TABLE table4 (col4_0 TIME NULL, col4_1 INT8, col4_2 GEOGRAPHY NULL, col4_3 TIMESTAMP NULL, col4_4 TIMESTAMP, col4_5 REGPROCEDURE, col4_6 DATE NULL, col4_7 INT8, col4_8 INT2, col4_9 OID NOT NULL, col4_10 TIMESTAMPTZ NOT NULL, col4_11 CHAR NULL, col4_12 INET NULL, col4_13 INT2 AS (col4_8 + col4_1) VIRTUAL, col4_14 STRING NOT NULL AS (lower(CAST(col4_9 AS STRING))) STORED, col4_15 STRING NOT NULL AS (CASE WHEN col4_10 IS NULL THEN e'6\\\x17\x13':::STRING ELSE e'\'':::STRING END) STORED, col4_16 STRING NULL AS (lower(CAST(col4_12 AS STRING))) STORED, INDEX (col4_4, col4_13, col4_0 ASC, col4_14 DESC, col4_6), INDEX (col4_15 DESC, col4_10, col4_4 ASC, col4_11 DESC, col4_12 DESC, (col4_1 + col4_8) ASC, col4_1 ASC, (col4_8 + (-14044):::INT8) DESC) STORING (col4_0, col4_2, col4_6, col4_7, col4_8, col4_9, col4_14), UNIQUE (col4_12 DESC, col4_7, col4_15, col4_10, lower(CAST(col4_5 AS STRING)) DESC, col4_6 ASC, col4_3 DESC, col4_11 ASC, col4_14 ASC), FAMILY (col4_10), FAMILY (col4_11), FAMILY (col4_14, col4_8, col4_12), FAMILY (col4_16), FAMILY (col4_0), FAMILY (col4_7, col4_9, col4_1), FAMILY (col4_5), FAMILY (col4_2), FAMILY (col4_4, col4_15, col4_3, col4_6));
        CREATE TABLE table5 (col5_0 DECIMAL NOT NULL, col5_1 VARCHAR NOT NULL, col5_2 INT8 NOT NULL, col5_3 JSONB NOT NULL, col5_4 INTERVAL NOT NULL, col5_5 BIT(3) NOT NULL, PRIMARY KEY (col5_4 DESC, col5_1 ASC), col5_6 STRING NOT NULL AS (lower(CAST(col5_3 AS STRING))) STORED, col5_7 DECIMAL NOT NULL AS (col5_0 + 7.272928254937243343E+27:::DECIMAL) VIRTUAL);
        ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 163, "histo_col_type": "", "name": "__auto__", "null_count": 11, "row_count": 200}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 129, "histo_col_type": "", "name": "__auto__", "null_count": 151, "row_count": 200}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 24, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 200}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 176, "histo_col_type": "", "name": "__auto__", "null_count": 144, "row_count": 200}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 190, "histo_col_type": "", "name": "__auto__", "null_count": 168, "row_count": 200}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 47, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 200}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 112, "histo_col_type": "", "name": "__auto__", "null_count": 6, "row_count": 200}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 109, "histo_col_type": "", "name": "__auto__", "null_count": 17, "row_count": 200}]':::JSONB;
        ALTER TABLE table2 INJECT STATISTICS e'[{"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3156930512102274199, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4019003421250405929}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1209514696839245609, "histo_col_type": "STRING", "name": "__auto__", "null_count": 2951198751544018846, "row_count": 4019003421250405929}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 515235854223743385, "histo_buckets": [{"distinct_range": 0, "num_eq": 4844969991418003409, "num_range": 0, "upper_bound": "?\x7f"}, {"distinct_range": 6840090272410434000, "num_eq": 10000, "num_range": 7181747328053989311, "upper_bound": "u xvH"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 0, "row_count": 4019003421250405929}, {"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2547436777596053262, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4019003421250405929}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3087888935845857624, "histo_buckets": [{"distinct_range": 0, "num_eq": 4361744577912432408, "num_range": 0, "upper_bound": "0"}, {"distinct_range": 4000, "num_eq": 1000000000, "num_range": 4000, "upper_bound": "583826984"}, {"distinct_range": 0, "num_eq": 394706481407754886, "num_range": 3761319671460189908, "upper_bound": "1326625850"}, {"distinct_range": 40000000, "num_eq": 400000000, "num_range": 40000000, "upper_bound": "1379822635"}, {"distinct_range": 47.56466982158892, "num_eq": 1663838552686428526, "num_range": 70, "upper_bound": "2054225321"}, {"distinct_range": 0, "num_eq": 3730199777728939419, "num_range": 50000, "upper_bound": "2966822467"}, {"distinct_range": 0, "num_eq": 8000000, "num_range": 1576878294407839976, "upper_bound": "3860719040"}, {"distinct_range": 0, "num_eq": 7133383820498223007, "num_range": 500, "upper_bound": "3985845739"}, {"distinct_range": 0, "num_eq": 60000000, "num_range": 5000000000, "upper_bound": "4096894468"}], "histo_col_type": "REGPROCEDURE", "name": "__auto__", "null_count": 0, "row_count": 4019003421250405929}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 841346368322716632, "histo_col_type": "", "name": "__auto__", "null_count": 282180435450167090, "row_count": 4019003421250405929}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1837529404926193276, "histo_buckets": [{"distinct_range": 0, "num_eq": 5000000000, "num_range": 0, "upper_bound": "2373593413"}, {"distinct_range": 300, "num_eq": 4457818499399441530, "num_range": 300, "upper_bound": "2774242461"}, {"distinct_range": 0, "num_eq": 5000000, "num_range": 8815790343063636236, "upper_bound": "2989888290"}], "histo_col_type": "REGTYPE", "name": "__auto__", "null_count": 0, "row_count": 4019003421250405929}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3125622822125976176, "histo_col_type": "", "name": "__auto__", "null_count": 950173729088268155, "row_count": 4019003421250405929}, {"columns": ["col2_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2734425733581639533, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4019003421250405929}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1168732566614865973, "histo_buckets": [{"distinct_range": 0, "num_eq": 4000000000, "num_range": 0, "upper_bound": "0.0.0.0/0"}, {"distinct_range": 0, "num_eq": 4872182688802108594, "num_range": 30000, "upper_bound": "254.246.43.251/0"}, {"distinct_range": 0, "num_eq": 4443110856009429453, "num_range": 5000000, "upper_bound": "115.104.140.13/29"}, {"distinct_range": 0, "num_eq": 1000000, "num_range": 7062759736753033194, "upper_bound": "575b:b8dd:4129:659b:702b:a890:e8eb:f17b/16"}], "histo_col_type": "INET", "name": "__auto__", "null_count": 0, "row_count": 4019003421250405929}]':::JSONB;
        ALTER TABLE table3 INJECT STATISTICS e'[{"columns": ["col3_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 50405113518, "histo_buckets": [{"distinct_range": 0, "num_eq": 400, "num_range": 0, "upper_bound": "\\u0019e7PU"}, {"distinct_range": 0, "num_eq": 2808684050588373206, "num_range": 1000000000, "upper_bound": "k~^;e\\nd"}], "histo_col_type": "VARCHAR", "name": "__auto__", "null_count": 47758172027, "row_count": 90000000000}, {"columns": ["col3_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 589711472, "histo_buckets": [{"distinct_range": 0, "num_eq": 70000, "num_range": 0, "upper_bound": ")"}, {"distinct_range": 80000, "num_eq": 5000000, "num_range": 80000, "upper_bound": ".D\\u0002/"}, {"distinct_range": 100000000000, "num_eq": 1000, "num_range": 100000000000, "upper_bound": "2"}, {"distinct_range": 0, "num_eq": 1521262412064099349, "num_range": 0, "upper_bound": "c"}, {"distinct_range": 0, "num_eq": 30000000, "num_range": 723705132523993929, "upper_bound": "r\'l``IL"}, {"distinct_range": 9113.465495053779, "num_eq": 7000, "num_range": 10000, "upper_bound": "t^5"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 0, "row_count": 90000000000}, {"columns": ["col3_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 37313572223, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 90000000000}, {"columns": ["col3_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 56597667407, "histo_col_type": "", "name": "__auto__", "null_count": 16920484860, "row_count": 90000000000}]':::JSONB;
        ALTER TABLE table4 INJECT STATISTICS e'[{"columns": ["col4_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 47043968, "histo_col_type": "TIMESTAMP", "name": "__auto__", "null_count": 83407353, "row_count": 100000000}, {"columns": ["col4_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 77049091, "histo_col_type": "", "name": "__auto__", "null_count": 34018001, "row_count": 100000000}, {"columns": ["col4_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 16445733, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 100000000}, {"columns": ["col4_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 12855850, "histo_buckets": [{"distinct_range": 0, "num_eq": 100000000000, "num_range": 0, "upper_bound": "0.0.0.0/0"}, {"distinct_range": 0, "num_eq": 9107624145641251209, "num_range": 1171758796818528532, "upper_bound": "88.194.125.3/4"}, {"distinct_range": 704.5867450428548, "num_eq": 3000000, "num_range": 1000, "upper_bound": "ee8a:e43c:8408:ae4a:2b7e:65ff:ff98:c533/68"}, {"distinct_range": 0, "num_eq": 7914245606192729547, "num_range": 3321406637959799325, "upper_bound": "a3b5:4fbd:1c69:890d:437f:d000:cf47:24db/104"}], "histo_col_type": "INET", "name": "__auto__", "null_count": 11593033, "row_count": 100000000}, {"columns": ["col4_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 55868785, "histo_col_type": "", "name": "__auto__", "null_count": 86066723, "row_count": 100000000}, {"columns": ["col4_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 52774105, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 100000000}, {"columns": ["col4_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 36079665, "histo_col_type": "", "name": "__auto__", "null_count": 10962306, "row_count": 100000000}, {"columns": ["col4_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 78239475, "histo_col_type": "", "name": "__auto__", "null_count": 56096222, "row_count": 100000000}, {"columns": ["col4_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 41433716, "histo_col_type": "", "name": "__auto__", "null_count": 21184826, "row_count": 100000000}, {"columns": ["col4_16"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 53463175, "histo_col_type": "", "name": "__auto__", "null_count": 29470051, "row_count": 100000000}, {"columns": ["col4_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 53886059, "histo_col_type": "", "name": "__auto__", "null_count": 70428004, "row_count": 100000000}, {"columns": ["col4_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 65500790, "histo_col_type": "", "name": "__auto__", "null_count": 89144564, "row_count": 100000000}, {"columns": ["col4_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 56426830, "histo_buckets": [{"distinct_range": 0, "num_eq": 772800889997015262, "num_range": 0, "upper_bound": ""}, {"distinct_range": 5000, "num_eq": 600000, "num_range": 5000, "upper_bound": "\\t\\u0019<"}, {"distinct_range": 900000, "num_eq": 10, "num_range": 900000, "upper_bound": "\\n_b~\\u001eM30"}, {"distinct_range": 38120.103169966664, "num_eq": 146210961469876972, "num_range": 50000, "upper_bound": "\\u001c#\\"\\u0004\\u00120"}, {"distinct_range": 100000000, "num_eq": 200, "num_range": 100000000, "upper_bound": "cX"}, {"distinct_range": 3076585187906022400, "num_eq": 9000000000, "num_range": 4908392372178756281, "upper_bound": "j\\u001b$\\u0006,"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 0, "row_count": 100000000}, {"columns": ["col4_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 19407688, "histo_col_type": "", "name": "__auto__", "null_count": 2271447, "row_count": 100000000}, {"columns": ["col4_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 19207016, "histo_col_type": "", "name": "__auto__", "null_count": 80765936, "row_count": 100000000}, {"columns": ["col4_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 64131034, "histo_col_type": "", "name": "__auto__", "null_count": 27155920, "row_count": 100000000}, {"columns": ["col4_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 15380821, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 100000000}]':::JSONB;
        ALTER TABLE table5 INJECT STATISTICS '[{"columns": ["col5_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col5_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": ["col5_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": ["col5_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": ["col5_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col5_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": ["col5_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": ["col5_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_buckets": [{"distinct_range": 0, "num_eq": 2236249414299853641, "num_range": 0, "upper_bound": "-70 years -8 mons -150 days -22:36:19.014238"}, {"distinct_range": 0, "num_eq": 1399025381678882000, "num_range": 685219313463790719, "upper_bound": "-21 years -2 mons -376 days -17:40:48.314468"}, {"distinct_range": 1924918363164187400, "num_eq": 4000, "num_range": 2631174383241758055, "upper_bound": "-16 years -2 mons -784 days -04:38:54.003349"}, {"distinct_range": 5056383884.524946, "num_eq": 8783606222403829928, "num_range": 9000000000, "upper_bound": "19 years 6 mons 198 days 20:24:30.124954"}, {"distinct_range": 80793612019.37117, "num_eq": 600000, "num_range": 90000000000, "upper_bound": "34 years 2 mons 993 days 02:37:35.768075"}, {"distinct_range": 959914.2571441196, "num_eq": 5961621881120768088, "num_range": 1000000, "upper_bound": "48 years 9 mons 981 days 11:51:07.623463"}, {"distinct_range": 0, "num_eq": 6144254800459446269, "num_range": 215355222554964860, "upper_bound": "70 years 10 mons 242 days 21:00:53.72121"}], "histo_col_type": "INTERVAL", "name": "__auto__", "null_count": 0, "row_count": 0}]':::JSONB;
        CREATE TYPE rand_typ_0 AS ENUM ('qar', 'dp', 'o', 'rcrft');
        CREATE TYPE rand_typ_1 AS ENUM ('ffoz', 'zbban', 'jfg', 'aqus', 'suig');
        ;
    rsg_test.go:595: 
        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:597: 
    rsg_test.go:598: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith024379349
--- FAIL: TestRandomSyntaxSQLSmith (300.79s)
Reproduce

To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```

Same failure on other branches

- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]

Internal log

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

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity commented 2 years ago

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ 42e5f9492d0d8d93638241303bca984fe78baae3:

Random syntax error:

    rsg_test.go:776: Crash detected: server panic: driver: bad connection

Query:

        WITH
            with_158258 (col_901735)
                AS (
                    SELECT
                        *
                    FROM
                        (VALUES (3407595982:::OID), (0:::OID), (1745919730:::OID), (NULL), (0:::OID), (4222019534:::OID))
                            AS tab_387537 (col_901735)
                ),
            with_158259 (col_901736) AS (SELECT '+':::STRING AS col_901736),
            with_158260 (col_901737) AS (SELECT * FROM (VALUES ('t':::rand_typ_0)) AS tab_387538 (col_901737))
        SELECT
            (
                WITH
                    with_158261 (col_901738, col_901739)
                        AS (
                            SELECT
                                *
                            FROM
                                (
                                    VALUES
                                        (NULL, 0:::OID),
                                        (
                                            ARRAY[4247769439:::OID,3856732427:::OID,2838309636:::OID,0:::OID,0:::OID],
                                            985129623:::OID
                                        ),
                                        (ARRAY[2642535069:::OID], NULL)
                                )
                                    AS tab_387539 (col_901738, col_901739)
                        ),
                    with_158262 (col_901740)
                        AS (
                            SELECT
                                *
                            FROM
                                (
                                    VALUES
                                        (1761523074792110439:::INT8),
                                        (NULL),
                                        (NULL),
                                        (((-1195619079708105239):::INT8::INT8 & 8307733534922412430:::INT8::INT8)::INT8),
                                        (NULL),
                                        (5290987623530837974:::INT8)
                                )
                                    AS tab_387540 (col_901740)
                            INTERSECT
                                SELECT
                                    *
                                FROM
                                    (
                                        VALUES
                                            (
                                                ((SELECT (-7029832025633519125):::INT8 AS col_901741 LIMIT 1:::INT8)::INT8 << ((-7274565707336508593):::INT8::INT8 & 8605448309932280169:::INT8::INT8)::INT8::INT8)::INT8
                                            ),
                                            (6939180640324534610:::INT8),
                                            ((-3484725302083541828):::INT8),
                                            ((-5943041195556473972):::INT8)
                                    )
                                        AS tab_387541 (col_901742)
                        )
                SELECT
                    cte_ref_45943.col_901737 AS col_901743
                FROM
                    defaultdb.public.table4@table4_col4_15_col4_0_idx AS tab_387542, with_158262 AS cte_ref_45944
                WHERE
                    true
                ORDER BY
                    tab_387542.col4_10, tab_387542.col4_5, tab_387542.col4_1 DESC
                LIMIT
                    1:::INT8
            )
                AS col_901744
        FROM
            with_158260 AS cte_ref_45943
        LIMIT
            52:::INT8;

Schema:

    rsg_test.go:593: To reproduce, use schema:
    rsg_test.go:595: 
        SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
        SET enable_drop_enum_value = true;

                SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
                SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
                SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
            CREATE TABLE table1 (col1_0 INT4, col1_1 TIME NOT NULL, col1_2 CHAR NOT NULL, col1_3 INTERVAL NOT NULL, col1_4 TIMESTAMP NOT NULL, col1_5 DATE, PRIMARY KEY (col1_2 DESC, col1_1 ASC, col1_3 DESC), col1_6 STRING AS (lower(CAST(col1_5 AS STRING))) VIRTUAL, INDEX (col1_3, col1_0 DESC, col1_5 DESC, col1_2 ASC, lower(CAST(col1_3 AS STRING)), col1_6 DESC) WHERE (table1.col1_5 = '-infinity':::DATE) AND (table1.col1_4 = '294276-12-31 23:59:59.999999':::TIMESTAMP), UNIQUE (col1_6, col1_3, col1_4, col1_0 DESC, col1_1, col1_2 DESC, col1_5 DESC) WHERE table1.col1_6 <= e'\U00002603':::STRING, INDEX (col1_3, col1_6 DESC, lower(CAST(col1_1 AS STRING)) DESC, (col1_0 + 660378943:::INT8) ASC, col1_1) STORING (col1_0, col1_4, col1_5) WHERE (table1.col1_5 = '1970-01-01':::DATE) OR (table1.col1_2 <= e'\x00':::STRING), UNIQUE (col1_1, col1_3, col1_0 ASC, col1_4 ASC, col1_5), UNIQUE (lower(CAST(col1_1 AS STRING)) ASC, col1_1, col1_0 DESC) WHERE ((table1.col1_0 > 0:::INT8) AND (table1.col1_4 = '-4713-11-24 00:00:00':::TIMESTAMP)) OR (table1.col1_6 >= 'X':::STRING), UNIQUE (col1_6 DESC, col1_3 ASC, col1_4 ASC) STORING (col1_0), INDEX (col1_4 ASC) WHERE ((((table1.col1_0 = 1:::INT8) OR (table1.col1_4 != '3000-01-01 00:00:00':::TIMESTAMP)) OR (table1.col1_5 <= '1970-01-01':::DATE)) OR (table1.col1_2 > '"':::STRING)) OR (table1.col1_1 >= '24:00:00':::TIME));
        CREATE TABLE table2 (col2_0 INTERVAL NOT NULL, col2_1 BYTES NOT NULL, col2_2 BYTES NOT NULL, PRIMARY KEY (col2_0 ASC, col2_2 DESC, col2_1 ASC), INDEX (col2_1 ASC, col2_2) WHERE (table2.col2_2 > '\x58':::BYTES) OR (table2.col2_1 >= '\xe29883':::BYTES), UNIQUE (col2_0 ASC, col2_2 ASC), INDEX (col2_0 DESC, col2_1) WHERE table2.col2_1 <= '\x':::BYTES, INDEX (col2_1 DESC) WHERE table2.col2_2 > '\xff':::BYTES, UNIQUE (col2_0, col2_2 ASC, col2_1), INDEX (col2_1 ASC, col2_0 ASC, (CASE WHEN col2_1 IS NULL THEN '/{hv':::STRING ELSE '(':::STRING END) ASC), UNIQUE (col2_2 DESC, col2_0 DESC, col2_1));
        CREATE TABLE table3 (col3_0 "char" NOT NULL, col3_1 "char" NULL, col3_2 BOOL, col3_3 BOX2D NULL, col3_4 JSONB, col3_5 REGROLE NULL, col3_6 TIME, col3_7 STRING AS (lower(CAST(col3_4 AS STRING))) STORED, col3_8 STRING NULL AS (lower(CAST(col3_5 AS STRING))) STORED, col3_9 STRING AS (lower(CAST(col3_4 AS STRING))) VIRTUAL, UNIQUE (col3_3, col3_1 ASC), INDEX (col3_6 DESC) STORING (col3_0, col3_2, col3_5, col3_8), UNIQUE (col3_1 DESC, col3_5) WHERE (((table3.col3_7 < '':::STRING) OR (table3.col3_8 != 'X':::STRING)) OR (table3.col3_0 < 'X':::STRING)) OR (table3.col3_1 > e'\x00':::STRING));
        CREATE TABLE table4 (col4_0 STRING NOT NULL, col4_1 BOX2D, col4_2 "char" NOT NULL, col4_3 REGROLE NULL, col4_4 JSONB NOT NULL, col4_5 GEOMETRY NULL, col4_6 GEOMETRY NULL, col4_7 INT8 NOT NULL, col4_8 UUID NOT NULL, col4_9 INT2 NULL, col4_10 REGCLASS NOT NULL, col4_11 REGNAMESPACE NOT NULL, col4_12 INT2 NULL, col4_13 INT2 NULL AS (col4_9 + col4_7) STORED, col4_14 INT8 NULL AS ((col4_7 + col4_9) + col4_12) STORED, col4_15 INT2 NULL AS ((col4_12 + col4_9) + col4_7) STORED, INDEX (col4_15 ASC, col4_0));
        ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 312, "histo_buckets": [{"distinct_range": 0, "num_eq": 8040857850026419200, "num_range": 0, "upper_bound": "-2000-01-01 00:00:00"}, {"distinct_range": 20528.862433405713, "num_eq": 80000, "num_range": 70000, "upper_bound": "1974-01-03 22:05:05.000761"}, {"distinct_range": 42.17318586345637, "num_eq": 7093871431879710213, "num_range": 70, "upper_bound": "1983-07-13 21:35:49.000744"}, {"distinct_range": 640115889259741700, "num_eq": 6000000, "num_range": 1111712375619575027, "upper_bound": "2018-07-28 15:15:49.000832"}, {"distinct_range": 111087231103806700, "num_eq": 900000, "num_range": 590172507886231959, "upper_bound": "2019-03-20 14:42:16.000948"}, {"distinct_range": 5984827535631562000, "num_eq": 5892722430532452323, "num_range": 5984827535631561916, "upper_bound": "2022-07-08 10:31:01.000767"}, {"distinct_range": 0, "num_eq": 40268669575171312, "num_range": 60, "upper_bound": "294276-12-31 23:59:59.999999"}], "histo_col_type": "TIMESTAMP", "name": "__auto__", "null_count": 0, "row_count": 1000}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 110, "histo_col_type": "", "name": "__auto__", "null_count": 998, "row_count": 1000}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 18, "histo_col_type": "STRING", "name": "__auto__", "null_count": 492, "row_count": 1000}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 876, "histo_col_type": "", "name": "__auto__", "null_count": 271, "row_count": 1000}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 331, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1000}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 321, "histo_buckets": [{"distinct_range": 0, "num_eq": 30, "num_range": 0, "upper_bound": "="}], "histo_col_type": "CHAR", "name": "__auto__", "null_count": 0, "row_count": 1000}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 501, "histo_buckets": [{"distinct_range": 0, "num_eq": 799072043221283897, "num_range": 0, "upper_bound": "-51 years -6 mons -817 days -10:50:22.725832"}, {"distinct_range": 0, "num_eq": 4319126586563682158, "num_range": 8000000000, "upper_bound": "00:00:00"}, {"distinct_range": 70, "num_eq": 5707567581776572964, "num_range": 70, "upper_bound": "25 years 2 mons 13 days 05:41:54.731592"}, {"distinct_range": 1547861143348159200, "num_eq": 4805235814250810599, "num_range": 2512121485685128693, "upper_bound": "30 years 9 mons 424 days 07:41:45.795802"}, {"distinct_range": 0, "num_eq": 4206869083366310608, "num_range": 3000000000, "upper_bound": "45 years 9 mons 359 days 18:39:33.00272"}, {"distinct_range": 700000, "num_eq": 3000000000, "num_range": 700000, "upper_bound": "61 years 11 mons 202 days 03:52:04.654107"}, {"distinct_range": 0, "num_eq": 40000000, "num_range": 4000000000, "upper_bound": "69 years 2 mons 53 days 13:43:06.739228"}, {"distinct_range": 1347452844438484000, "num_eq": 800, "num_range": 1347452844438484095, "upper_bound": "81 years 3 mons 137 days 17:49:27.051636"}], "histo_col_type": "INTERVAL", "name": "__auto__", "null_count": 0, "row_count": 1000}]':::JSONB;
        ALTER TABLE table2 INJECT STATISTICS e'[{"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 281, "histo_buckets": [{"distinct_range": 0, "num_eq": 4157749740065491359, "num_range": 0, "upper_bound": "-50 years -6 mons -810 days -09:42:37.764894"}, {"distinct_range": 0, "num_eq": 4828651694862718268, "num_range": 5090142042746911277, "upper_bound": "20 years 5 mons 516 days 06:55:04.555359"}, {"distinct_range": 52131.79940815484, "num_eq": 1039202344801677102, "num_range": 60000, "upper_bound": "52 years 10 mons 145 days 20:40:12.758786"}, {"distinct_range": 5600717970899502000, "num_eq": 779211143405654062, "num_range": 5600717970899502160, "upper_bound": "72 years 5 mons 445 days 00:14:56.003189"}], "histo_col_type": "INTERVAL", "name": "__auto__", "null_count": 0, "row_count": 500}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 295, "histo_buckets": [{"distinct_range": 0, "num_eq": 1679706900989767363, "num_range": 0, "upper_bound": "\\\\x426a"}, {"distinct_range": 0, "num_eq": 10, "num_range": 6468937279271778941, "upper_bound": "\\\\x53e305514a"}], "histo_col_type": "BYTES", "name": "__auto__", "null_count": 0, "row_count": 500}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 313, "histo_buckets": [{"distinct_range": 0, "num_eq": 0, "num_range": 0, "upper_bound": "\\\\x116deebb18d08d"}], "histo_col_type": "BYTES", "name": "__auto__", "null_count": 0, "row_count": 500}]':::JSONB;
        ALTER TABLE table3 INJECT STATISTICS e'[{"columns": ["col3_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 399581, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 900000}, {"columns": ["col3_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 865395, "histo_buckets": [{"distinct_range": 0, "num_eq": 30000000, "num_range": 0, "upper_bound": "\\u0011"}, {"distinct_range": 0, "num_eq": 3553189679518515893, "num_range": 1000000000, "upper_bound": "\\u0019"}, {"distinct_range": 0, "num_eq": 300000000, "num_range": 8560624504918797639, "upper_bound": "*"}, {"distinct_range": 3389175266050411500, "num_eq": 8495935541058239890, "num_range": 3389175266050411327, "upper_bound": "-"}, {"distinct_range": 500000000, "num_eq": 70000000000, "num_range": 500000000, "upper_bound": "="}, {"distinct_range": 115079071.7216826, "num_eq": 10000000000, "num_range": 1000000000, "upper_bound": "a"}, {"distinct_range": 90086.02427146702, "num_eq": 7882816868044767036, "num_range": 100000, "upper_bound": "c"}, {"distinct_range": 59403.56601098553, "num_eq": 5435611871273470051, "num_range": 60000, "upper_bound": "|"}], "histo_col_type": "\\"char\\"", "name": "__auto__", "null_count": 508807, "row_count": 900000}, {"columns": ["col3_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 329052, "histo_col_type": "TIME", "name": "__auto__", "null_count": 204971, "row_count": 900000}, {"columns": ["col3_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 281055, "histo_col_type": "", "name": "__auto__", "null_count": 640787, "row_count": 900000}, {"columns": ["col3_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 394874, "histo_col_type": "", "name": "__auto__", "null_count": 848416, "row_count": 900000}, {"columns": ["col3_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 446695, "histo_col_type": "", "name": "__auto__", "null_count": 133856, "row_count": 900000}, {"columns": ["col3_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 812616, "histo_buckets": [{"distinct_range": 0, "num_eq": 8396597880634951955, "num_range": 0, "upper_bound": "BOX(-10 -10,10 10)"}, {"distinct_range": 8000000000, "num_eq": 3689811592072219148, "num_range": 8000000000, "upper_bound": "BOX(-1.4615174553112773 0.43535620620556104,-1.2871835078986007 0.4875366927953163)"}, {"distinct_range": 0, "num_eq": 2000, "num_range": 2288631884201288664, "upper_bound": "BOX(-1.3888157198555935 -2.0118725885774755,0.06677094245159026 1.4272767089035208)"}, {"distinct_range": 0, "num_eq": 700000, "num_range": 0, "upper_bound": "BOX(-0.7513871828051 1.7925854010273623,0.2648528139776587 1.8100359933231067)"}, {"distinct_range": 2909360565802321000, "num_eq": 6287337460594006392, "num_range": 2909360565802320668, "upper_bound": "BOX(-0.7415356827834596 -0.4095602192092703,0.8476681406453345 1.183697328410931)"}], "histo_col_type": "BOX2D", "name": "__auto__", "null_count": 135574, "row_count": 900000}, {"columns": ["col3_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 53337, "histo_col_type": "", "name": "__auto__", "null_count": 667857, "row_count": 900000}, {"columns": ["col3_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 482062, "histo_col_type": "", "name": "__auto__", "null_count": 438743, "row_count": 900000}, {"columns": ["col3_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 305288, "histo_col_type": "", "name": "__auto__", "null_count": 177866, "row_count": 900000}]':::JSONB;
        ALTER TABLE table4 INJECT STATISTICS '[{"columns": ["col4_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4551692888402024179, "histo_col_type": "", "name": "__auto__", "null_count": 5918265743571978, "row_count": 7026934140942060281}, {"columns": ["col4_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5660417628613728077, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7026934140942060281}, {"columns": ["col4_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5175106756061734533, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7026934140942060281}, {"columns": ["col4_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1365369517786618357, "histo_col_type": "", "name": "__auto__", "null_count": 5797988337183281764, "row_count": 7026934140942060281}, {"columns": ["col4_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4084154268334966260, "histo_col_type": "", "name": "__auto__", "null_count": 801532926422457321, "row_count": 7026934140942060281}, {"columns": ["col4_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 522775153540691815, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7026934140942060281}, {"columns": ["col4_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6300921620300626937, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7026934140942060281}, {"columns": ["col4_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1211417531168415115, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7026934140942060281}, {"columns": ["col4_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1363840135942325733, "histo_col_type": "", "name": "__auto__", "null_count": 6011749897085614669, "row_count": 7026934140942060281}, {"columns": ["col4_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3561713829440176776, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7026934140942060281}, {"columns": ["col4_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 145090278999712598, "histo_col_type": "INT2", "name": "__auto__", "null_count": 3093351813397482104, "row_count": 7026934140942060281}, {"columns": ["col4_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1982994314139094115, "histo_col_type": "", "name": "__auto__", "null_count": 1715973864649202042, "row_count": 7026934140942060281}, {"columns": ["col4_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5628262785819954323, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7026934140942060281}, {"columns": ["col4_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2190219035097486747, "histo_col_type": "", "name": "__auto__", "null_count": 3282355648631509737, "row_count": 7026934140942060281}, {"columns": ["col4_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1390256889335429321, "histo_col_type": "", "name": "__auto__", "null_count": 2488021807784433366, "row_count": 7026934140942060281}, {"columns": ["col4_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1115320239018360279, "histo_col_type": "", "name": "__auto__", "null_count": 4048279312012196547, "row_count": 7026934140942060281}]':::JSONB;
        CREATE TYPE rand_typ_0 AS ENUM ('ojh', 'e', 'j', 'msmoo', 'irk', 't');
        ;
    rsg_test.go:595: 
        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:597: 
    rsg_test.go:598: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith196459823
--- FAIL: TestRandomSyntaxSQLSmith (300.80s)
Reproduce

To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```

Same failure on other branches

- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]

Internal log

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

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity commented 2 years ago

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ e369d86b3bac2b9f40d760c3e6e49f55b7e15abe:

Random syntax error:

    rsg_test.go:776: Crash detected: server panic: driver: bad connection

Query:

        SELECT
            tab_559860._inet AS col_1290778,
            (
                SELECT
                    tab_559865._jsonb AS col_1290779
                FROM
                    defaultdb.public.seed AS tab_559865
                    JOIN defaultdb.public.seed AS tab_559866 ON (tab_559865._jsonb) = (tab_559866._jsonb)
                WHERE
                    false
                LIMIT
                    1:::INT8
            )
                AS col_1290780,
            NULL AS col_1290781,
            tab_559859.crdb_internal_idx_expr_1 AS col_1290782,
            (tab_559860._bool AND tab_559860._bool) AS col_1290783
        FROM
            defaultdb.public.table1@table1_col1_3_idx AS tab_559859
            JOIN defaultdb.public.seed@seed__int8__float8__date_idx AS tab_559860 ON
                    (tab_559859.crdb_internal_mvcc_timestamp) = (tab_559860.crdb_internal_mvcc_timestamp)
                    AND (tab_559859.col1_3) = (tab_559860.crdb_internal_mvcc_timestamp)
        WHERE
            (st_relatematch(tab_559860._string::STRING, e'4\n\x04\x0ec\x1e':::STRING::STRING)::BOOL OR (1.1647691169066348:::FLOAT8::FLOAT8 IN (WITH with_229118 (col_1290772) AS (SELECT * FROM (VALUES ('a16fc37f-d327-45a6-84c8-5bf1a3727483':::UUID), ('e4c0c69c-1f9c-4552-bcdd-08a3f970d750':::UUID), ('3ad10641-a442-471a-bf6c-7b57d3bff6a6':::UUID), ('eba088ee-fdd6-497d-af45-d58e9b381ec8':::UUID)) AS tab_559861 (col_1290772)), with_229119 (col_1290773) AS (SELECT * FROM (VALUES (',':::STRING), ('R':::STRING), (CASE WHEN false THEN NULL ELSE e'\x1d':::STRING END)) AS tab_559862 (col_1290773)) SELECT tab_559860._float8::FLOAT8 AS col_1290777 FROM defaultdb.public.seed@seed__int8__float8__date_idx AS tab_559863 WHERE tab_559863._inet::INET IN (WITH with_229120 (col_1290774) AS (SELECT 1768541787:::OID AS col_1290774), with_229121 (col_1290775) AS (SELECT * FROM (VALUES (764542687:::OID), (2041558980:::OID), (COALESCE(3201451559:::OID, 2406485906:::OID)), (COALESCE(2760146369:::OID, 0:::OID))) AS tab_559864 (col_1290775)) SELECT tab_559863._inet::INET AS col_1290776) ORDER BY tab_559863._date DESC, tab_559863._int2, tab_559863.tableoid, tab_559863._bool DESC LIMIT 7:::INT8)));

Schema:

    rsg_test.go:593: To reproduce, use schema:
    rsg_test.go:595: 
        SET CLUSTER SETTING sql.defaults.drop_enum_value.enabled = true;
        SET enable_drop_enum_value = true;

                SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
                SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;
                SET CLUSTER SETTING sql.defaults.interleaved_tables.enabled = true;
            CREATE TABLE table1 (col1_0 BIT(46) NOT NULL, col1_1 INT2, col1_2 INT8 NULL, col1_3 DECIMAL NOT NULL, PRIMARY KEY (col1_3 DESC), INDEX ((col1_3 + 4.10546386675874321E+22:::DECIMAL) DESC, col1_3 DESC, col1_0 ASC) STORING (col1_1, col1_2) WHERE ((table1.col1_2 >= (-9223372036854775807):::INT8) OR (table1.col1_1 >= 1:::INT8)) AND (table1.col1_3 >= (-1):::DECIMAL), INDEX (col1_3 ASC), INDEX (col1_2 ASC, col1_1, col1_0 DESC, col1_3 DESC), INDEX (col1_1, col1_0 ASC, (col1_1 + col1_2) DESC) STORING (col1_2) WHERE table1.col1_1 != 0:::INT8);
        ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 878288368505984710, "histo_col_type": "", "name": "__auto__", "null_count": 3813527286417626672, "row_count": 7197251567079449531}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7109882655228711240, "histo_col_type": "DECIMAL", "name": "__auto__", "null_count": 0, "row_count": 7197251567079449531}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6441320082047686447, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7197251567079449531}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1779632520856074229, "histo_buckets": [{"distinct_range": 0, "num_eq": 6033902841164556416, "num_range": 0, "upper_bound": "301"}], "histo_col_type": "INT2", "name": "__auto__", "null_count": 3801595803484334185, "row_count": 7197251567079449531}]':::JSONB;
        CREATE TYPE rand_typ_0 AS ENUM ('yzqafh', 'r', 'mfvdxa', 'ig', 'vzkma', 'eaqx');
        CREATE TYPE rand_typ_1 AS ENUM ('txeto', 'dkb', 'fhsq', 'o', 'njlz');
        CREATE TYPE rand_typ_2 AS ENUM ('vsrg', 'ao', 'rppbk', 'ltrfdu', 'ago', 'xml');
        CREATE TYPE rand_typ_3 AS ENUM ('xebs', 'med', 'mn', 'cr', 'cnrwdq', 'qqvu');
        CREATE TYPE rand_typ_4 AS ENUM ('xd', 'qj', 'rcf', 'rbea');
        ;
    rsg_test.go:595: 
        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:597: 
    rsg_test.go:598: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith565498864
--- FAIL: TestRandomSyntaxSQLSmith (300.86s)
Reproduce

To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```

Same failure on other branches

- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]

Internal log

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

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity commented 2 years ago

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ 2a7ef521a38d923cca9ec96e229237bbedc0c5fa:

Random syntax error:

    rsg_test.go:776: Crash detected: server panic: driver: bad connection

Query:

        WITH
            with_130399 (col_752329)
                AS (
                    SELECT
                        *
                    FROM
                        (
                            VALUES
                                ('32 years 7 mons 951 days 01:21:02.190714':::INTERVAL),
                                ('-25 years -1 mons -922 days -03:57:31.906716':::INTERVAL),
                                ('59 years 11 mons 900 days 03:56:20.216092':::INTERVAL)
                        )
                            AS tab_319303 (col_752329)
                ),
            with_130400 (col_752331)
                AS (
                    SELECT
                        *
                    FROM
                        (
                            VALUES
                                (ARRAY['O':::STRING,'I':::STRING]),
                                (
                                    (
                                        SELECT
                                            NULL AS col_752330
                                        FROM
                                            defaultdb.public.seed@seed__int8__float8__date_idx AS tab_319304
                                        ORDER BY
                                            tab_319304._float8 ASC, tab_319304._timestamptz
                                        LIMIT
                                            1:::INT8
                                    )
                                ),
                                (ARRAY['w':::STRING,'0':::STRING,e'\n':::STRING,'%':::STRING]),
                                (ARRAY[e'\x02':::STRING,')':::STRING,'6':::STRING])
                        )
                            AS tab_319305 (col_752331)
                ),
            with_130401 (col_752332)
                AS (SELECT * FROM (VALUES (1234409049:::OID), (NULL), (3760763584:::OID)) AS tab_319306 (col_752332))
        SELECT
            tab_319307._string AS col_752333,
            tab_319307._timestamptz AS col_752334,
            '-58 years -7 mons -618 days -04:28:52.163114':::INTERVAL AS col_752335,
            CASE
            WHEN tab_319307._bool THEN '2021-10-11 23:01:24.00009':::TIMESTAMP
            ELSE tab_319307._timestamp
            END
                AS col_752336,
            (
                SELECT
                    tab_319307._uuid AS col_752337
                FROM
                    defaultdb.public.seed@seed__int8__float8__date_idx AS tab_319308
                WHERE
                    tab_319308._bool
                ORDER BY
                    tab_319308._int8 ASC, tab_319308._interval
                LIMIT
                    1:::INT8
            )
                AS col_752338,
            '5346:b17:700c:c571:29b2:27b6:e998:56a3/94':::INET AS col_752339,
            tab_319307._int2 AS col_752340,
            NULL AS col_752341,
            tab_319307.tableoid AS col_752342,
            (2502924457.206391979:::DECIMAL::DECIMAL ^ tab_319307._decimal::DECIMAL)::DECIMAL AS col_752343,
            tab_319307._date AS col_752344
        FROM
            defaultdb.public.seed@seed__int8__float8__date_idx AS tab_319307
        ORDER BY
            tab_319307._string ASC, tab_319307._timestamptz DESC, tab_319307._date
        LIMIT
            50:::INT8;

Schema:

    rsg_test.go:593: To reproduce, use schema:
    rsg_test.go:595: 
        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 NAME NULL, col1_2 TIME NOT NULL, col1_3 BIT(38) NOT NULL, col1_4 BIT(20) NULL, col1_5 INT8 NULL, col1_6 INT2 NOT NULL, col1_7 OID NULL, col1_8 INT8, col1_9 REGTYPE, col1_10 INT2[] NULL, col1_11 TIMESTAMP NOT NULL, col1_12 DATE NOT NULL, PRIMARY KEY (col1_6, col1_11 DESC), col1_13 INT8 AS ((col1_8 + col1_5) + col1_6) STORED, col1_14 INT8 AS ((col1_8 + col1_5) + col1_6) VIRTUAL, col1_15 INT2 AS ((col1_6 + col1_8) + col1_5) STORED, INDEX (col1_15 ASC, col1_14, col1_5 ASC, col1_12 DESC, col1_1, (col1_5 + (-2641746784527594598):::INT8)) WHERE (((((((((table1.col1_5 <= 9223372036854775807:::INT8) OR (table1.col1_12 > '5874897-12-31':::DATE)) OR (table1.col1_11 = '3000-01-01 00:00:00':::TIMESTAMP)) OR (table1.col1_13 != (-9223372036854775807):::INT8)) AND (table1.col1_8 >= 9223372036854775807:::INT8)) AND (table1.col1_14 = 1:::INT8)) OR (table1.col1_0 >= e'\x00':::STRING)) OR (table1.col1_6 != (-1):::INT8)) AND (table1.col1_1 > e'\x00':::STRING)) OR (table1.col1_2 <= '24:00:00':::TIME));
        CREATE TABLE table2 (col2_0 REGTYPE, col2_1 BYTES NOT NULL, col2_2 BOX2D NOT NULL, col2_3 TIMESTAMP NOT NULL, col2_4 DATE, col2_5 STRING NOT NULL, PRIMARY KEY (col2_5, col2_3 ASC), UNIQUE (col2_2 ASC, col2_0 ASC, col2_1 DESC, col2_3 DESC, col2_4, col2_5 DESC));
        ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 28, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 70}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 30, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 70}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_col_type": "", "name": "__auto__", "null_count": 10, "row_count": 70}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 45, "histo_col_type": "", "name": "__auto__", "null_count": 24, "row_count": 70}, {"columns": ["col1_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7, "histo_col_type": "", "name": "__auto__", "null_count": 40, "row_count": 70}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 30, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 70}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 55, "histo_buckets": [{"distinct_range": 0, "num_eq": 40000000000, "num_range": 0, "upper_bound": "-7416"}, {"distinct_range": 800000, "num_eq": 2578442706918185295, "num_range": 800000, "upper_bound": "3716"}, {"distinct_range": 15389.8586324225, "num_eq": 700000000, "num_range": 300000, "upper_bound": "7127"}, {"distinct_range": 0, "num_eq": 5000000, "num_range": 1059283093175035526, "upper_bound": "11476"}, {"distinct_range": 0, "num_eq": 9164283558093345068, "num_range": 8022527624397875778, "upper_bound": "24411"}], "histo_col_type": "INT2", "name": "__auto__", "null_count": 0, "row_count": 70}, {"columns": ["col1_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 58, "histo_col_type": "", "name": "__auto__", "null_count": 6, "row_count": 70}, {"columns": ["col1_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 67, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 70}, {"columns": ["col1_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 29, "histo_buckets": [{"distinct_range": 0, "num_eq": 100000000, "num_range": 0, "upper_bound": "-13548"}, {"distinct_range": 30000000000, "num_eq": 3696061110317805367, "num_range": 30000000000, "upper_bound": "3984"}], "histo_col_type": "INT2", "name": "__auto__", "null_count": 8, "row_count": 70}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 48, "histo_col_type": "", "name": "__auto__", "null_count": 42, "row_count": 70}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 54, "histo_col_type": "", "name": "__auto__", "null_count": 36, "row_count": 70}, {"columns": ["col1_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 66, "histo_col_type": "", "name": "__auto__", "null_count": 52, "row_count": 70}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 11, "histo_col_type": "", "name": "__auto__", "null_count": 24, "row_count": 70}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2, "histo_col_type": "", "name": "__auto__", "null_count": 8, "row_count": 70}, {"columns": ["col1_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 51, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 70}]':::JSONB;
        ALTER TABLE table2 INJECT STATISTICS e'[{"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4957418274388795292, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 5551586868310586141}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4698365942374364647, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 5551586868310586141}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2498137245059330628, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 5551586868310586141}, {"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4574988880866040157, "histo_col_type": "", "name": "__auto__", "null_count": 5080006309626297951, "row_count": 5551586868310586141}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1812294135613239600, "histo_buckets": [{"distinct_range": 0, "num_eq": 0, "num_range": 0, "upper_bound": ""}, {"distinct_range": 865979285.8959705, "num_eq": 1937828379170143831, "num_range": 3000000000, "upper_bound": "\\u0019_+qck"}, {"distinct_range": 0, "num_eq": 1000000, "num_range": 3431450763354371263, "upper_bound": "\U00002603"}], "histo_col_type": "STRING", "name": "__auto__", "null_count": 0, "row_count": 5551586868310586141}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1355791193110429803, "histo_col_type": "", "name": "__auto__", "null_count": 264320690586394151, "row_count": 5551586868310586141}]':::JSONB;
        CREATE TYPE rand_typ_0 AS ENUM ('qwng', 'yudh', 'mr', 'y', 'ogute', 'hpjoa');
        CREATE TYPE rand_typ_1 AS ENUM ('k', 'idq', 't', 'tb', 'jdr', 'ddmec');
        CREATE TYPE rand_typ_2 AS ENUM ('x', 'd', 'yi', 'uzvtbh');
        ;
    rsg_test.go:595: 
        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:597: 
    rsg_test.go:598: -- test log scope end --
test logs left over in: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRandomSyntaxSQLSmith539735356
--- FAIL: TestRandomSyntaxSQLSmith (300.93s)
Reproduce

To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```

Same failure on other branches

- #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]

Internal log

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

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity commented 2 years ago

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ 941011c4e582807b40dd03bbcbb8d05385c0638d:

Random syntax error:

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

Query:

        SELECT
            (-7498362056899542030):::INT8 AS col_437080,
            (-6885241872954684557):::INT8 AS col_437081,
            '\x07022a18ce24':::BYTES AS col_437082,
            NULL AS col_437083
        FROM
            defaultdb.public.table1@[0] AS tab_178475,
            defaultdb.public.seed@seed__int8__float8__date_idx AS tab_178476
            JOIN defaultdb.public.table1 AS tab_178477
                JOIN defaultdb.public.table1 AS tab_178478 ON
                        (tab_178477.crdb_internal_idx_expr) = (tab_178478.crdb_internal_idx_expr)
                JOIN defaultdb.public.table1 AS tab_178479
                    JOIN defaultdb.public.table1 AS tab_178480 ON
                            (tab_178479.crdb_internal_idx_expr) = (tab_178480.crdb_internal_idx_expr) ON
                        (tab_178478.crdb_internal_idx_expr_1) = (tab_178479.crdb_internal_idx_expr_1)
                JOIN defaultdb.public.table1@table1_col1_0_col1_8_expr_col1_15_col1_5_col1_12_col1_11_key AS tab_178481
                    JOIN defaultdb.public.table1@[0] AS tab_178482
                        JOIN defaultdb.public.table1@table1_col1_16_col1_15_col1_3_col1_7_col1_5_idx AS tab_178483
                            JOIN defaultdb.public.table1@table1_col1_11_col1_15_col1_2_col1_16_col1_13_col1_1_col1_3_col1_7_col1_6_col1_4_col1_8_col1_12_idx
                                    AS tab_178484 ON
                                    (tab_178483.col1_10) = (tab_178484.crdb_internal_idx_expr)
                                    AND (tab_178483.col1_10) = (tab_178484.crdb_internal_idx_expr_2)
                                    AND (tab_178483.crdb_internal_idx_expr_1) = (tab_178484.col1_12)
                                    AND (tab_178483.col1_16) = (tab_178484.crdb_internal_idx_expr_6) ON
                                (tab_178482.col1_0) = (tab_178484.col1_0) ON
                            (tab_178481.crdb_internal_idx_expr_3) = (tab_178484.crdb_internal_idx_expr_7) ON
                        (tab_178478.crdb_internal_idx_expr_1) = (tab_178484.col1_4) ON
                    (tab_178476._int4) = (tab_178481.crdb_internal_idx_expr_1)
                    AND (tab_178476._int8) = (tab_178477.crdb_internal_idx_expr_1)
        ORDER BY
            tab_178481.col1_1 ASC, tab_178482.col1_13 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 REGPROC NOT NULL, col1_1 BIT(11) NOT NULL, col1_2 INT4 NOT NULL, col1_3 INET NULL, col1_4 INT8, col1_5 TIME, col1_6 BIT(44) NOT NULL, col1_7 BIT(6) NOT NULL, col1_8 BYTES NOT NULL, col1_9 STRING NOT NULL AS (lower(CAST(col1_7 AS STRING))) STORED, col1_10 STRING NOT NULL AS (lower(CAST(col1_1 AS STRING))) STORED, col1_11 INT8 AS (col1_4 + col1_2) VIRTUAL, col1_12 INT4 AS (col1_2 + col1_4) STORED, col1_13 STRING NOT NULL AS (lower(CAST(col1_0 AS STRING))) VIRTUAL, col1_14 INT8 AS (col1_4 + (-4245137544016996220):::INT8) VIRTUAL, col1_15 STRING NOT NULL AS (lower(CAST(col1_7 AS STRING))) STORED, col1_16 STRING NOT NULL AS (CASE WHEN col1_8 IS NULL THEN e'``V-{Yd\x115\\':::STRING ELSE e't6\x7fku\x07S\x0f':::STRING END) STORED, UNIQUE (lower(CAST(col1_0 AS STRING)), (col1_2 + col1_4) DESC, col1_14, col1_16, col1_5 DESC, col1_2 ASC, col1_9 DESC, col1_13, col1_0, col1_7, col1_12 ASC, col1_1 ASC, col1_6 DESC, lower(CAST(col1_6 AS STRING)) ASC, col1_10) WHERE (((((((((((table1.col1_9 = e'\'':::STRING) AND (table1.col1_2 = (-32768):::INT8)) OR (table1.col1_15 <= e'\'':::STRING)) OR (table1.col1_11 >= (-32768):::INT8)) OR (table1.col1_14 = 0:::INT8)) AND (table1.col1_4 = (-2147483648):::INT8)) OR (table1.col1_10 > e'\'':::STRING)) OR (table1.col1_5 = '00:00:00':::TIME)) OR (table1.col1_13 != '"':::STRING)) OR (table1.col1_12 != (-1):::INT8)) AND (table1.col1_16 >= e'\x00':::STRING)) OR (table1.col1_8 = '\x22':::BYTES), INDEX (col1_11 ASC, col1_15 DESC, col1_2 DESC, col1_16 ASC, col1_13 ASC, col1_1 ASC, col1_3 ASC, col1_7 ASC, col1_6 DESC, col1_4, col1_8, col1_12 DESC), UNIQUE (col1_12 ASC, col1_3 DESC, col1_2 DESC, col1_9 ASC, col1_4 ASC, col1_1 DESC, (col1_2 + col1_4) ASC, col1_6, col1_10 ASC, (col1_4 + (-8588705632873303837):::INT8)) WHERE ((((((((table1.col1_15 >= '"':::STRING) AND (table1.col1_16 != '':::STRING)) OR (table1.col1_4 < (-1):::INT8)) AND (table1.col1_9 != 'X':::STRING)) OR (table1.col1_8 > '\xe29883':::BYTES)) OR (table1.col1_5 != '00:00:00':::TIME)) AND (table1.col1_10 != '':::STRING)) AND (table1.col1_14 = (-1):::INT8)) OR (table1.col1_2 >= (-32768):::INT8), INDEX (col1_16 DESC, col1_15, col1_3 DESC, col1_7 DESC, col1_5 DESC) STORING (col1_2, col1_8, col1_10) WHERE ((((((((((table1.col1_8 <= '\x27':::BYTES) AND (table1.col1_4 >= (-1):::INT8)) OR (table1.col1_5 != '00:00:00':::TIME)) OR (table1.col1_11 <= (-9223372036854775807):::INT8)) AND (table1.col1_14 = (-32768):::INT8)) AND (table1.col1_10 >= '"':::STRING)) OR (table1.col1_9 > e'\x00':::STRING)) OR (table1.col1_15 = e'\U00002603':::STRING)) AND (table1.col1_13 < '"':::STRING)) OR (table1.col1_2 >= (-1):::INT8)) OR (table1.col1_12 <= 127:::INT8), INDEX (col1_8, col1_16 ASC) WHERE (((((((((((table1.col1_2 <= (-128):::INT8) AND (table1.col1_11 <= 2147483647:::INT8)) OR (table1.col1_16 != e'\x00':::STRING)) AND (table1.col1_14 = (-128):::INT8)) OR (table1.col1_5 != '24:00:00':::TIME)) AND (table1.col1_15 > e'\x00':::STRING)) OR (table1.col1_9 = '':::STRING)) AND (table1.col1_4 = (-128):::INT8)) OR (table1.col1_12 > 1:::INT8)) OR (table1.col1_13 < '"':::STRING)) AND (table1.col1_8 <= '\x58':::BYTES)) OR (table1.col1_10 < e'\x00':::STRING), UNIQUE (col1_2 ASC, col1_12 DESC, col1_15 ASC, col1_13 DESC, lower(CAST(col1_7 AS STRING)), col1_1 ASC, col1_11 ASC, col1_6 DESC, col1_9 DESC, col1_4 ASC, col1_0 ASC, col1_7 DESC, lower(CAST(col1_0 AS STRING)) ASC, col1_14 ASC, col1_10) STORING (col1_8), UNIQUE (col1_0 ASC, col1_8, (col1_2 + (-1502179567):::INT8) ASC, col1_15, col1_5, col1_12 DESC, col1_11 DESC) WHERE (((table1.col1_9 = '"':::STRING) OR (table1.col1_14 > 127:::INT8)) AND (table1.col1_11 >= (-9223372036854775807):::INT8)) OR (table1.col1_12 < (-2147483648):::INT8), FAMILY (col1_9), FAMILY (col1_2, col1_12), FAMILY (col1_5), FAMILY (col1_10), FAMILY (col1_0, col1_16), FAMILY (col1_3), FAMILY (col1_4, col1_8), FAMILY (col1_7, col1_15, col1_6, col1_1));
        ALTER TABLE table1 INJECT STATISTICS e'[{"columns": ["col1_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5724323810966500005, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7841509180079649352}, {"columns": ["col1_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4548500685962530836, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7841509180079649352}, {"columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4283454877375844510, "histo_col_type": "", "name": "__auto__", "null_count": 6334913763094129569, "row_count": 7841509180079649352}, {"columns": ["col1_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 504520443976885996, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7841509180079649352}, {"columns": ["col1_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7388642430716247122, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7841509180079649352}, {"columns": ["col1_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5898222952310483424, "histo_buckets": [{"distinct_range": 0, "num_eq": 8451899763852569513, "num_range": 0, "upper_bound": "\\\\x76"}, {"distinct_range": 2894340676349801000, "num_eq": 1647230151434592956, "num_range": 6265114693252787646, "upper_bound": "\\\\xdbe9"}], "histo_col_type": "BYTES", "name": "__auto__", "null_count": 0, "row_count": 7841509180079649352}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6844580553137908074, "histo_buckets": [{"distinct_range": 0, "num_eq": 300000000, "num_range": 0, "upper_bound": "-1877508942"}, {"distinct_range": 52690.083221154084, "num_eq": 500000000, "num_range": 90000, "upper_bound": "-1207111368"}, {"distinct_range": 0, "num_eq": 30, "num_range": 8249990694551061066, "upper_bound": "440139556"}, {"distinct_range": 10000000, "num_eq": 939176378304240272, "num_range": 10000000, "upper_bound": "458923406"}, {"distinct_range": 0, "num_eq": 3000000, "num_range": 2324576097181168573, "upper_bound": "945423701"}], "histo_col_type": "INT4", "name": "__auto__", "null_count": 0, "row_count": 7841509180079649352}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2421758563880365946, "histo_col_type": "", "name": "__auto__", "null_count": 6383479377715370319, "row_count": 7841509180079649352}, {"columns": ["col1_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3539543394500885105, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7841509180079649352}, {"columns": ["col1_16"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5520531854685944805, "histo_col_type": "STRING", "name": "__auto__", "null_count": 0, "row_count": 7841509180079649352}, {"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7634826798404804705, "histo_buckets": [{"distinct_range": 0, "num_eq": 30, "num_range": 0, "upper_bound": "0"}, {"distinct_range": 1954892580834559200, "num_eq": 1724795573713334922, "num_range": 2480319446030565214, "upper_bound": "866503336"}, {"distinct_range": 2156912769269483800, "num_eq": 3055414211195191537, "num_range": 7905935967599678448, "upper_bound": "1774992867"}, {"distinct_range": 51880015898191680, "num_eq": 4669808396009667231, "num_range": 158736353359481662, "upper_bound": "2977331367"}, {"distinct_range": 5765621732615714000, "num_eq": 8687032373866807825, "num_range": 6090510158748189207, "upper_bound": "3350259272"}, {"distinct_range": 23822782068.88768, "num_eq": 619071233099220714, "num_range": 50000000000, "upper_bound": "3834310418"}, {"distinct_range": 200000000, "num_eq": 80000, "num_range": 200000000, "upper_bound": "4149093902"}], "histo_col_type": "REGPROC", "name": "__auto__", "null_count": 0, "row_count": 7841509180079649352}, {"columns": ["col1_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5850866100729340748, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7841509180079649352}, {"columns": ["col1_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 436607437608909810, "histo_buckets": [{"distinct_range": 0, "num_eq": 20000000000, "num_range": 0, "upper_bound": "-1141905957"}, {"distinct_range": 0, "num_eq": 9064322109544745951, "num_range": 6360445812387309604, "upper_bound": "0"}, {"distinct_range": 0, "num_eq": 2000000, "num_range": 600000000, "upper_bound": "634950348"}, {"distinct_range": 9000000000, "num_eq": 6800208953621638818, "num_range": 9000000000, "upper_bound": "1003303168"}, {"distinct_range": 0, "num_eq": 9000, "num_range": 900, "upper_bound": "1612516181"}, {"distinct_range": 30, "num_eq": 8274311012072797279, "num_range": 30, "upper_bound": "1776563033"}, {"distinct_range": 600000000, "num_eq": 6969593288178839276, "num_range": 600000000, "upper_bound": "2147483647"}], "histo_col_type": "INT4", "name": "__auto__", "null_count": 1175216466131409659, "row_count": 7841509180079649352}, {"columns": ["col1_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 668893892594116840, "histo_col_type": "", "name": "__auto__", "null_count": 735523730463578690, "row_count": 7841509180079649352}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 88243859950759897, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 7841509180079649352}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3212596203537891390, "histo_col_type": "", "name": "__auto__", "null_count": 2150456140316633809, "row_count": 7841509180079649352}, {"columns": ["col1_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2938352568235505081, "histo_buckets": [{"distinct_range": 0, "num_eq": 8599313877320396323, "num_range": 0, "upper_bound": "-8410651652528963470"}, {"distinct_range": 30953969699.036922, "num_eq": 300000000, "num_range": 40000000000, "upper_bound": "-8324869606813387522"}, {"distinct_range": 0, "num_eq": 0, "num_range": 4586837401372171507, "upper_bound": "-696693856718477683"}, {"distinct_range": 2021.4832861629782, "num_eq": 10000000000, "num_range": 6000, "upper_bound": "-15775744658113524"}, {"distinct_range": 2000, "num_eq": 200000, "num_range": 2000, "upper_bound": "-128"}, {"distinct_range": 9000000, "num_eq": 2319738962309429986, "num_range": 9000000, "upper_bound": "2704675308429855118"}, {"distinct_range": 28.61315759423331, "num_eq": 9000000000, "num_range": 80, "upper_bound": "2841017763637763934"}, {"distinct_range": 0, "num_eq": 0, "num_range": 80000, "upper_bound": "5153933330921073168"}], "histo_col_type": "INT8", "name": "__auto__", "null_count": 6753216326233781104, "row_count": 7841509180079649352}]':::JSONB;
        CREATE TYPE rand_typ_0 AS ENUM ('jkcb', 'ylojfp', 'x', 'xuhxhw');
        CREATE TYPE rand_typ_1 AS ENUM ('azx', 'jb', 'k');
        CREATE TYPE rand_typ_2 AS ENUM ('hlvxp', 'iulb');
        ;
    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/logTestRandomSyntaxSQLSmith875380913
--- FAIL: TestRandomSyntaxSQLSmith (300.89s)
Reproduce

To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```

Same failure on other branches

- #70000 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.2] - #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]

Internal log

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

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity commented 2 years ago

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ 6eb9df1f3d460f904b5254c3d32c745eecbedd3f:

Random syntax error:

    rsg_test.go:779: Crash detected: server panic: driver: bad connection

Query:

        SELECT
            tab_302125._float4 AS col_710816,
            tab_302125._interval AS col_710817,
            tab_302126.crdb_internal_idx_expr AS col_710818,
            true AS col_710819,
            '\x852b78':::BYTES AS col_710820,
            'NaN':::DECIMAL AS col_710821,
            tab_302126.col1_1 AS col_710822,
            tab_302127._float4 AS col_710823,
            '237.208.118.190/17':::INET AS col_710824,
            NULL AS col_710825,
            tab_302125._decimal AS col_710826
        FROM
            defaultdb.public.seed@seed__int8__float8__date_idx AS tab_302125
            JOIN defaultdb.public.table1@table1_col1_0_col1_2_col1_3_key AS tab_302126 ON
                    (tab_302125.tableoid) = (tab_302126.col1_2)
            JOIN defaultdb.public.seed@seed__int8__float8__date_idx AS tab_302127 ON (tab_302126.col1_3) = (tab_302127._string),
            defaultdb.public.table1 AS tab_302128
            JOIN defaultdb.public.table1 AS tab_302129 ON (tab_302128.col1_0) = (tab_302129.col1_0)
        WHERE
            tab_302125._bool
        LIMIT
            89:::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 FLOAT8 NOT NULL, col1_1 GEOGRAPHY NOT NULL, col1_2 REGNAMESPACE NULL, col1_3 NAME NULL, col1_4 NAME NOT NULL, UNIQUE (col1_0 ASC, col1_2 DESC, col1_3), INVERTED INDEX (col1_3 ASC, col1_1 DESC) WHERE (table1.col1_0 = 1.7976931348623157e+308:::FLOAT8) AND (table1.col1_4 >= e'\'':::STRING), UNIQUE (col1_3, col1_4 ASC, col1_2 ASC) STORING (col1_0), INVERTED INDEX (col1_2, col1_3 ASC, col1_4, lower(CAST(col1_2 AS STRING)), col1_1 ASC) WHERE (table1.col1_4 != e'\U00002603':::STRING) OR (table1.col1_3 < e'\x00':::STRING), UNIQUE (col1_3 DESC, lower(CAST(col1_1 AS STRING))), FAMILY (col1_3, col1_0), FAMILY (col1_1), FAMILY (col1_4, col1_2));
        ALTER TABLE table1 INJECT STATISTICS e'[{"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 51065, "histo_col_type": "FLOAT8", "name": "__auto__", "null_count": 0, "row_count": 80000}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 26716, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 80000}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2258, "histo_col_type": "REGNAMESPACE", "name": "__auto__", "null_count": 31504, "row_count": 80000}, {"columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 14456, "histo_buckets": [{"distinct_range": 0, "num_eq": 7999641623541720235, "num_range": 0, "upper_bound": "!N"}, {"distinct_range": 700, "num_eq": 100000000, "num_range": 700, "upper_bound": "\\"\\u0014``bj"}, {"distinct_range": 3946.91892543883, "num_eq": 300000000, "num_range": 70000, "upper_bound": "I\\u000e?)"}, {"distinct_range": 200000000, "num_eq": 3997807549589627840, "num_range": 200000000, "upper_bound": "]"}], "histo_col_type": "NAME", "name": "__auto__", "null_count": 63951, "row_count": 80000}, {"columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 28088, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 80000}]':::JSONB;
        CREATE TYPE rand_typ_0 AS ENUM ('hmo', 'idbu');
        CREATE TYPE rand_typ_1 AS ENUM ('nahfep', 'zag', 'lc', 'cr');
        CREATE TYPE rand_typ_2 AS ENUM ('cqtk', 'o', 'qjhst', 'chgq', 'xrfmrh', 'upwgsv');
        ;
    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/logTestRandomSyntaxSQLSmith182541150
--- FAIL: TestRandomSyntaxSQLSmith (300.73s)
Reproduce

To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```

Same failure on other branches

- #70000 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.2] - #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]

Internal log

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

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

cockroach-teamcity commented 2 years ago

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on master @ 394e35cbbb7ae466383c3ee6f2bbcc76857afeed:

Random syntax error:

    rsg_test.go:779: Crash detected: server panic: driver: bad connection

Query:

        SELECT
            tab_315117.col3_13 AS col_715588,
            e'\x0fR\x0fk,}G':::STRING AS col_715589,
            '"foo"':::JSONB AS col_715590,
            e'\x05b\x1e+D#\x10<p':::STRING AS col_715591,
            tab_315116._int4 AS col_715592,
            tab_315118.col3_13 AS col_715593,
            tab_315118.col3_13 AS col_715594,
            tab_315116._uuid AS col_715595
        FROM
            defaultdb.public.seed@seed__int8__float8__date_idx AS tab_315116,
            defaultdb.public.table3 AS tab_315117
            JOIN defaultdb.public.table3 AS tab_315118 ON
                    (tab_315117.col3_2) = (tab_315118.col3_2)
                    AND (tab_315117.col3_12) = (tab_315118.col3_12)
                    AND (tab_315117.col3_11) = (tab_315118.col3_11)
                    AND (tab_315117.col3_6) = (tab_315118.col3_6),
            defaultdb.public.table4 AS tab_315119
            JOIN defaultdb.public.table1 AS tab_315120 ON (tab_315119.col4_1) = (tab_315120.col1_2)
        ORDER BY
            tab_315116._decimal 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 INT4 NULL, col1_1 TIMESTAMPTZ NULL, col1_2 BIT(32), INDEX (col1_2 ASC) WHERE table1.col1_0 <= 2147483647:::INT8, UNIQUE (col1_1 DESC, col1_0 DESC) WHERE (table1.col1_1 < '-4713-11-24 00:00:00+00:00':::TIMESTAMPTZ) OR (table1.col1_0 <= 0:::INT8), INDEX (col1_2 DESC, col1_1 DESC, lower(CAST(col1_2 AS STRING)) ASC) STORING (col1_0) WHERE (table1.col1_0 != 1:::INT8) OR (table1.col1_1 != '-2000-01-01 00:00:00+00:00':::TIMESTAMPTZ), INDEX (col1_0 ASC), INDEX ((CASE WHEN col1_1 IS NULL THEN e'M\x1c95c\r':::STRING ELSE e'Dy5``0)\x05':::STRING END) DESC) STORING (col1_0, col1_1) WHERE table1.col1_1 > '294276-12-31 23:59:59.999999+00:00':::TIMESTAMPTZ, INDEX (col1_0 DESC, col1_1, col1_2 ASC) WHERE table1.col1_1 <= '-4713-11-24 00:00:00+00:00':::TIMESTAMPTZ, INDEX (col1_1, col1_2) WHERE (table1.col1_0 <= (-128):::INT8) OR (table1.col1_1 = '0001-01-01 00:00:00+00:00':::TIMESTAMPTZ), FAMILY (col1_2), FAMILY (col1_1, col1_0));
        CREATE TABLE table2 (col2_0 REGPROCEDURE NOT NULL, col2_1 INT8, col2_2 GEOGRAPHY[] NOT NULL, col2_3 BOOL NULL, col2_4 DECIMAL NULL, col2_5 REGPROCEDURE, col2_6 JSONB, col2_7 INET NOT NULL, col2_8 BIT(35) NULL, col2_9 OID NULL, col2_10 UUID NOT NULL, col2_11 VARCHAR NULL, col2_12 OID NOT NULL, col2_13 INT8 NOT NULL, col2_14 TIME NOT NULL, col2_15 REGCLASS NOT NULL, col2_16 BIT(38) NOT NULL, INDEX (col2_0 ASC, col2_8, col2_16 ASC, col2_10 ASC, col2_9 ASC) STORING (col2_1, col2_2, col2_3, col2_5, col2_11, col2_13), INDEX (lower(CAST(col2_3 AS STRING)) DESC, col2_9 DESC, col2_14, col2_0, col2_10 DESC, col2_4 ASC, col2_7 ASC, col2_1 ASC, (col2_13 + col2_1) ASC, col2_5 ASC, col2_15, col2_11 DESC, col2_3 ASC) STORING (col2_2, col2_8, col2_12, col2_13), UNIQUE (col2_1 ASC, col2_12 ASC, col2_8 DESC, col2_10, col2_14 DESC, col2_5, col2_13 DESC, col2_3 DESC, col2_4) STORING (col2_0, col2_2), INDEX (col2_0, col2_10) STORING (col2_2, col2_3, col2_5, col2_6, col2_7, col2_13, col2_14, col2_15), FAMILY (col2_13), FAMILY (col2_1, col2_7), FAMILY (col2_16), FAMILY (col2_6, col2_8), FAMILY (col2_12), FAMILY (col2_11), FAMILY (col2_10), FAMILY (col2_9), FAMILY (col2_0, col2_4), FAMILY (col2_15), FAMILY (col2_2, col2_5, col2_3, col2_14), UNIQUE (col2_8, col2_0));
        CREATE TABLE table3 (col3_0 STRING NOT NULL, col3_1 BOX2D NULL, col3_2 INET NULL, col3_3 REGCLASS NULL, col3_4 REGPROCEDURE NOT NULL, col3_5 REGCLASS NOT NULL, col3_6 INT4 NOT NULL, col3_7 TIMETZ[] NULL, col3_8 STRING NULL AS (lower(CAST(col3_1 AS STRING))) STORED, col3_9 STRING NULL AS (lower(CAST(col3_3 AS STRING))) VIRTUAL, col3_10 STRING NOT NULL AS (lower(CAST(col3_5 AS STRING))) STORED, col3_11 STRING NOT NULL AS (lower(CAST(col3_4 AS STRING))) STORED, col3_12 STRING NOT NULL AS (lower(CAST(col3_5 AS STRING))) VIRTUAL, col3_13 STRING NULL AS (lower(CAST(col3_3 AS STRING))) STORED, UNIQUE (col3_2, col3_13, col3_3, col3_4 ASC, col3_0, col3_6, col3_11 DESC, col3_12) STORING (col3_5, col3_7, col3_10), UNIQUE ((CASE WHEN col3_7 IS NULL THEN '8n':::STRING ELSE 'A?X':::STRING END), col3_12 ASC, col3_8 ASC, lower(CAST(col3_5 AS STRING)), col3_11 ASC, col3_13 ASC, col3_9 ASC, col3_2 ASC, col3_10 DESC) STORING (col3_0, col3_3, col3_4, col3_5, col3_7));
        CREATE TABLE table4 (col4_0 REGCLASS NOT NULL, col4_1 BIT(40) NOT NULL, PRIMARY KEY (col4_1 DESC, col4_0), INDEX (col4_1 DESC, col4_0), UNIQUE (col4_1, col4_0), INDEX (col4_1), FAMILY (col4_1, col4_0));
        ALTER TABLE table1 INJECT STATISTICS '[{"columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_buckets": [{"distinct_range": 0, "num_eq": 300, "num_range": 0, "upper_bound": "-1810116317"}, {"distinct_range": 0, "num_eq": 20, "num_range": 4142809751120498297, "upper_bound": "-1744462578"}, {"distinct_range": 4.185178570552584, "num_eq": 100000000000, "num_range": 10, "upper_bound": "-503065957"}, {"distinct_range": 0, "num_eq": 20000, "num_range": 20000000000, "upper_bound": "-32768"}, {"distinct_range": 782873433943171000, "num_eq": 900000000, "num_range": 782873433943170962, "upper_bound": "32767"}, {"distinct_range": 0, "num_eq": 40000, "num_range": 80000, "upper_bound": "618271958"}, {"distinct_range": 1473373666855712500, "num_eq": 4563802050195064155, "num_range": 1473373666855712486, "upper_bound": "1443786883"}, {"distinct_range": 50000000, "num_eq": 6000, "num_range": 50000000, "upper_bound": "1862353164"}, {"distinct_range": 6613719089823219000, "num_eq": 7000000000, "num_range": 6613719089823219117, "upper_bound": "2141554862"}], "histo_col_type": "INT4", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_buckets": [{"distinct_range": 0, "num_eq": 3384861676519411677, "num_range": 0, "upper_bound": "1971-02-06 16:05:17.000768+00:00"}, {"distinct_range": 60000000, "num_eq": 6547273407691832412, "num_range": 60000000, "upper_bound": "1979-03-16 22:11:51.00026+00:00"}, {"distinct_range": 6577347088574347000, "num_eq": 0, "num_range": 6577347088574347491, "upper_bound": "2002-04-09 10:16:25.000564+00:00"}, {"distinct_range": 0, "num_eq": 900, "num_range": 6000000, "upper_bound": "2009-03-06 12:35:23.00033+00:00"}, {"distinct_range": 26241040559203668, "num_eq": 3931176050898682226, "num_range": 1575832027783397602, "upper_bound": "2016-06-23 10:14:49.000596+00:00"}], "histo_col_type": "TIMESTAMPTZ", "name": "__auto__", "null_count": 0, "row_count": 0}, {"columns": ["col1_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 0, "histo_buckets": [{"distinct_range": 0, "num_eq": 4565499761410071758, "num_range": 0, "upper_bound": "11010111111010011000001110110100"}], "histo_col_type": "BIT(32)", "name": "__auto__", "null_count": 0, "row_count": 0}]':::JSONB;
        ALTER TABLE table2 INJECT STATISTICS '[{"columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5265979952187437621, "histo_col_type": "", "name": "__auto__", "null_count": 7881575105260796596, "row_count": 9201439325654575173}, {"columns": ["col2_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7398402513253317529, "histo_col_type": "", "name": "__auto__", "null_count": 5557744121443224063, "row_count": 9201439325654575173}, {"columns": ["col2_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 6838114572560965941, "histo_col_type": "", "name": "__auto__", "null_count": 576624154778724525, "row_count": 9201439325654575173}, {"columns": ["col2_15"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 9100611455406365000, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 9201439325654575173}, {"columns": ["col2_16"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3894400791526238889, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 9201439325654575173}, {"columns": ["col2_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 5525573803312385581, "histo_buckets": [{"distinct_range": 0, "num_eq": 6351136216827150558, "num_range": 0, "upper_bound": "-789233485332725862"}, {"distinct_range": 2340984666449492000, "num_eq": 279456505923537097, "num_range": 4927900560790260524, "upper_bound": "-2147483648"}, {"distinct_range": 3000, "num_eq": 586349512560915127, "num_range": 3000, "upper_bound": "-1"}, {"distinct_range": 11.635933662565467, "num_eq": 8000000000, "num_range": 80, "upper_bound": "1399552114638870590"}, {"distinct_range": 5288983913775352000, "num_eq": 5000000000, "num_range": 5288983913775351327, "upper_bound": "3251193078583700077"}, {"distinct_range": 6450693187.109926, "num_eq": 7441648773866748128, "num_range": 40000000000, "upper_bound": "6384253644007137515"}, {"distinct_range": 18967456294309684, "num_eq": 70000, "num_range": 6224483488534982371, "upper_bound": "9223372036854775807"}], "histo_col_type": "INT8", "name": "__auto__", "null_count": 5722523401928417112, "row_count": 9201439325654575173}, {"columns": ["col2_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 8537084964462858121, "histo_col_type": "", "name": "__auto__", "null_count": 8176177645905531118, "row_count": 9201439325654575173}, {"columns": ["col2_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 8502302070165097571, "histo_col_type": "", "name": "__auto__", "null_count": 5674081940514878755, "row_count": 9201439325654575173}, {"columns": ["col2_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4773244228494770466, "histo_col_type": "", "name": "__auto__", "null_count": 2108511970689899520, "row_count": 9201439325654575173}, {"columns": ["col2_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7009192582103455554, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 9201439325654575173}, {"columns": ["col2_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2253239402938821519, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 9201439325654575173}, {"columns": ["col2_14"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 496898569166802689, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 9201439325654575173}, {"columns": ["col2_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3703217349368381738, "histo_buckets": [{"distinct_range": 0, "num_eq": 56255368541963666, "num_range": 0, "upper_bound": "2907935256"}, {"distinct_range": 52213.15664429223, "num_eq": 7736700010829390257, "num_range": 90000, "upper_bound": "3226784597"}, {"distinct_range": 0, "num_eq": 100000000, "num_range": 8748555665914471666, "upper_bound": "3333246937"}, {"distinct_range": 69668128825246216, "num_eq": 2590898074683343097, "num_range": 4624969634926650086, "upper_bound": "3462585649"}, {"distinct_range": 6640055841489081000, "num_eq": 1162737123067366539, "num_range": 6640055841489080942, "upper_bound": "4142385145"}], "histo_col_type": "REGPROCEDURE", "name": "__auto__", "null_count": 0, "row_count": 9201439325654575173}, {"columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 7590747856362501354, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 9201439325654575173}, {"columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2263703735412747467, "histo_col_type": "", "name": "__auto__", "null_count": 6348075197758429756, "row_count": 9201439325654575173}, {"columns": ["col2_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 8569795431794199925, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 9201439325654575173}, {"columns": ["col2_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 290556249726522195, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 9201439325654575173}]':::JSONB;
        ALTER TABLE table3 INJECT STATISTICS '[{"columns": ["col3_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1745190582304436720, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4506587434622246589}, {"columns": ["col3_11"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3679594425940878486, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4506587434622246589}, {"columns": ["col3_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2455783625981183846, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4506587434622246589}, {"columns": ["col3_7"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2981454191124596959, "histo_col_type": "", "name": "__auto__", "null_count": 620961449521919485, "row_count": 4506587434622246589}, {"columns": ["col3_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 295938763393455492, "histo_buckets": [{"distinct_range": 0, "num_eq": 30000000000, "num_range": 0, "upper_bound": "30.39.117.43/14"}, {"distinct_range": 3911345622765887000, "num_eq": 70000000, "num_range": 3947081646269337559, "upper_bound": "206.236.148.199/24"}, {"distinct_range": 5186884445023170000, "num_eq": 80000000000, "num_range": 5186884445023169560, "upper_bound": "182.222.202.139"}, {"distinct_range": 2222611736980379400, "num_eq": 9000, "num_range": 3772548687142126075, "upper_bound": "1f24:2860:d330:9363:4a28:317f:8756:2f26/35"}, {"distinct_range": 0, "num_eq": 5000000, "num_range": 40000, "upper_bound": "5bf0:1582:caeb:32b5:1575:fe9f:c285:2ce6/80"}], "histo_col_type": "INET", "name": "__auto__", "null_count": 1344854862354538330, "row_count": 4506587434622246589}, {"columns": ["col3_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4134152366492350591, "histo_col_type": "", "name": "__auto__", "null_count": 1477721924416077908, "row_count": 4506587434622246589}, {"columns": ["col3_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3749485220255364023, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4506587434622246589}, {"columns": ["col3_6"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 193329035100008911, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4506587434622246589}, {"columns": ["col3_8"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 3553052443410627427, "histo_col_type": "", "name": "__auto__", "null_count": 329241148292700656, "row_count": 4506587434622246589}, {"columns": ["col3_9"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2609784235931997006, "histo_col_type": "", "name": "__auto__", "null_count": 3364685506899111809, "row_count": 4506587434622246589}, {"columns": ["col3_13"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1321450218477601616, "histo_col_type": "", "name": "__auto__", "null_count": 3090390993642635893, "row_count": 4506587434622246589}, {"columns": ["col3_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2083290923494668809, "histo_col_type": "", "name": "__auto__", "null_count": 447865756093203480, "row_count": 4506587434622246589}, {"columns": ["col3_10"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 2216609497427709146, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4506587434622246589}, {"columns": ["col3_12"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4333439450950242056, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 4506587434622246589}]':::JSONB;
        ALTER TABLE table4 INJECT STATISTICS '[{"columns": ["col4_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 29850873856, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 90000000000}, {"columns": ["col4_1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 39289871153, "histo_buckets": [{"distinct_range": 0, "num_eq": 100000, "num_range": 0, "upper_bound": "0110011010100011111100110100101111010000"}], "histo_col_type": "BIT(40)", "name": "__auto__", "null_count": 0, "row_count": 90000000000}]':::JSONB;
        ALTER TABLE table4 ADD FOREIGN KEY (col4_1, col4_0) REFERENCES table2 (col2_8, col2_0) ON UPDATE CASCADE;
        CREATE TYPE rand_typ_0 AS ENUM ('g', 'juftp', 'ylt', 'jsee', 'ydgn');
        CREATE TYPE rand_typ_1 AS ENUM ('wxfo', 'opg');
        ;
    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/logTestRandomSyntaxSQLSmith315488316
--- FAIL: TestRandomSyntaxSQLSmith (381.54s)
Reproduce

To reproduce, try: ```bash make stressrace TESTS=TestRandomSyntaxSQLSmith PKG=./pkg/sql/tests TESTTIMEOUT=5m STRESSFLAGS='-timeout 5m' 2>&1 ```

Same failure on other branches

- #70000 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.2] - #64592 sql/tests: TestRandomSyntaxSQLSmith failed [C-test-failure O-robot branch-release-21.1]

Internal log

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

/cc @cockroachdb/sql-experience rafiss

This test on roachdash | Improve this report!

rafiss commented 2 years ago

Some of the errors seem the same as https://github.com/cockroachdb/cockroach/issues/70000

However, the most recent failure is:

E210913 05:50:04.855736 7177772 1@util/log/logcrash/crash_reporting.go:140  [n1,client=127.0.0.1:52240,hostssl,user=root] 205  a panic has occurred!
E210913 05:50:04.855736 7177772 1@util/log/logcrash/crash_reporting.go:140  [n1,client=127.0.0.1:52240,hostssl,user=root] 205 +runtime error: invalid memory address or nil pointer dereference
E210913 05:50:04.855736 7177772 1@util/log/logcrash/crash_reporting.go:140  [n1,client=127.0.0.1:52240,hostssl,user=root] 205 +(1) attached stack trace
E210913 05:50:04.855736 7177772 1@util/log/logcrash/crash_reporting.go:140  [n1,client=127.0.0.1:52240,hostssl,user=root] 205 +  -- stack trace:
E210913 05:50:04.855736 7177772 1@util/log/logcrash/crash_reporting.go:140  [n1,client=127.0.0.1:52240,hostssl,user=root] 205 +  | github.com/cockroachdb/cockroach/pkg/sql.(*Server).ServeConn.func1
E210913 05:50:04.855736 7177772 1@util/log/logcrash/crash_reporting.go:140  [n1,client=127.0.0.1:52240,hostssl,user=root] 205 +  |  /go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:668
E210913 05:50:04.855736 7177772 1@util/log/logcrash/crash_reporting.go:140  [n1,client=127.0.0.1:52240,hostssl,user=root] 205 +  | [...repeated from below...]
E210913 05:50:04.855736 7177772 1@util/log/logcrash/crash_reporting.go:140  [n1,client=127.0.0.1:52240,hostssl,user=root] 205 +Wraps: (2) while executing: SELECT _._ AS _, '_':::STRING AS _, '_':::JSONB AS _, '_':::STRING AS _, _._ AS _, _._ AS _, _._ AS _, _._ AS _ FROM _@_ AS _, _ AS _ JOIN _ AS _ ON ((((_._) = (_._)) AND ((_._) = (_._))) AND ((_._) = (_._))) AND ((_._) = (_._)), _ AS _ JOIN _ AS _ ON (_._) = (_._) ORDER BY _._ ASC
E210913 05:50:04.855736 7177772 1@util/log/logcrash/crash_reporting.go:140  [n1,client=127.0.0.1:52240,hostssl,user=root] 205 +Wraps: (3) attached stack trace
E210913 05:50:04.855736 7177772 1@util/log/logcrash/crash_reporting.go:140  [n1,client=127.0.0.1:52240,hostssl,user=root] 205 +  -- stack trace:
E210913 05:50:04.855736 7177772 1@util/log/logcrash/crash_reporting.go:140  [n1,client=127.0.0.1:52240,hostssl,user=root] 205 +  | github.com/cockroachdb/cockroach/pkg/sql.(*Server).ServeConn.func1
E210913 05:50:04.855736 7177772 1@util/log/logcrash/crash_reporting.go:140  [n1,client=127.0.0.1:52240,hostssl,user=root] 205 +  |  /go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:668
E210913 05:50:04.855736 7177772 1@util/log/logcrash/crash_reporting.go:140  [n1,client=127.0.0.1:52240,hostssl,user=root] 205 +  | runtime.gopanic
E210913 05:50:04.855736 7177772 1@util/log/logcrash/crash_reporting.go:140  [n1,client=127.0.0.1:52240,hostssl,user=root] 205 +  |  /usr/local/go/src/runtime/panic.go:965
E210913 05:50:04.855736 7177772 1@util/log/logcrash/crash_reporting.go:140  [n1,client=127.0.0.1:52240,hostssl,user=root] 205 +  | runtime.panicmem
E210913 05:50:04.855736 7177772 1@util/log/logcrash/crash_reporting.go:140  [n1,client=127.0.0.1:52240,hostssl,user=root] 205 +  |  /usr/local/go/src/runtime/panic.go:212
E210913 05:50:04.855736 7177772 1@util/log/logcrash/crash_reporting.go:140  [n1,client=127.0.0.1:52240,hostssl,user=root] 205 +  | runtime.sigpanic
E210913 05:50:04.855736 7177772 1@util/log/logcrash/crash_reporting.go:140  [n1,client=127.0.0.1:52240,hostssl,user=root] 205 +  |  /usr/local/go/src/runtime/signal_unix.go:734
E210913 05:50:04.855736 7177772 1@util/log/logcrash/crash_reporting.go:140  [n1,client=127.0.0.1:52240,hostssl,user=root] 205 +  | github.com/cockroachdb/cockroach/pkg/util/tracing.SpanFromContext
E210913 05:50:04.855736 7177772 1@util/log/logcrash/crash_reporting.go:140  [n1,client=127.0.0.1:52240,hostssl,user=root] 205 +  |  /go/src/github.com/cockroachdb/cockroach/pkg/util/tracing/context.go:25
E210913 05:50:04.855736 7177772 1@util/log/logcrash/crash_reporting.go:140  [n1,client=127.0.0.1:52240,hostssl,user=root] 205 +  | github.com/cockroachdb/cockroach/pkg/sql/execinfra.GetTraceData
E210913 05:50:04.855736 7177772 1@util/log/logcrash/crash_reporting.go:140  [n1,client=127.0.0.1:52240,hostssl,user=root] 205 +  |  /go/src/github.com/cockroachdb/cockroach/pkg/sql/execinfra/base.go:254
E210913 05:50:04.855736 7177772 1@util/log/logcrash/crash_reporting.go:140  [n1,client=127.0.0.1:52240,hostssl,user=root] 205 +  | github.com/cockroachdb/cockroach/pkg/sql/execinfra.GetScanStats
E210913 05:50:04.855736 7177772 1@util/log/logcrash/crash_reporting.go:140  [n1,client=127.0.0.1:52240,hostssl,user=root] 205 +  |  /go/src/github.com/cockroachdb/cockroach/pkg/sql/execinfra/stats.go:85
E210913 05:50:04.855736 7177772 1@util/log/logcrash/crash_reporting.go:140  [n1,client=127.0.0.1:52240,hostssl,user=root] 205 +  | github.com/cockroachdb/cockroach/pkg/sql/rowexec.(*joinReader).close
E210913 05:50:04.855736 7177772 1@util/log/logcrash/crash_reporting.go:140  [n1,client=127.0.0.1:52240,hostssl,user=root] 205 +  |  /go/src/github.com/cockroachdb/cockroach/pkg/sql/rowexec/joinreader.go:889
E210913 05:50:04.855736 7177772 1@util/log/logcrash/crash_reporting.go:140  [n1,client=127.0.0.1:52240,hostssl,user=root] 205 +  | github.com/cockroachdb/cockroach/pkg/sql/rowexec.(*joinReader).ConsumerClosed
E210913 05:50:04.855736 7177772 1@util/log/logcrash/crash_reporting.go:140  [n1,client=127.0.0.1:52240,hostssl,user=root] 205 +  |  /go/src/github.com/cockroachdb/cockroach/pkg/sql/rowexec/joinreader.go:882

the offending line is https://github.com/cockroachdb/cockroach/blob/49b2f02bbd3b37cebeca69d3e13933275b5d6e82/pkg/util/tracing/context.go#L25

so i'm tagging this as a separate blocker than https://github.com/cockroachdb/cockroach/issues/70000

yuzefovich commented 2 years ago

The most recent failure has been addressed in #70210, so it is the same as #70000.