h2database / h2database/h2database

CTE never ends

Open
#4,173 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
4.6k
Forks
1.3k
Avg merge
1d 2h
Merged PRs (30d)
9

Description

The following CTE never ends in H2 2.3.232, although it does in MySQL:

with recursive
	mutations(time, old, new) as (
		select 1, 'A', 'B' union
		select 2, 'B', 'C' union
		select 3, 'B', 'B' union
		select 4, 'A', 'A' union
		select 5, 'C', 'B' union
		select 6, 'C', 'C' union
		select 7, 'A', 'B' union
		select 8, 'D', 'E'
	),
	permutations(x, y) as (
		select new, old from mutations union
		select old, new from mutations
	),
	related(val) as (
		select ? union
		select x from related join permutations on y = val
	)
select val from related order by 1

CTE.java.txt

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Use CTE.java.txt and the SQL reproducer as the starting point; run it on H2 2.3.232 and compare its behavior with MySQL. Done when the recursive CTE terminates and a regression test captures the expected result.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, sql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.