Skip to content

sql: incorrectly folding interval + timetz constants #88128

@cockroach-teamcity

Description

@cockroach-teamcity

roachtest.unoptimized-query-oracle/disable-rules=half failed with artifacts on release-22.2 @ aac413cd4ca62f3392029b42219ebb2788979fb8:

test artifacts and logs in: /artifacts/unoptimized-query-oracle/disable-rules=half/run_1
	query_comparison_util.go:241,query_comparison_util.go:69,unoptimized_query_oracle.go:54,test_runner.go:908: . 11240 statements run: expected unoptimized and optimized results to be equal
		(1) attached stack trace
		  -- stack trace:
		  | github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests.(*queryComparisonHelper).makeError
		  | 	github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests/query_comparison_util.go:349
		  | [...repeated from below...]
		Wraps: (2) . 11240 statements run
		Wraps: (3) attached stack trace
		  -- stack trace:
		  | github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests.runUnoptimizedQueryOracleImpl
		  | 	github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests/unoptimized_query_oracle.go:168
		  | github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests.registerUnoptimizedQueryOracle.func1.1
		  | 	github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests/unoptimized_query_oracle.go:57
		  | github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests.runOneRoundQueryComparison
		  | 	github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests/query_comparison_util.go:240
		  | github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests.runQueryComparison
		  | 	github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests/query_comparison_util.go:69
		  | github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests.registerUnoptimizedQueryOracle.func1
		  | 	github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests/unoptimized_query_oracle.go:54
		  | main.(*testRunner).runTest.func2
		  | 	main/pkg/cmd/roachtest/test_runner.go:908
		  | runtime.goexit
		  | 	GOROOT/src/runtime/asm_amd64.s:1594
		Wraps: (4) expected unoptimized and optimized results to be equal
		  |   []string(
		  | - 	nil,
		  | + 	{
		  | + 		"1971-10-20 00:00:00 +0000 +0000,1994-01-16 18:08:33.000804 +0000 +0000,NULL,-52,1.080076098442201",
		  | + 		"1978-11-26 00:00:00 +0000 +0000,NULL,-4713-11-24 00:00:00 +0000 +0000,-52,-1.5810453658238734",
		  | + 		"1997-05-20 00:00:00 +0000 +0000,1969-12-21 01:23:56 +0000 +0000,NULL,-52,-2.2554494524197843",
		  | + 	},
		  |   )
		  | sql: SELECT
		  | 	tab_13574.col4_12 AS col_42422,
		  | 	tab_13574.col4_1 AS col_42423,
		  | 	tab_13574.col4_4 AS col_42424,
		  | 	(-52):::INT8 AS col_42425,
		  | 	tab_13574.col4_15 AS col_42426
		  | FROM
		  | 	defaultdb.public.table4@[0] AS tab_13574
		  | WHERE
		  | 	(('82 years 4 mons 815 days 18:54:38.623171':::INTERVAL::INTERVAL + ('00:01:40.1+06:00:00':::TIMETZ::TIMETZ + tab_13574.col4_7::INTERVAL)::TIMETZ::TIMETZ)::TIMETZ < '00:01:40.00001+09:00:00':::TIMETZ)
		  | ORDER BY
		  | 	tab_13574.col4_4 DESC
		Error types: (1) *withstack.withStack (2) *errutil.withPrefix (3) *withstack.withStack (4) *errutil.leafError

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

Help

See: roachtest README

See: How To Investigate (internal)

Same failure on other branches

/cc @cockroachdb/sql-queries

This test on roachdash | Improve this report!

Jira issue: CRDB-19703

Metadata

Metadata

Assignees

Labels

C-test-failureBroken test (automatically or manually discovered).O-roachtestO-robotOriginated from a bot.S-1High impact: many users impacted, serious risk of high unavailability or data lossT-sql-queriesSQL Queries Teambranch-masterFailures and bugs on the master branch.branch-release-22.1Used to mark GA and release blockers, technical advisories, and bugs for 22.1branch-release-22.2Used to mark GA and release blockers, technical advisories, and bugs for 22.2

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions