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

roachtest/sqlsmith: missing non-null check in crdb_internal.num_inverted_index_entries #95671

Closed
cockroach-teamcity opened this issue Jan 23, 2023 · 1 comment · Fixed by #95782
Assignees
Labels
branch-master Failures and bugs on the master branch. C-test-failure Broken test (automatically or manually discovered). O-roachtest O-robot Originated from a bot. T-sql-queries SQL Queries Team
Milestone

Comments

@cockroach-teamcity
Copy link
Member

cockroach-teamcity commented Jan 23, 2023

roachtest.sqlsmith/setup=empty/setting=no-mutations failed with artifacts on master @ b21379bb56dd206e6f63cc7d07ca72e85db7a4c4:

test artifacts and logs in: /artifacts/sqlsmith/setup=empty/setting=no-mutations/run_1
(sqlsmith.go:238).func3: error: pq: internal error: interface conversion: tree.Datum is tree.dNull, not *tree.DTSVector
stmt:
SELECT
	"tAb7262"."co%ql12512" AS "%qcO😽l12516"
FROM
	(
		VALUES
			(864229827:::OID, '02:18:42.035193-08:56:00':::TIMETZ),
			(
				to_regnamespace(substring(('160.88.15.9/19':::INET::INET || '':::STRING::STRING)::STRING::STRING, (-8629663990470956947):::INT8::INT8, crdb_internal.num_inverted_index_entries(NULL::TSVECTOR, NULL::INT8)::INT8::INT8)::STRING::STRING)::REGTYPE,
				'04:37:28.021739+07:51:00':::TIMETZ
			)
	)
		AS tab7259 ("c%8aol\n12505", "c""ol12506"),
	(
		VALUES
			(
				ARRAY['04:32:56.475511':::TIME,'16:21:19.645783':::TIME],
				3470497017:::OID,
				0.021202831135921474:::FLOAT8,
				NULL,
				sqrt(NULL::DECIMAL)::DECIMAL,
				('\xa50c4476ef4533':::BYTES::BYTES || ('\xb03d042b':::BYTES::BYTES || '\x1a08f6f3969cd672':::BYTES::BYTES)::BYTES::BYTES)::BYTES
			),
			(
				ARRAY['11:41:09.662716':::TIME,'04:15:50.529397':::TIME,'00:54:48.792307':::TIME,'02:11:12.583519':::TIME],
				1013374301:::OID,
				0.5307150193789858:::FLOAT8,
				'{"abexvGTFv": {"Q51qvr5A": false, "b": "lsflGw0a"}, "b": 0.39768643802967646, "bar": {"baz": true, "kfgSrF": null}}':::JSONB,
				(-1.738577268608408482E+33):::DECIMAL,
				'\x00':::BYTES
			),
			(
				ARRAY['00:35:05.017166':::TIME],
				2863168604:::OID,
				(-0.5101448055793218):::FLOAT8,
				'[{"a": true, "b": "4d1"}, [[{"ZdzR": "foo", "b": [{"foo": true}, "c"]}, [true, null, false], {"yoBhB5FUO": false}, true], [{"Dq": true, "c": 0.3173223545448609}, [null], true], false, 0.55489286668244], [null, false, 0.8262289106313667], 1.1947069767514686, 1.39108855135321]':::JSONB,
				(-1.549089700846224458E+33):::DECIMAL,
				'\xa90b71521243':::BYTES
			)
	)
		AS "tAb7262" (col12509, col12510, col12511, "co%ql12512", col12513, "c😙o l12514")
	LEFT JOIN (VALUES (NULL)) AS "Tab7263" (col12515) ON false
ORDER BY
	tab7259."c""ol12506" DESC NULLS FIRST
LIMIT
	79:::INT8;

Parameters: ROACHTEST_cloud=gce , ROACHTEST_cpu=4 , ROACHTEST_encrypted=false , ROACHTEST_ssd=0

Help

See: roachtest README

See: How To Investigate (internal)

/cc @cockroachdb/sql-queries

This test on roachdash | Improve this report!

Jira issue: CRDB-23669

@cockroach-teamcity cockroach-teamcity added branch-master Failures and bugs on the master branch. C-test-failure Broken test (automatically or manually discovered). O-roachtest O-robot Originated from a bot. labels Jan 23, 2023
@cockroach-teamcity cockroach-teamcity added this to the 23.1 milestone Jan 23, 2023
@blathers-crl blathers-crl bot added the T-sql-queries SQL Queries Team label Jan 23, 2023
@msirek
Copy link
Contributor

msirek commented Jan 24, 2023

Simplified test case:

SELECT crdb_internal.num_inverted_index_entries(NULL::TSVECTOR, NULL::INT8);

Original SQL:

SELECT
	"tAb7262"."co%ql12512" AS "%qcO😽l12516"
FROM
	(
		VALUES
			(864229827:::OID, '02:18:42.035193-08:56:00':::TIMETZ),
			(
				to_regnamespace(substring(('160.88.15.9/19':::INET::INET || '':::STRING::STRING)::STRING::STRING, (-8629663990470956947):::INT8::INT8, crdb_internal.num_inverted_index_entries(NULL::TSVECTOR, NULL::INT8)::INT8::INT8)::STRING::STRING)::REGTYPE,
				'04:37:28.021739+07:51:00':::TIMETZ
			)
	)
		AS tab7259 ("c%8aol\n12505", "c""ol12506"),
	(
		VALUES
			(
				ARRAY['04:32:56.475511':::TIME,'16:21:19.645783':::TIME],
				3470497017:::OID,
				0.021202831135921474:::FLOAT8,
				NULL,
				sqrt(NULL::DECIMAL)::DECIMAL,
				('\xa50c4476ef4533':::BYTES::BYTES || ('\xb03d042b':::BYTES::BYTES || '\x1a08f6f3969cd672':::BYTES::BYTES)::BYTES::BYTES)::BYTES
			),
			(
				ARRAY['11:41:09.662716':::TIME,'04:15:50.529397':::TIME,'00:54:48.792307':::TIME,'02:11:12.583519':::TIME],
				1013374301:::OID,
				0.5307150193789858:::FLOAT8,
				'{"abexvGTFv": {"Q51qvr5A": false, "b": "lsflGw0a"}, "b": 0.39768643802967646, "bar": {"baz": true, "kfgSrF": null}}':::JSONB,
				(-1.738577268608408482E+33):::DECIMAL,
				'\x00':::BYTES
			),
			(
				ARRAY['00:35:05.017166':::TIME],
				2863168604:::OID,
				(-0.5101448055793218):::FLOAT8,
				'[{"a": true, "b": "4d1"}, [[{"ZdzR": "foo", "b": [{"foo": true}, "c"]}, [true, null, false], {"yoBhB5FUO": false}, true], [{"Dq": true, "c": 0.3173223545448609}, [null], true], false, 0.55489286668244], [null, false, 0.8262289106313667], 1.1947069767514686, 1.39108855135321]':::JSONB,
				(-1.549089700846224458E+33):::DECIMAL,
				'\xa90b71521243':::BYTES
			)
	)
		AS "tAb7262" (col12509, col12510, col12511, "co%ql12512", col12513, "c😙o l12514")
	LEFT JOIN (VALUES (NULL)) AS "Tab7263" (col12515) ON false
ORDER BY
	tab7259."c""ol12506" DESC NULLS FIRST
LIMIT
	79:::INT8;

ERROR: internal error: interface conversion: tree.Datum is tree.dNull, not *tree.DTSVector
SQLSTATE: XX000
DETAIL: stack trace:
github.com/cockroachdb/cockroach/pkg/util/errorutil/catch.go:29: ShouldCatch()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/builder.go:193: func1()
GOROOT/src/runtime/panic.go:884: gopanic()
GOROOT/src/runtime/iface.go:262: panicdottypeE()
GOROOT/src/runtime/iface.go:272: panicdottypeI()
github.com/cockroachdb/cockroach/pkg/sql/sem/builtins/builtins.go:5955: func274()
github.com/cockroachdb/cockroach/pkg/sql/sem/eval/expr.go:479: EvalFuncExpr()
github.com/cockroachdb/cockroach/bazel-out/k8-fastbuild/bin/pkg/sql/sem/tree/eval_expr_generated.go:276: Eval()
github.com/cockroachdb/cockroach/pkg/sql/sem/eval/expr.go:26: Expr()
github.com/cockroachdb/cockroach/pkg/sql/opt/norm/fold_constants_funcs.go:687: FoldFunction()
github.com/cockroachdb/cockroach/bazel-out/k8-fastbuild/bin/pkg/sql/opt/norm/factory.og.go:20130: ConstructFunction()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/scalar.go:569: buildFunction()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/scalar.go:333: buildScalar()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/scalar.go:565: buildFunction()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/scalar.go:333: buildScalar()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/scalar.go:565: buildFunction()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/scalar.go:333: buildScalar()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/values.go:94: buildValuesClause()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:1000: buildSelectStmtWithoutParens()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:961: func1()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/with.go:116: processWiths()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:960: buildSelect()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:895: buildSelectStmt()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:157: buildDataSource()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:67: buildDataSource()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:1219: buildFromTablesRightDeep()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:1196: buildFromTables()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:1123: buildFrom()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:1044: buildSelectClause()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:992: buildSelectStmtWithoutParens()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:961: func1()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/with.go:116: processWiths()

@yuzefovich yuzefovich self-assigned this Jan 24, 2023
@yuzefovich yuzefovich changed the title roachtest: sqlsmith/setup=empty/setting=no-mutations failed roachtest/sqlsmith: missing non-null check in crdb_internal.num_inverted_index_entries Jan 24, 2023
@craig craig bot closed this as completed in 0f5863a Jan 25, 2023
@mgartner mgartner moved this to Done in SQL Queries Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch-master Failures and bugs on the master branch. C-test-failure Broken test (automatically or manually discovered). O-roachtest 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