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

CTE never ends #4173

Open
kalgon opened this issue Dec 23, 2024 · 0 comments
Open

CTE never ends #4173

kalgon opened this issue Dec 23, 2024 · 0 comments

Comments

@kalgon
Copy link

kalgon commented Dec 23, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant