Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql/tests: TestRandomSyntaxSQLSmith failed [unexpectedly unordered keys in jsonObject] #121326

Closed
cockroach-teamcity opened this issue Mar 29, 2024 · 0 comments · Fixed by #121390
Assignees
Labels
branch-release-23.2.4-rc C-test-failure Broken test (automatically or manually discovered). O-robot Originated from a bot. T-sql-queries SQL Queries Team
Milestone

Comments

@cockroach-teamcity
Copy link
Member

cockroach-teamcity commented Mar 29, 2024

sql/tests.TestRandomSyntaxSQLSmith failed with artifacts on release-23.2.4-rc @ c013b0d428ae23ac3542d950d9359cfc2a0246a5:

Random syntax error:

    rsg_test.go:911: Crash detected: server panic: pq: internal error: unexpectedly unordered keys in jsonObject {"\u0005\u0014\")[\u001e": "_p\u0014", "3XN\u0008pTN": ""}

Query:

        WITH
        	"w😇i""th185000" (col1039069)
        		AS (
        			SELECT
        				*
        			FROM
        				(
        					VALUES
        						(ARRAY[]:::DECIMAL[]),
        						(ARRAY[3.826042721469873768:::DECIMAL,(-2495.891119824411118):::DECIMAL]),
        						(
        							ARRAY[(-2157482.35478645044):::DECIMAL,4323897123.139193817:::DECIMAL,9.193059313478565902E+22:::DECIMAL]
        						),
        						(
        							ARRAY[(-0.01958105118014557863):::DECIMAL,'-Infinity':::DECIMAL,(-744.4754516228360795):::DECIMAL]
        						)
        				)
        					AS tab454439 (col1039069)
        		),
        	w͊ith185001 (col1039070)
        		AS (
        			SELECT
        				*
        			FROM
        				(
        					VALUES
        						('{"b": 0.9599167020549824, "foo": true, "wmaJu": {"bar": false}}':::JSONB),
        						(
        							'[[[1.2002019188152038], false], null, [[null, false, false], false, true], true, null]':::JSONB
        						),
        						(
        							'[{"BNA5a": "c", "foo": false}, {"Fd4ujFoXd": 1.7420763588047599, "baz": "EO", "gyH2M": false}, true, false, "foo", 2.156513194049362]':::JSONB
        						),
        						(
        							json_object(ARRAY[e'3XN\bpTN':::STRING,'':::STRING,e'\x05\x14")[\x1e':::STRING,e'_p\x14':::STRING]::STRING[])::JSONB
        						)
        				)
        					AS tab454440 (col1039070)
        		)
        SELECT
        	jsonb_object_agg('[{"IeVFqMr": null, "XeyY": false, "a": 0.963213451556605, "wCTkU": [{"Kd": "c", "sTUkuoJuk": "srTVTn"}, "1zVgfh", null]}, {"2mpHmSU": 0.47216566718681685, "a": "i1P", "c": false, "foo": ["foobar"]}, null]':::JSONB::STRING, cte_re😐f53259.col1039070) OVER (PARTITION BY cte_re😐f53259.col1039070)::JSONB
        		AS col1039071
        FROM
        	w͊ith185001 AS cte_re😐f53259
        WHERE
        	true
        GROUP BY
        	cte_re😐f53259.col1039070
        LIMIT
        	21:::INT8;

Schema:

    rsg_test.go:720: To reproduce, use schema:
    rsg_test.go:722: SET sql_safe_updates = false;;
    rsg_test.go:722: SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;;
    rsg_test.go:722: SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false;;
    rsg_test.go:722: CREATE TABLE table1 (col1_0 REFCURSOR NOT NULL, "col1%fe_\\U000C8DB91" TSQUERY, "col1 _2" INET NOT NULL, col1_3 REFCURSOR NULL, col1_4 DECIMAL NOT NULL, col1_5 BYTES NOT NULL, "Col1_6" GEOMETRY, INDEX (lower(CAST("col1 _2" AS STRING)) ASC) STORING (col1_0, "col1%fe_\\U000C8DB91", "Col1_6") WHERE (table1.col1_5 >= '\x00':::BYTES) OR (table1.col1_4 <= 'Infinity':::DECIMAL), INVERTED INDEX ("Col1_6") WHERE (table1.col1_4 >= (-1.234E+401):::DECIMAL) OR (table1.col1_5 < '\xe29883':::BYTES) NOT VISIBLE);
    rsg_test.go:722: CREATE TABLE "ta""ble2" ("co.l2_0" NAME NOT NULL, col2_̼1 TSQUERY NOT NULL, col2_2 BYTES NOT NULL, col2_3 TIMESTAMPTZ NOT NULL, col2_4 OID, "coL2_5" TIMETZ NOT NULL, PRIMARY KEY ("coL2_5" ASC), INDEX ("coL2_5", col2_4 DESC, col2_3 ASC) STORING (col2_̼1, col2_2) WHERE ((("ta""ble2"."co.l2_0" != e'\x00':::STRING:::NAME) OR ("ta""ble2".col2_2 = '\x':::BYTES)) AND ("ta""ble2".col2_3 < '4714-11-24 00:00:00+00 BC':::TIMESTAMPTZ)) AND ("ta""ble2"."coL2_5" < '00:00:00+15:59':::TIMETZ), INDEX ("coL2_5" ASC) STORING ("co.l2_0", col2_2) WHERE (("ta""ble2"."co.l2_0" < e'\'':::STRING:::NAME) OR ("ta""ble2".col2_2 < '\x22':::BYTES)) AND ("ta""ble2"."coL2_5" != '24:00:00-15:59':::TIMETZ), UNIQUE ("co.l2_0" ASC) STORING (col2_̼1, col2_4) WHERE "ta""ble2"."co.l2_0" != '"':::STRING:::NAME, INDEX (lower(CAST("coL2_5" AS STRING))), UNIQUE (col2_2 DESC, lower("co.l2_0"), col2_3 DESC) WHERE (("ta""ble2".col2_2 < '\x00':::BYTES) AND ("ta""ble2"."co.l2_0" = e'\'':::STRING:::NAME)) OR ("ta""ble2".col2_3 > '4714-11-24 00:00:00+00 BC':::TIMESTAMPTZ), UNIQUE ("co.l2_0", "coL2_5" ASC) STORING (col2_2) WHERE ((("ta""ble2".col2_2 != '\x27':::BYTES) AND ("ta""ble2"."co.l2_0" != e'\x00':::STRING:::NAME)) OR ("ta""ble2"."coL2_5" != '00:00:00+15:59':::TIMETZ)) OR ("ta""ble2".col2_3 <= '4714-11-24 00:00:00+00 BC':::TIMESTAMPTZ));
    rsg_test.go:722: ALTER TABLE table1 INJECT STATISTICS e'[{"avg_size": 13, "columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1311400137244618782, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1914831732785225361}, {"avg_size": 11, "columns": ["\\"Col1_6\\""], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 455652432457731525, "histo_buckets": [{"distinct_range": 0, "num_eq": 1000000000, "num_range": 0, "upper_bound": "\\\\x42fd052cd4000000000000c200001fa3ce9360c1f51c35c12729f342024e0c9fb53a2441e033f9484eeb50"}, {"distinct_range": 0, "num_eq": 800000, "num_range": 3035127757688952122, "upper_bound": "\\\\x42fd0cd000000000000000c20192074496859ec1fef8c8982e99fa42016c9e5386aade42014c169a0a5d0c"}, {"distinct_range": 47856713.22601091, "num_eq": 60000000, "num_range": 60000000, "upper_bound": "\\\\x42fd0ce004000000000000c20192074496859ec1fef8c8982e99fa42016c9e5386aade42014c169a0a5d0c"}, {"distinct_range": 500, "num_eq": 4310052766534779015, "num_range": 500, "upper_bound": "\\\\x42fd0d4000000000000000c20192074496859ec1fef8c8982e99fa42016c9e5386aade42014c169a0a5d0c"}, {"distinct_range": 0, "num_eq": 5000, "num_range": 0, "upper_bound": "\\\\x42fd0d9000000000000000c20192074496859ec1fef8c8982e99fa42016c9e5386aade42014c169a0a5d0c"}, {"distinct_range": 6610520682817444000, "num_eq": 100000, "num_range": 6610520682817443997, "upper_bound": "\\\\x42fd100000000000000000c20204a3ce6f7af8c201e09272de4f8d42029444e264cfd8420105c7e71d308a"}, {"distinct_range": 546.4084800545268, "num_eq": 9000000, "num_range": 800, "upper_bound": "\\\\x42fd1000000000000040004024000000000000402400000000000040440000000000004044000000000000"}, {"distinct_range": 0, "num_eq": 80000000, "num_range": 4712606690475522195, "upper_bound": "\\\\x42fd10000000000000c0004024000000000000402400000000000040440000000000004044000000000000"}, {"distinct_range": 10, "num_eq": 100000, "num_range": 10, "upper_bound": "\\\\x42fd1000000000000110004024000000000000402400000000000040440000000000004044000000000000"}, {"distinct_range": 487.60128199791535, "num_eq": 4000, "num_range": 3000, "upper_bound": "\\\\x42fd10000000000001ab004024000000000000402400000000000040440000000000004044000000000000"}, {"distinct_range": 10000, "num_eq": 1000, "num_range": 10000, "upper_bound": "\\\\x42fd10000000000001d0004024000000000000402400000000000040440000000000004044000000000000"}, {"distinct_range": 1345263342232334600, "num_eq": 6697027367568957469, "num_range": 2145075316147848343, "upper_bound": "\\\\x42fd110000000000000000c20192074496859ec1fef8c8982e99fa42016c9e5386aade42014c169a0a5d0c"}, {"distinct_range": 7897094294019802000, "num_eq": 50000000000, "num_range": 7897094294019801935, "upper_bound": "\\\\x42fd130000000000000000c20192074496859ec1fef8c8982e99fa42016c9e5386aade42014c169a0a5d0c"}, {"distinct_range": 0, "num_eq": 0, "num_range": 1761194485154870397, "upper_bound": "\\\\x42fd170000000000000000c200001fa3ce9360c1f51c35c12729f342024e0c9fb53a2441e033f9484eeb50"}, {"distinct_range": 7487384117171413000, "num_eq": 50000000000, "num_range": 7487384117171413002, "upper_bound": "\\\\x42fd170000000000000000c20192074496859ec1fef8c8982e99fa42016c9e5386aade42014c169a0a5d0c"}, {"distinct_range": 0, "num_eq": 4546126916794566815, "num_range": 10000, "upper_bound": "\\\\x42fd181000000000000000c20192074496859ec1fef8c8982e99fa42016c9e5386aade42014c169a0a5d0c"}, {"distinct_range": 0, "num_eq": 7250763538774944828, "num_range": 0, "upper_bound": "\\\\x42fd19c000000000000000c200001fa3ce9360c1f51c35c12729f342024e0c9fb53a2441e033f9484eeb50"}, {"distinct_range": 7963383404.753042, "num_eq": 90000000000, "num_range": 8000000000, "upper_bound": "\\\\x42fd1b0000000000000000c200001fa3ce9360c1f51c35c12729f342024e0c9fb53a2441e033f9484eeb50"}, {"distinct_range": 1000000, "num_eq": 8293517974135262361, "num_range": 1000000, "upper_bound": "\\\\x42fdffffffffffffffff00c1f9068309fed942c1fc9f8d512f9d1c4201bbf126db92bc4200f59810d008a6"}, {"distinct_range": 5046577853753851000, "num_eq": 40000000, "num_range": 5046577853753850611, "upper_bound": "\\\\x42fdffffffffffffffff00c200001fa3ce9360c1f51c35c12729f342024e0c9fb53a2441e033f9484eeb50"}, {"distinct_range": 6796909605155856000, "num_eq": 7380972955138046548, "num_range": 6796909605155855877, "upper_bound": "\\\\x42fdffffffffffffffff00c20192074496859ec1fef8c8982e99fa42016c9e5386aade42014c169a0a5d0c"}, {"distinct_range": 8.231026227401099, "num_eq": 10000000, "num_range": 300, "upper_bound": "\\\\x42fdffffffffffffffff00c20204a3ce6f7af8c201e09272de4f8d42029444e264cfd8420105c7e71d308a"}, {"distinct_range": 7000000, "num_eq": 5342307823170678113, "num_range": 7000000, "upper_bound": "\\\\x42fdffffffffffffffff01420168c430c35440c200b563c87fc9f0"}], "histo_col_type": "BYTES", "name": "__auto__", "null_count": 7867820573990664, "row_count": 1914831732785225361}, {"avg_size": 3, "columns": ["col1_0"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 43023046512253346, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1914831732785225361}, {"avg_size": 28, "columns": ["\\"col1%fe_\\\\\\\\U000C8DB91\\""], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1076669954449087547, "histo_col_type": "", "name": "__auto__", "null_count": 885041228515374324, "row_count": 1914831732785225361}, {"avg_size": 6, "columns": ["\\"col1 _2\\""], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 678153176207290506, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1914831732785225361}, {"avg_size": 5, "columns": ["col1_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 1124706309026264355, "histo_col_type": "", "name": "__auto__", "null_count": 253429540779667259, "row_count": 1914831732785225361}, {"avg_size": 8, "columns": ["col1_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 30421428673498253, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 1914831732785225361}]':::JSONB;
    rsg_test.go:722: ALTER TABLE "ta""ble2" INJECT STATISTICS e'[{"avg_size": 29, "columns": ["\\"coL2_5\\""], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 194420781, "histo_buckets": [{"distinct_range": 0, "num_eq": 90000000000, "num_range": 0, "upper_bound": "00:00:00+15:59"}, {"distinct_range": 4468225757381388300, "num_eq": 7000000, "num_range": 4468225757381388085, "upper_bound": "05:00:05.218392+02:45"}, {"distinct_range": 90000000000, "num_eq": 90000000000, "num_range": 90000000000, "upper_bound": "11:27:46.765584+07:34"}, {"distinct_range": 0, "num_eq": 7755817622380689019, "num_range": 4398349010785936446, "upper_bound": "14:14:18.29159+10:03"}, {"distinct_range": 374499043068154300, "num_eq": 4022700463628657809, "num_range": 2757645391134506888, "upper_bound": "14:58:30.161855+04:54"}, {"distinct_range": 5142.133519988237, "num_eq": 5299814305627340044, "num_range": 6000, "upper_bound": "16:51:08.496606+03:16"}, {"distinct_range": 1640606868656025000, "num_eq": 1000000, "num_range": 1640606868656025051, "upper_bound": "21:12:35.714627+05:10"}], "histo_col_type": "TIMETZ", "name": "__auto__", "null_count": 0, "row_count": 200000000}, {"avg_size": 21, "columns": ["\\"co.l2_0\\""], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 39895682, "histo_buckets": [{"distinct_range": 0, "num_eq": 7597205757904122222, "num_range": 0, "upper_bound": "\\rJ\\u0016@\\u0012Y"}, {"distinct_range": 9000000, "num_eq": 6818061979809504615, "num_range": 9000000, "upper_bound": "\\u0015(RQ"}, {"distinct_range": 0, "num_eq": 3000000, "num_range": 10000, "upper_bound": "-"}, {"distinct_range": 0, "num_eq": 900000000, "num_range": 0, "upper_bound": "Sb7\\u000ed"}, {"distinct_range": 2323536192.377636, "num_eq": 628416627774710070, "num_range": 3000000000, "upper_bound": "gD{m"}, {"distinct_range": 0, "num_eq": 10000000, "num_range": 4000, "upper_bound": "m\'y9\\u0005"}, {"distinct_range": 0, "num_eq": 60, "num_range": 4204508003688183249, "upper_bound": "|&F["}, {"distinct_range": 93150459.70206793, "num_eq": 8563227212655520078, "num_range": 300000000, "upper_bound": "\U00002603"}], "histo_col_type": "NAME", "name": "__auto__", "null_count": 0, "row_count": 200000000}, {"avg_size": 10, "columns": ["col2_\u033C1"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 91228060, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 200000000}, {"avg_size": 7, "columns": ["col2_2"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 88332014, "histo_col_type": "BYTES", "name": "__auto__", "null_count": 0, "row_count": 200000000}, {"avg_size": 24, "columns": ["col2_3"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 188408588, "histo_col_type": "", "name": "__auto__", "null_count": 0, "row_count": 200000000}, {"avg_size": 18, "columns": ["col2_4"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 52496885, "histo_col_type": "", "name": "__auto__", "null_count": 79572078, "row_count": 200000000}]':::JSONB;
    rsg_test.go:722: CREATE TYPE rand_typ_0 AS ENUM ('y', 'kw', 'ovpv');
    rsg_test.go:722: SET sql_safe_updates = false;;
    rsg_test.go:722: 
        BEGIN; CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning'); COMMIT;
        BEGIN;
        CREATE TABLE IF NOT EXISTS seed AS
        	SELECT
        		g::INT2 AS _int2,
        		g::INT4 AS _int4,
        		g::INT8 AS _int8,
        		g::FLOAT4 AS _float4,
        		g::FLOAT8 AS _float8,
        		'2001-01-01'::DATE + g AS _date,
        		'2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
        		'2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
        		g * '1 day'::INTERVAL AS _interval,
        		g % 2 = 1 AS _bool,
        		g::DECIMAL AS _decimal,
        		g::STRING AS _string,
        		g::STRING::BYTES AS _bytes,
        		substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
        		'0.0.0.0'::INET + g AS _inet,
        		g::STRING::JSONB AS _jsonb,
        		enum_range('hello'::greeting)[g] as _enum
        	FROM
        		generate_series(1, 5) AS g;
        COMMIT;
        
        INSERT INTO seed DEFAULT VALUES;
        CREATE INDEX on seed (_int8, _float8, _date);
        CREATE INVERTED INDEX on seed (_jsonb);
        ;
    rsg_test.go:722: ALTER TABLE seed SPLIT AT VALUES (8840758865485822094);
    rsg_test.go:722: ALTER TABLE seed SPLIT AT VALUES (2006501665286497606);
    rsg_test.go:722: ALTER TABLE seed SPLIT AT VALUES (1412167556695033317);
    rsg_test.go:722: ALTER TABLE seed SCATTER;
    rsg_test.go:724: 
    rsg_test.go:725: -- test log scope end --
test logs left over in: /artifacts/tmp/_tmp/d437d2c847dfedbc4972f231c3331c8e/logTestRandomSyntaxSQLSmith725101915
--- FAIL: TestRandomSyntaxSQLSmith (383.08s)
Help

See also: How To Investigate a Go Test Failure (internal)

Same failure on other branches

/cc @cockroachdb/sql-foundations

This test on roachdash | Improve this report!

Jira issue: CRDB-37187

@cockroach-teamcity cockroach-teamcity added branch-release-23.2.4-rc C-test-failure Broken test (automatically or manually discovered). O-robot Originated from a bot. release-blocker Indicates a release-blocker. Use with branch-release-2x.x label to denote which branch is blocked. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) labels Mar 29, 2024
@cockroach-teamcity cockroach-teamcity added this to the 23.2 milestone Mar 29, 2024
@rafiss rafiss changed the title sql/tests: TestRandomSyntaxSQLSmith failed sql/tests: TestRandomSyntaxSQLSmith failed [unexpectedly unordered keys in jsonObject] Mar 29, 2024
@rafiss rafiss added T-sql-queries SQL Queries Team and removed T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) labels Mar 29, 2024
@github-project-automation github-project-automation bot moved this to Triage in SQL Queries Mar 29, 2024
@yuzefovich yuzefovich removed the release-blocker Indicates a release-blocker. Use with branch-release-2x.x label to denote which branch is blocked. label Mar 29, 2024
@yuzefovich yuzefovich self-assigned this Mar 29, 2024
@yuzefovich yuzefovich moved this from Triage to Active in SQL Queries Mar 29, 2024
@craig craig bot closed this as completed in c43f54c Apr 1, 2024
@craig craig bot closed this as completed in #121390 Apr 1, 2024
@github-project-automation github-project-automation bot moved this from Active to Done in SQL Queries Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch-release-23.2.4-rc C-test-failure Broken test (automatically or manually discovered). O-robot Originated from a bot. T-sql-queries SQL Queries Team
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants