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/setup=empty/setting=default failed #51099

Closed
cockroach-teamcity opened this issue Jul 7, 2020 · 4 comments · Fixed by #51154
Closed

roachtest: sqlsmith/setup=empty/setting=default failed #51099

cockroach-teamcity opened this issue Jul 7, 2020 · 4 comments · Fixed by #51154
Assignees
Labels
C-test-failure Broken test (automatically or manually discovered). O-roachtest 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.
Milestone

Comments

@cockroach-teamcity
Copy link
Member

(roachtest).sqlsmith/setup=empty/setting=default failed on provisional_202007071743_v20.2.0-alpha.2@0b6e118bc1bcba4cfb4fc6c660153ec5be3989e8:

The test failed on branch=provisional_202007071743_v20.2.0-alpha.2, cloud=gce:
test artifacts and logs in: /home/agent/work/.go/src/github.com/cockroachdb/cockroach/artifacts/sqlsmith/setup=empty/setting=default/run_1
	sqlsmith.go:169,sqlsmith.go:199,test_runner.go:757: error: pq: internal error: inconsistent Case return types bool unknown
		stmt:
		WITH
			with_60 (col_342)
				AS (
					SELECT
						'-2000-01-01 00:00:00+00:00':::TIMESTAMP AS col_342
					FROM
						(
							VALUES
								(true, (SELECT 2409586731:::OID AS col_339 LIMIT 1:::INT8)),
								(true, 276957771:::OID),
								(
									CASE
									WHEN st_overlaps(st_geomfromgeojson('pw':::STRING::STRING)::GEOMETRY::GEOMETRY, '0101000000000000000000F03F000000000000F03F':::GEOMETRY::GEOMETRY)::BOOL
									THEN false
									ELSE (NULL AND true)
									END,
									3378038347:::OID
								),
								(NULL, 3587599014:::OID),
								(NULL, 3142601850:::OID)
						)
							AS tab_203 (col_340, col_341)
				)
		SELECT
			tab_204.col_343 AS col_344
		FROM
			(VALUES ('':::STRING), ('':::STRING), (NULL), (NULL), ('U>%"~N':::STRING)) AS tab_204 (col_343)
		WHERE
			true
		ORDER BY
			tab_204.col_343 ASC
		LIMIT
			1:::INT8;

More

Artifacts: /sqlsmith/setup=empty/setting=default
Related:

See this test on roachdash
powered by pkg/cmd/internal/issues

@cockroach-teamcity cockroach-teamcity added branch-provisional_202007071743_v20.2.0-alpha.2 C-test-failure Broken test (automatically or manually discovered). O-roachtest 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. labels Jul 7, 2020
@cockroach-teamcity cockroach-teamcity added this to the 20.2 milestone Jul 7, 2020
@yuzefovich yuzefovich assigned otan and unassigned andreimatei Jul 8, 2020
@yuzefovich
Copy link
Member

ERROR: internal error: inconsistent Case return types bool unknown
SQLSTATE: XX000
DETAIL: stack trace:
github.com/cockroachdb/cockroach/pkg/sql/opt/memo/typing.go:77: InferWhensType()
github.com/cockroachdb/cockroach/pkg/sql/opt/memo/typing.go:339: typeCase()
github.com/cockroachdb/cockroach/pkg/sql/opt/memo/typing.go:35: InferType()
github.com/cockroachdb/cockroach/pkg/sql/opt/memo/expr.og.go:19001: MemoizeCase()
github.com/cockroachdb/cockroach/pkg/sql/opt/norm/factory.og.go:15827: ConstructCase()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/scalar.go:247: buildScalar()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/values.go:86: buildValuesClause()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:990: buildSelectStmtWithoutParens()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:955: func1()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/with.go:29: processWiths()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:954: buildSelect()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:889: buildSelectStmt()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:145: buildDataSource()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:64: buildDataSource()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:1209: buildFromTablesRightDeep()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:1186: buildFromTables()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:1113: buildFrom()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:1034: buildSelectClause()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:982: buildSelectStmtWithoutParens()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:955: func1()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/with.go:29: processWiths()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:954: buildSelect()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/builder.go:248: buildStmt()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/with.go:38: buildCTE()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:792: buildCTEs()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/with.go:26: processWiths()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:954: buildSelect()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/builder.go:248: buildStmt()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/builder.go:212: buildStmtAtRoot()
github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/builder.go:183: Build()
github.com/cockroachdb/cockroach/pkg/sql/plan_opt.go:489: buildExecMemo()
github.com/cockroachdb/cockroach/pkg/sql/plan_opt.go:173: makeOptimizerPlan()

@yuzefovich
Copy link
Member

cc @RaduBerinde

@otan
Copy link
Contributor

otan commented Jul 8, 2020

I think this is a failure of AND, (NULL AND true) returns NULL hence causing the issue.

@RaduBerinde RaduBerinde self-assigned this Jul 8, 2020
@RaduBerinde
Copy link
Member

Right, smaller repro: SELECT CASE WHEN random() > 0.5 THEN false ELSE (NULL AND true) END

craig bot pushed a commit that referenced this issue Jul 10, 2020
51023: opt: improve re-typing to equivalent but non-identical types r=RaduBerinde a=RaduBerinde

I noticed that the `ReType` function uses `Equivalent`. This is not strict
enough if our expectation is that the re-typed expression will have the wanted
`ResolvedType()`. This commit changes this to use `Identical`.

Release note: None

51154: opt: retype AND/OR/NOT arguments as Bool r=RaduBerinde a=RaduBerinde

We have made CASE more strict in terms of input types, and this is uncovering
other cases. We will need to have more strict assertions about the types of
scalars in the optimizer instead of sqlsmith weeding out these issues.

Fixes #51099.

Release note (bug fix): fixed an internal error involving CASE and boolean
expressions with NULL operands.

51256: geo: validate geospatial objects r=sumeerbhola a=otan

This commit validate geospatial objects properties before their
creation. LineStrings should have at least 2 points, Polygons at least
4 per LinearRing and must be closed.

Resolves #51074.

Release note: None

51303: builtins: fix possible out of bounds in regexp_replace r=yuzefovich a=yuzefovich

It is possible that a regex matches the input string yet capture
groups end up being empty. Previously, in such cases we would hit an
internal error (due to out of bounds panic because values in
`matchIndex` would be negative), and now this is fixed by making sure
that capture groups are not empty.

Fixes: #51289.

Release note (bug fix): Previously, CockroachDB could hit an
internal error when executing `regexp_replace` builtin, and
this has been fixed.

Co-authored-by: Radu Berinde <radu@cockroachlabs.com>
Co-authored-by: Oliver Tan <otan@cockroachlabs.com>
Co-authored-by: Yahor Yuzefovich <yahor@cockroachlabs.com>
@craig craig bot closed this as completed in 2638bd1 Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-test-failure Broken test (automatically or manually discovered). O-roachtest 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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants