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=no-mutations failed #68308

Closed
cockroach-teamcity opened this issue Aug 1, 2021 · 4 comments · Fixed by #68627
Closed

roachtest: sqlsmith/setup=empty/setting=no-mutations failed #68308

cockroach-teamcity opened this issue Aug 1, 2021 · 4 comments · Fixed by #68627
Assignees
Labels
branch-master Failures and bugs on the master branch. C-test-failure Broken test (automatically or manually discovered). E-quick-win Likely to be a quick win for someone experienced. O-roachtest O-robot Originated from a bot. T-sql-queries SQL Queries Team

Comments

@cockroach-teamcity
Copy link
Member

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

The test failed on branch=master, cloud=gce:
test artifacts and logs in: /home/agent/work/.go/src/github.com/cockroachdb/cockroach/artifacts/sqlsmith/setup=empty/setting=no-mutations/run_1
	sqlsmith.go:217,sqlsmith.go:252,test_runner.go:777: error: pq: internal error: no volatility for cast tuple{timestamptz, int[], unknown}::tuple{timestamptz, int2[], unknown}
		stmt:
		WITH
			with_166382 (col_927225)
				AS (
					SELECT
						*
					FROM
						(VALUES (('0001-01-01 00:00:00+00:00':::TIMESTAMPTZ, ARRAY[]:::INT2[], NULL)))
							AS tab_537300 (col_927225)
					EXCEPT ALL
						SELECT
							*
						FROM
							(
								VALUES
									(
										('294276-12-31 23:59:59.999999+00:00':::TIMESTAMPTZ, ARRAY[(-32768):::INT8,0:::INT8,25203:::INT8], NULL)
									)
							)
								AS tab_537301 (col_927226)
				)
		SELECT
			tab_537302.col_927227 AS col_927228
		FROM
			(
				VALUES
					((-0.2372959852218628):::FLOAT8),
					(0.3741636276245117:::FLOAT8),
					((-0.2869168221950531):::FLOAT8),
					(1.1908493041992188:::FLOAT8),
					((-1.7612881660461426):::FLOAT8),
					((-0.4135175943374634):::FLOAT8)
			)
				AS tab_537302 (col_927227)
		WHERE
			true;
Reproduce

See: roachtest README

/cc @cockroachdb/sql-queries

This test on roachdash | Improve this report!

@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. release-blocker Indicates a release-blocker. Use with branch-release-2x.x label to denote which branch is blocked. labels Aug 1, 2021
@blathers-crl blathers-crl bot added the T-sql-queries SQL Queries Team label Aug 1, 2021
@cucaroach
Copy link
Contributor

@otan does this seem related to any recent work you have been doing?

@otan
Copy link
Contributor

otan commented Aug 3, 2021

Nope, this is a problem in v21.1.

SELECT
						*
					FROM
						(VALUES (('0001-01-01 00:00:00+00:00':::TIMESTAMPTZ, ARRAY[]:::INT2[], NULL)))
							AS tab_537300 (col_927225)
					EXCEPT ALL
						SELECT
							*
						FROM
							(
								VALUES
									(
										('294276-12-31 23:59:59.999999+00:00':::TIMESTAMPTZ, ARRAY[(-32768):::INT8,0:::INT8,25203:::INT8], NULL)
									)
							)
								AS tab_537301 (col_927226)

the problem is the NULL family doesn't exist as a cast.

@mgartner
Copy link
Collaborator

mgartner commented Aug 3, 2021

I'll take a look.

@mgartner mgartner self-assigned this Aug 3, 2021
@mgartner mgartner added the E-quick-win Likely to be a quick win for someone experienced. label Aug 10, 2021
@rytaft
Copy link
Collaborator

rytaft commented Aug 23, 2021

Removing release-blocker label since this was also a bug in 21.1

WITH
                        with_166382 (col_927225)
                                AS (
                                        SELECT
                                                *
                                        FROM
                                                (VALUES (('0001-01-01 00:00:00+00:00':::TIMESTAMPTZ, ARRAY[]:::INT2[], NULL)))
                                                        AS tab_537300 (col_927225)
                                        EXCEPT ALL
                                                SELECT
                                                        *
                                                FROM
                                                        (
                                                                VALUES
                                                                        (
                                                                                ('294276-12-31 23:59:59.999999+00:00':::TIMESTAMPTZ, ARRAY[(-32768):::INT8,0:::INT8,25203:::INT8], NULL)
                                                                        )
                                                        )
                                                                AS tab_537301 (col_927226)
                                )
                SELECT
                        tab_537302.col_927227 AS col_927228
                FROM
                        (
                                VALUES
                                        ((-0.2372959852218628):::FLOAT8),
                                        (0.3741636276245117:::FLOAT8),
                                        ((-0.2869168221950531):::FLOAT8),
                                        (1.1908493041992188:::FLOAT8),
                                        ((-1.7612881660461426):::FLOAT8),
                                        ((-0.4135175943374634):::FLOAT8)
                        )
                                AS tab_537302 (col_927227)
                WHERE
                        true;
*
* ERROR: [n1,client=127.0.0.1:60569,hostssl,user=demo] Queued as error 299190c8c20e417ca2f732cd041e4670
*
ERROR: internal error: no volatility for cast tuple{timestamptz, int[], unknown}::tuple{timestamptz, int2[], unknown}
SQLSTATE: XX000
DETAIL: stack trace:
/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/memo/logical_props_builder.go:1550: BuildSharedProps()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/memo/logical_props_builder.go:1474: buildProjectionsItemProps()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/memo/expr.og.go:8141: PopulateProps()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/norm/factory.og.go:10862: ConstructProjectionsItem()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/project.go:49: constructProject()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/union.go:215: addCasts()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/union.go:56: buildSetOp()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/union.go:36: buildUnionClause()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:967: buildSelectStmtWithoutParens()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:936: func1()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/with.go:29: processWiths()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:935: buildSelect()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/builder.go:265: buildStmt()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/with.go:38: buildCTE()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:773: buildCTEs()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/with.go:26: processWiths()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:935: buildSelect()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/builder.go:265: buildStmt()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/builder.go:229: buildStmtAtRoot()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/builder.go:200: Build()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/plan_opt.go:508: buildExecMemo()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/plan_opt.go:194: makeOptimizerPlan()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:948: makeExecPlan()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:829: dispatchToExecutionEngine()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:667: execStmtInOpenState()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:123: execStmt()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1527: func1()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1529: execCmd()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1450: run()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:484: ServeConn()
/go/src/github.com/cockroachdb/cockroach/pkg/sql/pgwire/conn.go:627: func1()
/usr/local/go/src/runtime/asm_amd64.s:1374: goexit()

HINT: You have encountered an unexpected error.

Please check the public issue tracker to check whether this problem is
already tracked. If you cannot find it there, please report the error
with details by creating a new issue.

If you would rather not post publicly, please contact us directly
using the support form.

We appreciate your feedback.

@rytaft rytaft removed the release-blocker Indicates a release-blocker. Use with branch-release-2x.x label to denote which branch is blocked. label Aug 23, 2021
craig bot pushed a commit that referenced this issue Aug 23, 2021
68627: sql: fix cast from unknown to unknown r=mgartner a=mgartner

Previously, an implicit cast performed in a set operation, like `UNION`,
on a tuple type with an unknown inner type would cause an internal
error. The cast failed because the volatility of a cast from unknown to
unknown was not specified in the `validCasts` list. This commit fixes
the issue by marking a such a cast as immutable.

Fixes #68308

Release note (bug fix): A bug has been fixed that caused internal errors
with set operations, like `UNION`, and columns with tuple types that
contained constant `NULL` values. This bug was introduced in version
20.2.

69253: sql: change column in tenant_usage table r=RaduBerinde a=RaduBerinde

The tenant usage table currently has the "last update" timestamp as an
instance-only field. This field is necessary for the per-tenant state
as well (it corresponds to the current bucket level).

This change renames the `instance_last_update` column to `last_update`
and moves it up to the group of columns that apply to all rows.

Since this table was introduced only on `master`, we don't add a new
migration.

Release justification: category 2, code only used for Serverless.

Release note: None

69261: settings: retire a setting only present on 21.1 branch r=yuzefovich a=yuzefovich

`sql.distsql.prefer_local_execution.enabled` was introduced during
a backport to 21.1 branch and is only present on that branch. This
commit is retiring that setting on 21.2 branch.

Retiring a setting introduced in #68613.

Release note: None

Release justification: This commit is safe for this release because it
is kinda non-production code change.

Co-authored-by: Marcus Gartner <[email protected]>
Co-authored-by: Radu Berinde <[email protected]>
Co-authored-by: Yahor Yuzefovich <[email protected]>
@craig craig bot closed this as completed in 51a5df0 Aug 24, 2021
blathers-crl bot pushed a commit that referenced this issue Aug 24, 2021
Previously, an implicit cast performed in a set operation, like `UNION`,
on a tuple type with an unknown inner type would cause an internal
error. The cast failed because the volatility of a cast from unknown to
unknown was not specified in the `validCasts` list. This commit fixes
the issue by marking a such a cast as immutable.

Fixes #68308

Release note (bug fix): A bug has been fixed that caused internal errors
with set operations, like `UNION`, and columns with tuple types that
contained constant `NULL` values. This bug was introduced in version
20.2.
blathers-crl bot pushed a commit that referenced this issue Aug 24, 2021
Previously, an implicit cast performed in a set operation, like `UNION`,
on a tuple type with an unknown inner type would cause an internal
error. The cast failed because the volatility of a cast from unknown to
unknown was not specified in the `validCasts` list. This commit fixes
the issue by marking a such a cast as immutable.

Fixes #68308

Release note (bug fix): A bug has been fixed that caused internal errors
with set operations, like `UNION`, and columns with tuple types that
contained constant `NULL` values. This bug was introduced in version
20.2.
@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). E-quick-win Likely to be a quick win for someone experienced. 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.

5 participants