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

Bug Report: schemadiff: invalid schema when only entity is a view reading FROM DUAL #12188

Closed
shlomi-noach opened this issue Jan 30, 2023 · 0 comments · Fixed by #12189
Closed

Comments

@shlomi-noach
Copy link
Contributor

Overview of the Issue

In a scenario where the entire schema is:

create view v as select 1 from dual

We get a

view `v` has unresolved/loop dependencies

This is because of a delicate change in #11944 and a hidden assumption: that there's always going to be at least one table... In our case there isn't any table, and a counter was not incremented when the algorithm assumed it would be.

Reproduction Steps

func TestNewSchemaFromQueriesViewFromDual(t *testing.T) {
	queries := []string{
		"create view v20 as select 1 from dual",
	}
	_, err := NewSchemaFromQueries(queries)
	assert.NoError(t, err)
}

^ the above fails with error

Binary Version

-

Operating System and Environment details

-

Log Fragments

No response

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