cockroachdb / cockroach

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

internal/sqlsmith: TestGenerateParse failed #101280

Closed cockroach-teamcity closed 1 year ago

cockroach-teamcity commented 1 year ago

internal/sqlsmith.TestGenerateParse failed with artifacts on master @ 582880ae2bb5d08e83a9871735deeeb3ed892e7d:

    "\gwith44" (😻col236) AS (SELECT * FROM (VALUES (regproc(NULL::INT8)::REGPROC)) AS tab92 (😻col236))
SELECT
    1574396241:::OID AS "col%p237"
FROM
    "\gwith44" AS "cte_""ref15"
WHERE
    NULL
ORDER BY
    "cte_""ref15".😻col236 NULLS FIRST, "cte_""ref15".😻col236 DESC NULLS FIRST, "cte_""ref15".😻col236 DESC
LIMIT
    65:::INT8;

STMT: 30
SELECT
    tab93._bool AS "c
ol238"
FROM
    defaultdb.public.seed_mr_table@[0] AS tab93
WHERE
    NULL
ORDER BY
    tab93._string DESC NULLS LAST;

STMT: 31
SELECT
    tab94._int4 AS "%88col239", 61471732:::INT8 AS "�c\\u5245ol%3d240", tab94._decimal AS col241
FROM
    defaultdb.public.seed_mr_table@[0] AS tab94, defaultdb.public.seed_mr_table@[0] AS tab95;

    sqlsmith_test.go:201: CREATE FUNCTION func3()
            RETURNS RECORD
            CALLED ON NULL INPUT
            LANGUAGE SQL
            AS $$SELECT power(tab101._decimal::DECIMAL, tab101._decimal::DECIMAL)::DECIMAL AS col243, tab100._bool AS "c %59ol244", 5.0382319560996946E+32:::DECIMAL AS "c%vol245", tab101.crdb_internal_mvcc_timestamp AS col246, NULL AS col247, '1972-03-26':::DATE AS " col248", (WITH "wiTh46" (col250) AS (SELECT * FROM (VALUES (1176885911:::OID), (regtype(((-5828838507998994588):::INT8::INT8 % st_linecrossingdirection('01020000C0090000001AAAB54D3216EBC140D1481273E5BDC158565BFBA78AFFC112D91655C79902426E1734AA92FDE7C1DE930839BC68EDC1B0A3B2CBD2B6DF416825F4B1995AD6C1FE66AA5CEDABE3C1B1E890EF4A2402C2EB8F904A9B7FF6C1A4D3AB819A78EA4170A10DF18222D541462046AA3214F5C17619E7E6EE41014240AA3A569464F241FC56B24761D0EC41000411B8DDF9C2C100862DC6D52D73C13CF49D306EDCFF4184C1619C125DE441481D8790AF3ED24194D5E0E11566FD4108B8974D32F8F7C1C07A076B870BFD419CBB02A0D368F841E4640156A49C0142E025A2444A93D941B885D4194C76D241568D6793FB83F9411204824E81F90142616DC7850920F6C1F423C7546CEDDAC1CE6D7666CDD8F24150D5DC6DED79C3414353DE0202CAF4C1':::GEOMETRY::GEOMETRY, '01020000C003000000BADDAACC530DF841F4465CA98D50F1C1D9BF565519E7FAC1C2FD42A3A25FE9C1DCBB2490DD980142DAA3EAA34836E4C1D4C6E9B48AE3FE41805A714F6BE4C2C1BB256B11C77CF5C180F594C9DF46FC41009CD9E8F592F24134070F2FE0F501C2':::GEOMETRY::GEOMETRY)::INT8::INT8)::INT8::INT8)::REGTYPE), (2604843165:::OID), ((SELECT 960921165:::OID AS col249 FROM defaultdb.public.seed_mr_table@[0] AS tab102 WHERE tab102._bool ORDER BY tab102.crdb_internal_mvcc_timestamp ASC NULLS LAST, tab102._timestamp ASC LIMIT 1:::INT8)), (980235108:::OID), (1554474182:::OID)) AS tab103 (col250)), "w)i😑th50" (col257) AS (SELECT * FROM (VALUES ('\xd5f97e6f':::BYTES), ('\xc54cb117':::BYTES), ((WITH with47 ("co}%vl251", "coL252", "c
o%ql253") AS (SELECT * FROM (VALUES ('15:16:34.419889+03:41':::TIMETZ, st_expand('BOX(-0.858790412667238 -0.3953471191566915,0.5689493592555418 1.8255514476954002)':::BOX2D::BOX2D, (-0.2285961053854043):::FLOAT8::FLOAT8, float8(0.8204863354332964:::FLOAT8::FLOAT8)::FLOAT8::FLOAT8)::BOX2D, 7497471848615372935:::INT8), ('24:00:00-15:59':::TIMETZ, 'BOX(-1.410924171781347 0.06309078597652351,0.1436723066187548 0.5776198953138051)':::BOX2D, (-1796153746673746112):::INT8)) AS "tab%v104" ("co}%vl251", "coL252", "c
o%ql253")), with48 ("c{ol254") AS (SELECT * FROM (VALUES ((NULL::TIMETZ + '4 years 8 mons 298 days 20:57:55.774531':::INTERVAL::INTERVAL)::TIMETZ), ('13:31:15.953453-10:54':::TIMETZ), ('00:00:00+15:59':::TIMETZ), ('00:29:15.657195-13:50':::TIMETZ)) AS tab105 ("c{ol254")), with49 (col255) AS (SELECT * FROM (VALUES (false), (true), (true)) AS tab106 (col255)) SELECT "taB107"._bytes AS "c    ol256" FROM defaultdb.public.seed_mr_table@[0] AS "taB107" WHERE "taB107"._bool LIMIT 1:::INT8)), ('\xd7':::BYTES)) AS tab108 (col257)), "witH51" (col258) AS (SELECT * FROM (VALUES (NULL), (ARRAY[1169942140:::OID,4015978590:::OID])) AS tab109 (col258)) SELECT tab100._interval AS col259 FROM "witH51" AS "cte _re\\x5bf16" WHERE true ORDER BY "cte _re\\x5bf16".col258 NULLS LAST, "cte _re\\x5bf16".col258 DESC, "cte _re\\x5bf16".col258, "cte _re\\x5bf16".col258 ASC NULLS LAST, "cte _re\\x5bf16".col258 DESC NULLS FIRST LIMIT 1:::INT8) AS "c\\uB625ol260", 1262561259:::INT8 AS "c%qol261", tab101._timestamptz AS "c�ol262" FROM defaultdb.public.seed_mr_table@[0] AS tab100, defaultdb.public.seed_mr_table@[0] AS tab101 WHERE NULL ORDER BY tab100._timestamptz ASC NULLS LAST, tab101._timestamptz DESC NULLS LAST LIMIT 9:::INT8
        SELECT tab110._float8 AS "co
l263", '294276-12-31 23:59:59.999999+00':::TIMESTAMPTZ AS col264, tab110._decimal AS col265, tab110._uuid AS col266, 2671:::INT8 AS "co\rl267" FROM defaultdb.public.seed_mr_table@[0] AS tab110
        WITH with52 ("""co{%07l268") AS (SELECT * FROM (VALUES ('z4L':::STRING:::NAME), ('"':::STRING:::NAME), ('~^$$ydKd':::STRING:::NAME)) AS ta😑b111 ("""co{%07l268") EXCEPT ALL SELECT * FROM (VALUES ('0WY':::STRING:::NAME), (e'[3$\x16\x1fH':::STRING:::NAME), (e'dP\x03':::STRING:::NAME)) AS "ta\\U0004BBE1b112" (c😝ol269) UNION ALL SELECT * FROM (VALUES ('pHB':::STRING:::NAME), (name('1971-06-05':::DATE::DATE)::NAME)) AS t̎ab113 ("coL270")), with53 ("coL271") AS (SELECT * FROM (VALUES (3507011951:::OID), (3759968421:::OID), (regrole(2605314638:::OID::OID)::REGROLE)) AS tab114 ("coL271") EXCEPT ALL SELECT * FROM (VALUES (3550715981:::OID), (3327027688:::OID), (regrole(3198704741:::OID::OID)::REGROLE)) AS "/tab115" (col272)) SELECT 7958034200954791108:::INT8 AS col273, 26568:::INT8 AS col274 FROM defaultdb.public.seed_mr_table@[0] AS tab116 LIMIT 80:::INT8
        WITH with57 (col275, col276, "col*277") AS (SELECT B'01100011001111011000010101' AS col275, NULL AS col276, NULL AS "col*277" FROM defaultdb.public.seed_mr_table@[0] AS tab117 INTERSECT ALL SELECT * FROM (VALUES ((SELECT B'01100100101010010111011000' AS col278 FROM defaultdb.public.seed_mr_table@[0] AS t̽ab118 GROUP BY t̽ab118._timestamptz, t̽ab118._uuid, t̽ab118._int4, t̽ab118._decimal HAVING bool_or(t̽ab118._bool::BOOL)::BOOL LIMIT 1:::INT8), '1990-08-12':::DATE, '':::STRING), ((WITH with54 (col279, col280) AS (SELECT * FROM (VALUES ('\x':::BYTES, '''vOVSnsDkN''':::TSVECTOR), ('\xbf4e591ef6ec':::BYTES, '''Gv'' ''Jlvt'' ''coXE'':64C,153A,996B ''d'' ''hFUCx'' ''lqtVQ'' ''mxZDbW'' ''uoa'':605A':::TSVECTOR), (NULL, '''DWOheoRTl'':269C,568B ''JIw'' ''sNwrdUZqLz'':32C,506B,810C,866A':::TSVECTOR), ('\x425820':::BYTES, NULL), ('\xc0439d3f9d7d6537':::BYTES, '''CrtJvrZj'' ''MTuhamwMV'':47A,532B,541A ''PiIiOIw'':377B,640C,993C ''Tc'' ''UbsVhl'' ''jrTL''':::TSVECTOR), ('\x198db2041925':::BYTES, '''GuwX'':249B,266C,828C ''Rsg'':165A,305A,755C ''d'' ''jEJuaNdQ''':::TSVECTOR)) AS "taB119" (col279, col280)), "w
        ith55" ("cOl281") AS (SELECT * FROM (VALUES ('1998-04-01 15:18:11.000783':::TIMESTAMP), ('2018-01-05 22:47:01.000145':::TIMESTAMP)) AS tab120 ("cOl281")), with56 (col282) AS (SELECT * FROM (VALUES ('1989-08-02 11:32:33.000866':::TIMESTAMP)) AS "tA😞b 121" (col282)) SELECT B'10110011000100011100011101' AS col283 FROM "w
        ith55" AS "cte\\xb1_ref17", with56 AS "cte\r_ref18" ORDER BY "cte\\xb1_ref17"."cOl281", "cte\r_ref18".col282 NULLS FIRST, "cte\r_ref18".col282 NULLS LAST, "cte\\xb1_ref17"."cOl281" DESC NULLS FIRST, "cte\r_ref18".col282 NULLS LAST LIMIT 1:::INT8), now():::DATE::DATE, e'b5k\x03\x7fVi':::STRING), (NULL, '-infinity':::DATE, 'K':::STRING), (NULL, '1986-02-04':::DATE, 'Q':::STRING), (B'11110010111101000000110110', '1988-06-10':::DATE, NULL)) AS " tab122" (😿col͞284, col285, "coL286")) SELECT "%vtab123"._int2 AS "co!l 289", (-3302903376943423228):::INT8 AS "c%98ol̙290", "%vtab123"._interval AS "|col291", '1996-12-10':::DATE AS "c""ol""292", '_':::STRING AS " col�293", e'/w\x15.Xh.af':::STRING AS "c}ol294", "%vtab123"._timestamptz AS "😨col%295", NULL AS col296, '1988-06-28':::DATE AS col297, '6f014b57-3c1a-49ff-aa8c-994267cdf56a':::UUID AS col298, cte_ref19.col275 AS col299, (-6.209272892610859295E+32):::DECIMAL AS col300, "%vtab123"._bool AS co😉l301, "%vtab123"._bytes AS "col.😬302", "%vtab123".crdb_internal_mvcc_timestamp AS col303, "%vtab123"._float8 AS col304, "%vtab123"._int2 AS "col 305", 110883164:::OID AS "coL306" FROM with57 AS cte_ref19, defaultdb.public.seed_mr_table@[0] AS "%vtab123" WHERE EXISTS (SELECT '50a6f42d-c4a1-40d5-9cbb-374cd1349bf5':::UUID AS "c\\x03�ol287", '04:07:37.934848+08:18':::TIMETZ AS "c�ol\\xba288" FROM defaultdb.public.seed_mr_table@[0] AS "Tab'124" FULL JOIN defaultdb.public.seed_mr_table@[0] AS "t'ab125" ON "Tab'124"._bool LIMIT 19:::INT8) LIMIT 82:::INT8
        SELECT "t'ab126"._float8 AS "cOl307", 3684148101:::OID AS " col308", '81c6eb15-209f-4711-90ff-3b6e07b8e477':::UUID AS col̵309, NULL AS col310, "t'ab126"._bool AS "coL311", (-1.8150737184105719):::FLOAT8 AS col312, tab̧128._string AS "co""l313", tab̧128._date AS "col\\U00092166314", NULL AS "co\\U0006EF98l315" FROM defaultdb.public.seed_mr_table@[0] AS "t'ab126", defaultdb.public.seed_mr_table@[0] AS "/ta%vb
        127" CROSS JOIN defaultdb.public.seed_mr_table@[0] AS tab̧128 ORDER BY "/ta%vb
        127"._uuid NULLS FIRST
        WITH wit😅h62 (col325) AS (SELECT * FROM (VALUES (B'1110011100110000010'), (CASE WHEN COALESCE(false, false) THEN NULL ELSE NULL END), (B'0010010110111001100'), (B'0101111010111011000'), (B'0011001101000101101'), ((WITH "w̸ iTh61" (col316) AS (SELECT * FROM (VALUES (st_geographyfromtext('=gY_':::STRING::STRING)::GEOGRAPHY), ('0101000060E610000050A693B618FA3C40F4EB3E0DFC8B4140F2F31A55266D02C2':::GEOGRAPHY), ('0104000060E6100000030000000101000040898EE964315761C0148D942AD4523A40F07D51D49C7EFE410101000040A765FA6338145FC05421D543EB974AC006374A196114FAC101010000408C56FD54D9FD5140E04662F4923B53C01027223FFB53D6C1':::GEOGRAPHY), ('01030000E0E6100000010000000600000060233AB3A8ED26C070EE1B63F1001BC077178981466601C2F4456DEA8AEFF741B87390B7361B5A40D498F554350340407043FC25EEC3C141801DA584FBC2924118278419321C6040AEF7E68BF630424077E379935EFD00C280EDD4105180AD418EDFC9AB63C74FC0CC8B5A22CBAE5040BC43E2F0F6B6FB4182922A4EE0F4F74158565B9E974438C034EC1623E8DA46404C68652167B7EBC1D4A16BA629C4EA4160233AB3A8ED26C070EE1B63F1001BC077178981466601C2F4456DEA8AEFF741':::GEOGRAPHY), (CASE WHEN NULL THEN '01030000E0E6100000010000000A000000C88850B5282864C0E6704F60584B50C020A445EA6A86CBC1203C023BEC5FD6410025E8B784C85EC0701D7CB8C30C4EC0607F3858356DB1C11A05DA3E268F0142EC5A9DA91F5A4FC09C1BBEA8953154C06F6180E4940502C2FE5624497C90FDC1A096FD32707631404B5A0966937C53C08EF4891E9B9CE4C1C6398BD2E010E8C1E0FC638CB8633C4000CBE90BAEDB09C02E28A8D30833F1C1E80DC7EA02EEFAC168CD663AF1693B40F439241CFFD032408C502BEDE2AEF941E43D9B4C494AE2414DC9EE35793151C0F4BA720C05C54740C017766C5A4FE5417001E4B0BBBFE2C1550D431B044B5DC0A0DD3AE183C4304090979B134BAFFDC158507F6B9A10FF411CBD3EF8C7AA62C0B641457DDD9040408019EA5110B7E74194DD1B96EA53FBC1C88850B5282864C0E6704F60584B50C020A445EA6A86CBC1203C023BEC5FD641':::GEOGRAPHY ELSE NULL END), ('0105000060E6100000080000000102000040050000007030AB32EB0F3CC000B710F06B2805C070E0B5A48AE5F6C1C07E8B9AC5DF1EC05A5A74D1B0323BC02C88B325A494DCC1F8B5DB0264A16340704F150F0D8E504094BD2A18B769F9C14A3B6685B0E764406C3CB39A07C25140A801E3BDB56E0142EAE24E04094E56C0D0177CBE23635240088A54000D0CDD410102000040030000001C81A159397C6240F8AB5EFBAA0426405000FA49E216FC417C402C9D992F624074065402C7444D409FA24EC68DDBF3C100D15F67D73DE0BFD85FEA9ECF76564050D0E22B9E08EF41010200004003000000102BC28172A14C404CFE6BB4A47C53C0209B3B2D6AAFCFC110D7760835A62040FAA78A105A284240EE711AF40B13F341980BD864679D62C044F509F3B3CE3940C85DCC1AF3A1D0C1010200004005000000A42CE97A097F53C0C7D52BF268C242C0105D58D037ABD3C1ED808D62463757C053AFC94D82C848C044C9730A1525E3413666E6DC351F61C017DE1CB6CA6D53C0B4C4A861FA1CD6C14BD638DE866152C06B0058F8475055C060C25F9B3263FB41903551018D823F4090C798B168D720C0D084AA95FB60CB41010200004005000000D03E975E518827C0776A9588576F48C03082E377B568CFC10A70F3BC299B5040A46631A8C00852C02208577B905CF3412A57A1ABB6E664402766F2994C4C50C0F6D0E88EAACCF041048AA49E9BAA5440DC4F753B5F1250401AFF4A4EB8D20142466BBAC16AC75FC0A84125A3E1C44E408ACE73E748D8F741010200004004000000423E58F2A3EE60C08ADDE31AB0284BC0E976760601C501C22C1A2233498751C010E2BDAFA6794EC09CE38870C58BD5C1D839634A3C1A43403AC13FF8892C56C02CBE1647442FFF4170822A7E5C105B40308745C3AC9D1E40DCB69A1045160142010200004002000000CCF6721CFC375040485E2EABFAFD514053968B130F88F0C1043FF63982A741404CB58144F6BF4440445786CFE0EFEE41010200004002000000A3E9FA9F3A6063C0A2E8FF2F334753403008ECC7EFA0CDC18E66F7E9E15064C024088EEC5DC9474000AAE85875B18441':::GEOGRAPHY)) AS "|tab129" (col316) EXCEPT ALL SELECT * FROM (VALUES ('0106000020E610000000000000':::GEOGRAPHY), ('01040000E0E61000000400000001010000C0005124AA77B4E6BF4890383224EC48405CC95B18E4D901C2705DCCD3AB82C3C101010000C0206337C44B9657C0FCA7BBBDD5564A40F0D683CC3C2FE04138309EF56774FDC101010000C0B8BB9CB186CC60C012F70E7F8FB75240BAB1B0030F47E7C1A056BC059E82E2C101010000C0901281CF67EF23C0DC017B210688344096AE358EE742F141A475F2959C0EE141':::GEOGRAPHY), ('01020000A0E610000002000000A0138E123DBA37C0809E3A9FCA55F1BF30A704F3491DCDC1CA0EDE8767B755C03E83F30184C45140A68409E6630DF7C1':::GEOGRAPHY), ((WITH with58 ("cOl317", "c%vol318") AS (SELECT * FROM (VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff':::UUID, NULL), ('fbe59631-76a7-4c33-8b42-df9ec5987e06':::UUID, '0104000020E61000000600000001010000007ECF6FE2722363C058B4A287FBAD2BC0010100000078D481711F86594041C59FB84B7B4AC00101000000DB4E4A9EDD8C61C02A06FC537FD640C00101000000589D770C77C25440F83F463A430D36400101000000C8D60B6065A83A40C0198D09238342C001010000009C9A432C4A4D4E40F06EE17B11653440':::GEOGRAPHY), (gen_random_ulid()::UUID, '0105000020E61000000300000001020000000300000036751EC21A9B624010F5FA6F63404AC0B4E513AE2BDC46408CDA85CFDF6C3540827706BFA8DC65C0ACB9956E2A1256400102000000020000006490CF5A04895E4014A19A10B8F13AC0CC250C75FBB25E4040297DF834AF53400102000000020000004A1EB586FF5963400FE650ECBE064BC0ACA5821082A962C0F2278DE2D8FA5240':::GEOGRAPHY)) AS tab130 ("cOl317", "c%vol318")), with59 (col319) AS (SELECT '0105000060E6100000030000000102000040050000008028D53CBC392BC06F0551934BCA46C08E4A823DF90FF7C1408627D95D0C1540750E5BCCA5934BC02C6F6BC92763DBC13C1073E82A886040F574D1F8F72956C0C81C36FE7B6AD941E0F81318FA765B40E0827BC780990E4028357B68C482D1C18BC534E5E7495CC0C8DFB6EB5F9935C067A70EAFFDB8F4C10102000040040000008C98250795144FC0705FAF88D0D24FC0D05649AF4CC40142007528F2EEB6E83FB022AE4BB29C50C0BEB4BDB0D32EF54124D7A5132F9255407CE7381FE05243C028EC5FBEA501DE41AEDFC6B4597C62C01CD2119BEDBA4A40D8B5F2C2EC91D9410102000040030000006822A286068861C088C5BDD2B0BE3DC0D0311ACDF3ADD3C1102F472C56275C405B6A877D39CC52C07AB7F2C6D3F8F541E09FECDFBB905F402C3A6B316E5F36C04014320D9680D4C1':::GEOGRAPHY AS col319 FROM with58 AS cte_ref20 WHERE true), "
        with60" (col320, col321) AS (SELECT * FROM (VALUES (3979452452:::OID, (0:::OID, '40 years 1 mon 789 days 06:11:53.779247':::INTERVAL)), (799128268:::OID, (NULL, '-4 years -9 mons -805 days -09:45:27.974987':::INTERVAL)), (3360760519:::OID, (3480153528:::OID, NULL)), (465577586:::OID, (493835905:::OID, '58 years 4 mons 99 days 21:53:09.182546':::INTERVAL)), (NULL, (2237769010:::OID, '-23 years -7 mons -768 days -00:39:49.964021':::INTERVAL))) AS tab131 (col320, col321)) SELECT '01040000A0E61000000900000001010000804484146D3CCB5B403CAC4EC4B536454078D23ABEC042E441010100008048699AE05D5E3B40A09B5BADFD760FC0F8C9FC309D78FA410101000080E0F6F649237343C03725346423D549C0B663DFC5E6D5EEC10101000080851DEC8831B252C0149404F8809448403028B774CC62EA410101000080744883E390015DC066860B024228404048B765F8F68D0242010100008068E4E824F86C3CC0E0B2131E348734400038FBA92116E7C10101000080106A63D0C32E5F40D478195AAEE75540B8A25098445BE54101010000807CB0E7FC95225A40E453412EFE8C4A4044830E167666E941010100008080BBB99A1DE10CC0706B1CADEC25494064F40B8B52A80042':::GEOGRAPHY AS "coḻ""322" FROM defaultdb.public.seed_mr_table@[0] AS "t�ab{132" ORDER BY "t�ab{132"._interval NULLS LAST, "t�ab{132"._int8, "t�ab{132"._decimal NULLS FIRST, "t�ab{132"._int8 ASC, "t�ab{132".tableoid DESC NULLS FIRST, "t�ab{132"._int4 DESC NULLS LAST, "t�ab{132".crdb_internal_mvcc_timestamp LIMIT 1:::INT8))) AS "tab%v133" ("col'323")) SELECT B'1001000100110101000' AS col324 FROM "w̸ iTh61" AS "cte_r.ef21" GROUP BY "cte_r.ef21".col316 ORDER BY "cte_r.ef21".col316 DESC LIMIT 1:::INT8))) AS "taB134" (col325)) SELECT 0.2572676624893236:::FLOAT8 AS col326, (-8544882403808434226):::DECIMAL AS col327, "t ab135"._interval AS "c ol328", 3636117814:::OID AS co😍l329 FROM defaultdb.public.seed_mr_table@[0] AS "t    ab135", defaultdb.public.seed_mr_table@[0] AS tab136 WHERE tab136._bool LIMIT 95:::INT8
        SELECT '':::VOID AS "c\\x64ol330"
        WITH "wit""h63" (col331) AS (SELECT * FROM (VALUES ((-1):::INT8), ((-13463):::INT8), (NULL), ((-26619):::INT8), (24867:::INT8)) AS tab137 (col331)), with64 ("c(oL 332") AS (SELECT * FROM (VALUES (447590311:::OID), (534395274:::OID), (regprocedure(1426722144:::OID::OID)::REGPROCEDURE)) AS tab138 ("c(oL 332")) SELECT (-152):::INT8 AS "c%caol333" FROM "wit""h63" AS "cte_""ref22" WHERE NULL ORDER BY "cte_""ref22".col331 NULLS LAST LIMIT 42:::INT8
        SELECT tab139._string AS col334, tab139._date AS co̠l335, (-1.603505905357554902E+20):::DECIMAL AS c͕ol336, (-1219335360):::INT8 AS col337, tab139._uuid AS col338, tab139._int4 AS "c😎o\\x65l'%q339", '-65 years -718 days -01:08:21.180627':::INTERVAL AS "co�l340" FROM defaultdb.public.seed_mr_table@[0] AS tab139 WHERE tab139._string ~* e'u\x18O':::STRING ORDER BY tab139._int8 ASC$$: at or near "ydkd": syntax error
    panic.go:522: -- test log scope end --
test logs left over in: /artifacts/tmp/_tmp/24a1830a60e8c96e6a05506359144db7/logTestGenerateParse3903789111
--- FAIL: TestGenerateParse (1.91s)

Parameters: TAGS=bazel,gss

Help

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

/cc @cockroachdb/sql-queries

This test on roachdash | Improve this report!

Jira issue: CRDB-26891

cockroach-teamcity commented 1 year ago

internal/sqlsmith.TestGenerateParse failed with artifacts on master @ 582880ae2bb5d08e83a9871735deeeb3ed892e7d:

            (('24:00:00':::TIME, '52 years 6 mons 220 days 00:56:17.759472':::INTERVAL, '':::VOID))
    )
        AS "ta?b315" (col556)
ORDER BY
    "ta?b315".col556 NULLS FIRST, "ta?b315".col556 DESC
LIMIT
    18:::INT8;

STMT: 74
SELECT
    '{"a": true, "baz": {"foo": "b", "iQppz1Den": true}, "foobar": "c", "hhRYw3": 1.8955539569131776}':::JSONB AS col559
FROM
    (
        VALUES
            (NULL),
            (
                (
                    '{"Fz": "foobar", "c": {"a": false, "bNQe1arB": null, "bar": 1.758961146014182}}':::JSONB::JSONB#>ARRAY[
                        '.sA':::STRING,
                        '':::STRING,
                        e'[5a\x16cL*\b':::STRING,
                        '"':::STRING
                    ]::STRING[]
                )::JSONB
            )
    )
        AS tab316 (col558)
WHERE
    true;

STMT: 75
SELECT
    2118164442:::OID AS col561
FROM
    (VALUES (4256545469:::OID), (NULL), (2844334872:::OID), (1064066424:::OID), (391303601:::OID), (1650925788:::OID))
        AS tab317 ("Col}560");

    sqlsmith_test.go:201: CREATE FUNCTION func12()
            RETURNS SETOF RECORD
            IMMUTABLE
            LANGUAGE SQL
            AS $$SELECT tab318.col563 AS col596, 2818909677:::OID AS col597, 'G)> SG_=':::STRING AS "c'o    l598" FROM (VALUES (179070871:::OID, '-42 years -2 mons -181 days -22:11:21.949529':::INTERVAL), (to_regnamespace(NULL::STRING)::REGTYPE, '-13 years -1 mons -549 days -20:38:20.002841':::INTERVAL), (regtype((e'\x0bm':::STRING::STRING || ((-2271323377942952402):::INT8::INT8 + '67c3:fedb:49ef:de70:aca4:fe64:e720:f356/0':::INET::INET)::INET::INET)::STRING::STRING)::REGTYPE, '45 years 5 mons 628 days 11:57:53.130203':::INTERVAL), (NULL, '-58 years -4 mons -749 days -19:26:23.260425':::INTERVAL), (522530429:::OID, NULL), (1193682527:::OID, '-18 years -557 days -22:11:14.090822':::INTERVAL)) AS tab318 (col562, col563), (VALUES (e':\x05A\x0fd':::STRING), ('Icz':::STRING)) AS "!t""ab340" ("cOl595") ORDER BY "!t""ab340"."cOl595" NULLS FIRST, "!t""ab340"."cOl595" DESC NULLS FIRST, "!t""ab340"."cOl595" ASC
        SELECT NULL AS col603 FROM (VALUES ((SELECT st_geogfromwkb('\xd9':::BYTES::BYTES, ((-6953655908245459412):::INT8::INT8 >> (-3469207895042307768):::INT8::INT8)::INT8::INT8)::GEOGRAPHY AS "c)ol😈601" FROM (VALUES (0.6566126942634583:::FLOAT8, 'X':::STRING), (1.1024069786071777:::FLOAT8, e'=\n':::STRING), (NULL, e'$$\x11~d\x0b#0':::STRING), (1.3626487255096436:::FLOAT8, e'\x1fpe':::STRING), ((-2.3653311729431152):::FLOAT8, st_ashexwkb('01050000E0E61000000700000001020000C005000000EA88DBFD471F64C078350AC0547456C0B444F83AC5B6F8C1245F939251D9E641E421B9087EE362404F319EEB056D54C080B1003D5EFC9DC188008C62BBCCFE4110923E89D70958406115DCB64F0B4CC020D31DE0CD32B4C18756C0738591F2C12816D6F17E664F40F206CC201BC75240E01F8CCAA538C9410E01D90C5BA1F741D01EFCDDBA333040B8F7698C9F3C3540E044D9770C41C2C1F454975E6C78FBC101020000C00200000010FD642ADBA42AC0CC5E91E39C7B45404478EA536689ECC1E2234016B63CF9410CBD6371815666C00661B91C011F53402C886C8CF2A7FB41805B3C4E77AACB4101020000C00300000020C82730EF2B4CC0F23409430FC74DC031A70E5AA37FF7C160E4D779198FB6411C77EF0B70345D40B1F2C379057E48C0F2EE01788330E2C130294FBE3BB1DDC176A3462C3A98624030878E610DF7154050FF2ADF1A31DD41B087C1BC2AB000C201020000C003000000458EFB6C46EA62C0A625DF45DE663EC0E8D03BDA1CF6EB4100126F9F39379341BE4299D80D846240A0E358A4602602C0F8F6A8D04B90F2C1D614268AFCB40042E454B65F7EF55640E856C3BAAFDA33405C81DE7232430242F6FE96A7A143F44101020000C00200000014994329A40D43C074F87DD8B0B551C02CBEBE5159ECFAC126D172199425F6417A0BAEFEA72D6140CA46717A28144FC01494058F39CFE941E08A0DBE517FB54101020000C003000000D75C801B84B750C0C6A59E953FF140C0554A8766CD6B00C2465FB506C48FFDC138B28AEAFD1639403458DA4084AA43C0F6D15CFC1E3AF5C140E7F8F232B3FB418413A5CCE6D25240B000E27687AF26C078BC3821A514FD41E0931F34D545DC4101020000C00200000098B2A507455B48402D2B4170DED849C08051BE925761C7C1B4A79500B4AAFB41529B646DFF4F6140E4E1DEE01BAC48C07080514A7433CA415F03817EACD000C2':::GEOGRAPHY::GEOGRAPHY)::STRING), (0.7468131184577942:::FLOAT8, e'Hd\x12\x1a0\t\x10':::STRING)) AS tab341 ("co-l599", col600) WHERE false LIMIT 1:::INT8)), ('01070000A0E61000000600000001030000A0E610000001000000090000000BDDBCFEC24859C06800CFC2B31830C0A8D2C2BB8876E7C149524C491DB065C069644F8AD82C51C050ADCFA75FD9D8C140CD59A887502340A80A1D5FB30733C034615FF5DAE3F241F00BB2C49C2860401CE5707474A73F401ADA60B05AC6E9C1C215D5A15A2E6240543BC4150CDA4340F255606F0BACF2C11022F81D96C95E40A87C9033CE4F52403ABCB6A268F1F84120974A2A9BB840400A1E463004B4544090E3FDB65557C741C5001541E2DC63C01E39AFB96AEA5340DBC61A4266B7F2C10BDDBCFEC24859C06800CFC2B31830C0A8D2C2BB8876E7C101050000A0E610000002000000010200008009000000085904BD77E43EC0BCE3015B897D38C0662FB3129493E6C1B4DE9B62998256C038BE05C338DD52C04049769223B5FC41283D480A84293CC0A310A0A15CFF51C0E0B0A660F942B641BAF1179551FA5040CB07272CB2D354C054FC52FB0FF7E1412C6793F850B55E4018E810EBA15A30C088966B9EA1A1D4C19AE3E4FCAC8661409CAAC7D17A6A394020C070C57515EAC1CA618997B8C1644074B7DBAC4390524080C527A480CB9C419083CF2E468B65C0805E5450D22E4840E2D979E70D23FCC160F2683D75554AC0E05691C45D601CC0A457DF9ED451F4C101020000800400000064F8E5F534D54CC0A00B0267837625C09ADA7B5634BEF6C19011977B81BC3D404C1FF53F081634C0B89CD392B590FDC1307820EBAF164D40564FA3E0951649C0AA22B4783CA2E8C124F36B3D5D015D408027F549265127C0C1AD19C47FA201C201010000A0E6100000EC6902CB1E664840985E2F66337950C074784D69EE04FA4101010000A0E6100000DC0E377F98B55240729C23C0D4704FC040BD4DA08ACCB5C101010000A0E61000001CC4BA5C77FD42C0C5EC2A8EB8AD42C0B051AA541793FFC101010000A0E61000002C47757004C25740A067DE304EB94F40B8DC0BF1E81AE141':::GEOGRAPHY), (st_s2covering('01040000A0E6100000080000000101000080A4DB5E2515C050C0CE99A587A7B9404018A719F20531D74101010000806D167E50F31961C06335A386151656C0E0D6D941A122EB410101000080B041EA15936C244080ED73E3E1754140267FACF2668AF0C101010000803C706E3576655C4008C51ADDAA0D3940AED32399747500420101000080484B1D8BF46A34C0E04A7B85B8703840A006CA056E3FCCC101010000801AA90CE7852B5EC024832BB8B1614D40D6B728D1D65A00C201010000801F829189D88962C0C8394F34667D51C092EA9DA86ECBF6C101010000805C4147EE10EB634080EDCC683652F0BF87386CBAD928F5C1':::GEOGRAPHY::GEOGRAPHY)::GEOGRAPHY), (st_segmentize(st_geogfromtext(e'\U00002603':::STRING::STRING)::GEOGRAPHY::GEOGRAPHY, (-1.2416172726014523):::FLOAT8::FLOAT8)::GEOGRAPHY)) AS tab342 (colͪ602) ORDER BY tab342.colͪ602, tab342.colͪ602 DESC NULLS FIRST LIMIT 59:::INT8
        WITH with121 ("co�l604") AS (SELECT * FROM (VALUES (3468551557:::OID), (1558997873:::OID), (302318867:::OID), (0:::OID)) AS tab343 ("co�l604")), with122 ("c o\\xcbl605", "c""ol606") AS (SELECT * FROM (VALUES (15401:::INT8, 'BOX(-0.8032976416325961 0.49853900010205443,0.37081259123062094 0.631740584458595)':::BOX2D)) AS tab344 ("c o\\xcbl605", "c""ol606")), with123 ("-col607") AS (SELECT * FROM (VALUES (COALESCE(COALESCE(ARRAY[(-21130):::INT8], ARRAY[(-1):::INT8,11552:::INT8]), ARRAY[31443:::INT8,22566:::INT8,(-10734):::INT8,14003:::INT8,8061:::INT8])), (ARRAY[6026:::INT8]), (ARRAY[(-8921):::INT8,0:::INT8,17403:::INT8]), (ARRAY[19517:::INT8,12993:::INT8,23537:::INT8]), (ARRAY[(-3917):::INT8,(-13012):::INT8]), (ARRAY[(-128):::INT8,3574:::INT8,(-1):::INT8])) AS tab345 ("-col607")) SELECT COALESCE("\\u98ECcte_ref36"."-col607", ARRAY[(-4418):::INT8,820:::INT8,29196:::INT8,(-23225):::INT8,29386:::INT8,(-5691):::INT8]) AS col608, ARRAY[]:::INT2[] AS c😰ol609 FROM with123 AS "\\u98ECcte_ref36", with123 AS cte_ref37 ORDER BY "\\u98ECcte_ref36"."-col607" NULLS LAST LIMIT 29:::INT8
        WITH wit_h124 (col610) AS (SELECT * FROM (VALUES (NULL)) AS "tab(346" (col610)), "\\x80with125" (col611) AS (SELECT * FROM (VALUES (B'0000000000000000000000000000000000000000'), (B'0110110101110001011100010011100011010001'), (B'0101000100001110000110000100101011110100')) AS tab347 (col611)) SELECT (-906597767):::INT8 AS col612 FROM wit_h124 AS cte_ref38 WHERE true LIMIT 17:::INT8
        SELECT '1973-06-26':::DATE AS "c%qo̳ l617", "ta*b348".c̽ol613 AS col618 FROM (VALUES ('08:18:11.363219+03:28':::TIMETZ)) AS "ta*b348" (c̽ol613), (SELECT tab349."c🙂ol%c8614" AS col615 FROM (VALUES ('1994-07-03':::DATE), ('1988-02-29':::DATE), (parse_date(e'<4\f4:T':::STRING::STRING)::DATE)) AS tab349 ("c🙂ol%c8614") LIMIT 49:::INT8) AS tab350 (col616) WHERE false ORDER BY "ta*b348".c̽ol613 DESC NULLS LAST
        SELECT tab351."co%67l619" AS col620 FROM (VALUES ('1995-07-27 21:12:16.000122':::TIMESTAMP), ('1997-11-09 14:40:44.000088':::TIMESTAMP), (('1995-01-10':::DATE::DATE - '-68 years -10 mons -693 days -24:25:02.192954':::INTERVAL::INTERVAL)::TIMESTAMP), ('2017-10-09 01:32:41.000794':::TIMESTAMP)) AS tab351 ("co%67l619") WHERE true$$: at or near "\": syntax error
    panic.go:540: -- test log scope end --
test logs left over in: /artifacts/tmp/_tmp/24a1830a60e8c96e6a05506359144db7/logTestGenerateParse2061257663
--- FAIL: TestGenerateParse (9.01s)

Parameters: TAGS=bazel,gss,race

Help

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

This test on roachdash | Improve this report!

cockroach-teamcity commented 1 year ago

internal/sqlsmith.TestGenerateParse failed with artifacts on master @ 582880ae2bb5d08e83a9871735deeeb3ed892e7d:

        ),
    "wi'th35" ("c ol231")
        AS (
            SELECT
                *
            FROM
                (
                    VALUES
                        ('1993-03-02':::DATE),
                        ('1991-12-08':::DATE),
                        ('1974-08-06':::DATE),
                        ('1977-01-25':::DATE),
                        ('1983-10-29':::DATE)
                )
                    AS tab111 ("c ol231")
        )
SELECT
    "cte_rEf7"."co l230" AS "'col232"
FROM
    "wit%v😈h34" AS "cte_rEf7";

STMT: 38
SELECT
    tab112."col1_ 2" AS "co%cal233",
    tab112."col\\U0008742B1_3" AS col234,
    e'\'DeU\' \'NqT\' \'PR\':312B,363A,812A \'UsxcL\' \'cVqgls\':617B,869A \'kLHl\' \'muQTH\' \'wP\':908C':::TSVECTOR
        AS "co'l235",
    tab112."c""ol1__5" AS col236
FROM
    defaultdb.public.table1@"table1_col\\U0008742B1_3_idx" AS tab112
WHERE
    false
LIMIT
    75:::INT8;

    sqlsmith_test.go:201: CREATE FUNCTION "%vfunc4"()
            RETURNS RECORD
            LANGUAGE SQL
            AS $$SELECT (-1171173.475116328636):::DECIMAL AS col237, "ta!b113"."%qcol2_0" AS col238, "ta!b113"."%qcol2_0" AS "col"" 239", "ta!b113".tableoid AS "co,l240", '''FWqhA'' ''FbQQEyzq'' ''HLZlSJ'':787B,939B ''IaH'' ''PMnE'':174B,502C ''i'':338C,564C,610B ''jG'' ''nEDeY'':26B,776B,824A ''uYwfoPU'':20C,419A ''zOIKkZ'':140B,228C,972B':::TSVECTOR AS "ĉo_ l 241" FROM defaultdb.public."table{2"@"table{2_expr_expr1_%qcol2_0_key" AS "ta!b113" WHERE false LIMIT 61:::INT8
        WITH "With36" (" col͐242", "c\\xd7o-😽l243", col244, "co%cdl 245") AS (SELECT * FROM (VALUES ('B?.F}f':::STRING, NULL, NULL, '0001-01-01 00:00:00':::TIMESTAMP), (NULL, '''RnDOERziQJ''':::TSQUERY, ARRAY[21755:::INT8,16207:::INT8], '2022-09-25 00:56:20.000263':::TIMESTAMP), (NULL, NULL, ARRAY[14335:::INT8,(-29842):::INT8], '2009-11-22 22:57:58.000753':::TIMESTAMP), (e';\x0b\x02+$s_\t':::STRING, '!''PZ'' | ''dglvnK''':::TSQUERY, ARRAY[23336:::INT8], '1978-04-15 22:41:28.000716':::TIMESTAMP)) AS " tab114" (" col͐242", "c\\xd7o-😽l243", col244, "co%cdl 245")) SELECT '00000000-0000-0000-0000-000000000000':::UUID AS col246, cte_ref8."co%cdl 245" AS co😭l247, tab115.col3_3 AS "col 248", tab115.tableoid AS col249, 19280:::INT8 AS "co/😰l250", cte_ref8." col͐242" AS col251 FROM "With36" AS cte_ref8, defaultdb.public.table3@table3_pkey AS tab115 WHERE (NOT false) ORDER BY tab115."c-ol3_.13" ASC LIMIT 45:::INT8
        SELECT tab116.col2_1 AS "'c͟ol252", tab116."%qcol2_0" AS col253, ('1987-11-09':::DATE::DATE || tab116."%qcol2_0"::STRING)::STRING AS "c�ol%\f254", 865292493:::OID AS col255, (-0.04077187492157611293):::DECIMAL AS col256 FROM defaultdb.public."table{2"@[0] AS tab116 WHERE false
        SELECT '03:19:43.98226':::TIME AS col257 LIMIT 87:::INT8
        SELECT '''C'':644A,667C,821B,835B ''FGT'' ''GWf'' ''JIkEw'':152C,524C,944B ''WX'' ''XCLEUpxb'':44A,88B,439B,617B ''fMpNhyJB'' ''hAvB'':137B,339B ''j'':540B,676A,924C,937C ''mJvPr'':167C,238C':::TSVECTOR AS col258, "tab'117".tableoid AS col259, e'F!H\x01h\x0b\x1a':::STRING AS "   col260", "t-%vab118"."\\u0C60col2_2" AS " c̩ol261", NULL AS "c\f😁ol262", "tab'117"."\\u0C60col2_2" AS col263, "t-%vab118"."\\u0C60col2_2" AS col264, "tab'117".col2_1 AS col265, "tab'117".crdb_internal_mvcc_timestamp AS col266, "t-%vab118".tableoid AS col267 FROM defaultdb.public."table{2"@"table{2_expr_expr1_%qcol2_0_key" AS "tab'117", defaultdb.public."table{2"@"table{2_expr_expr1_%qcol2_0_key" AS "t-%vab118" LIMIT 8:::INT8
        WITH "wit{h37" (col268) AS (SELECT * FROM (VALUES (2405043353:::OID), (848825175:::OID), (0:::OID), (132212782:::OID), (NULL), (regprocedure('p$$|!T v2':::STRING::STRING)::REGPROCEDURE)) AS "t%pab119" (col268)), with40 (col272, "c%p😆ol273") AS (SELECT * FROM (VALUES ((-1882103446):::INT8, (WITH with38 (col269) AS (SELECT * FROM (VALUES ('a':::STRING), (e'\x10':::STRING)) AS tab120 (col269)), with39 (😃col270) AS (SELECT * FROM (VALUES (('02:14:27.55545':::TIME::TIME + NULL::INTERVAL)::TIME), ('02:37:57.225221':::TIME), (NULL), ('22:15:54.546569':::TIME), ('12:33:56.793441':::TIME)) AS "'tab121" (😃col270)) SELECT ARRAY['2025-11-15 16:44:12.000447':::TIMESTAMP,'1974-10-25 20:43:54.000238':::TIMESTAMP,'2014-01-01 23:44:15.000546':::TIMESTAMP,'2011-01-25 14:05:04.00005':::TIMESTAMP,'2019-06-13 08:10:35.000303':::TIMESTAMP] AS "Col271" FROM defaultdb.public.table3@[0] AS tab122 WHERE true ORDER BY tab122."cO(l3̊_6" ASC, tab122.col3_4 DESC, tab122."col%q3_11" DESC NULLS LAST, tab122."
        co'l3_2" DESC NULLS LAST, tab122.col3_4 DESC LIMIT 1:::INT8)), ((-86411724):::INT8, ((ARRAY['1973-06-26 19:43:27.000515':::TIMESTAMP,'0001-01-01 00:00:00':::TIMESTAMP,'1982-01-18 12:07:12.000933':::TIMESTAMP,'2000-07-29 18:50:50.000143':::TIMESTAMP,'2001-11-25 00:20:43.000171':::TIMESTAMP,'1987-05-03 02:09:27.000428':::TIMESTAMP,'2001-12-21 06:43:16.00049':::TIMESTAMP]::TIMESTAMP[] || '2031-09-30 19:05:23.000097':::TIMESTAMP::TIMESTAMP)::TIMESTAMP[]::TIMESTAMP[] || ARRAY['1974-08-03 02:03:46.000384':::TIMESTAMP,'2003-12-21 09:24:51.000607':::TIMESTAMP,'2015-11-22 11:08:17.000506':::TIMESTAMP]::TIMESTAMP[])::TIMESTAMP[]), (1780971159:::INT8, NULL), ((-1978800150):::INT8, ARRAY['2032-08-31 14:36:14.000737':::TIMESTAMP,'2026-03-19 22:44:37.000516':::TIMESTAMP,'2023-11-19 14:44:59.000492':::TIMESTAMP]), (376841296:::INT8, ('1970-03-03 05:31:23.000781':::TIMESTAMP::TIMESTAMP || ARRAY[]:::TIMESTAMP[]::TIMESTAMP[])::TIMESTAMP[])) AS tab123 (col272, "c%p😆ol273")) SELECT tab124.col1_4 AS col274, '1988-09-26 18:05:26.000908+00':::TIMESTAMPTZ AS "co%ql275" FROM defaultdb.public.table1 AS tab124 JOIN defaultdb.public.table1 AS tab125 ON (tab124.col1_4) = (tab125.col1_4) WHERE NULL ORDER BY tab125.col1_4 NULLS LAST, tab125.col1_4 DESC NULLS FIRST, tab125.col1_4 ASC NULLS LAST
        SELECT ("ta
b126".col3_4::INT8 % "ta
b126"."
        co'l3_2"::INT8)::INT8 AS col276 FROM defaultdb.public.table3@table3_pkey AS "ta
b126", defaultdb.public."table{2"@[0] AS "\vtab127" WHERE true ORDER BY "\vtab127".col2_1 ASC NULLS FIRST$$: at or near "|": syntax error
    panic.go:522: -- test log scope end --
test logs left over in: /artifacts/tmp/_tmp/24a1830a60e8c96e6a05506359144db7/logTestGenerateParse3157273506
--- FAIL: TestGenerateParse (10.06s)

Parameters: TAGS=bazel,gss,deadlock

Help

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

This test on roachdash | Improve this report!

rharding6373 commented 1 year ago

Dupe of #101253

Depending how long it takes to fix may need to disable CREATE FUNCTION in sqlsmith until it's resolved.