vitessio / vitess

Vitess is a database clustering system for horizontal scaling of MySQL.
http://vitess.io
Apache License 2.0
18.19k stars 2.06k forks source link

sql: Vitess cannot support Grafana 10+ CTEs #13632

Open derekperkins opened 11 months ago

derekperkins commented 11 months ago

We've used Vitess for Grafana persistence for several years, but after upgrading to v10, certain functionality including dashboard list/search fails due to usage of CTEs. This is a known issue, I just wanted to call this out specifically since we have tracked compatibility with major projects in the past. Feel free to close if it isn't useful, but it'll at least help anyone searching.

"Search failed" error="Error 1235: unsupported: with expression in select statement"

Related issues:

systay commented 6 months ago

@derekperkins Any chance you could share the query that is breaking vtgate?

derekperkins commented 4 months ago

There's a test here for recursive queries https://github.com/grafana/grafana/blob/main/pkg/services/sqlstore/sqlstore.go#L363-L392

And a comment about how it relates to Vitess https://github.com/grafana/grafana/issues/73725#issuecomment-1793547863

derekperkins commented 4 months ago

I submitted a PR based on that comment, hopefully they accept it and it works

derekperkins commented 3 months ago

Still trying to get this to work. There has been no movement on the original PR.

This has been longer coming, but go-sql-driver/mysql just released a new version that supports a / in the db name. I also have a PR into Grafana to use that new dependency, so that I can use shard targeting to allow the recursive queries to execute, which should be more reliable long-term.