Skip to content

sql: st_union produces incorrect results, and causes internal error with ORDER BY #89572

@cockroach-teamcity

Description

@cockroach-teamcity

roachtest.unoptimized-query-oracle/disable-rules=all failed with artifacts on master @ ded91681f2be8816238a05850170bde7f61b209f:

test artifacts and logs in: /artifacts/unoptimized-query-oracle/disable-rules=all/run_1
(query_comparison_util.go:234).runOneRoundQueryComparison: . 11806 statements run: expected unoptimized and optimized results to be equal
  []string{
  	strings.Join({
  		"0000-01-01 00:01:41 +0600 +0600,01060000000200000001030000000100",
  		"000004000000000000000000",
- 		"34400000000000804640000000000000444000000000000044",
+ 		"44400000000000004440000000000000344000000000008046",
  		"4000000000008046400000000000003E40000000000000",
- 		"344000000000008046",
+ 		"444000000000000044",
  		"4001030000000200000006000000000000000000",
- 		"24400000000000003E4000000000000034400000000000804140000000000080",
- 		"46400000000000003",
+ 		"3440000000000080414000000000000024400000000000003E40000000000000",
+ 		"24400000000000002",
  		"4400000000000003E4000000000000014400000000000",
- 		"002440000000000000244000000000000024400000000000003E",
+ 		"8046400000000000003440000000000000344000000000008041",
  		"40040000000000000000003",
- 		"4400000000000002E400000000000003E4000000000000034",
+ 		"E40000000000000344000000000000034400000000000002E",
  		"40000000000000344000000000000039400000000000003",
- 		"4400000000000002E",
+ 		"E4000000000000034",
  		"40",
  	}, ""),
  	"0000-01-01 00:01:41 +0600 +0600,NULL",
  }
sql: SELECT
	'00:01:41+06:00:00':::TIMETZ AS col_47093, st_memunion(tab_14085.col1_3::GEOMETRY)::GEOMETRY AS col_47094
FROM
	defaultdb.public.table1@[0] AS tab_14084
	JOIN defaultdb.public.table1@[0] AS tab_14085 ON (tab_14084.col1_14) = (tab_14085.col1_14)
GROUP BY
	tab_14085.col1_3, tab_14085.col1_0
HAVING
	every(tab_14085.col1_14::BOOL)::BOOL

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-20309

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-test-failureBroken test (automatically or manually discovered).O-roachtestO-robotOriginated from a bot.S-3Medium-low impact: incurs increased costs for some users (incl lower avail, recoverable bad data)T-sql-queriesSQL Queries Teambranch-masterFailures and bugs on the master branch.

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions