-
Notifications
You must be signed in to change notification settings - Fork 383
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
Upgrade to EF Core 8.0.0-rc.1 #1791
Conversation
…illiseconds() support.
…roperty).ElementAt(index), because it messes-up our JSON-Array handling in `MySqlSqlTranslatingExpressionVisitor`. See dotnet/efcore#30386.
b6a5a9a
to
af0bb36
Compare
af0bb36
to
7d8b579
Compare
Ouch, sorry to hear about these database engine issues @lauxjpn... Hopefully getting everything working in the old constant mode didn't present too many difficulties (as we also do in SQL Server when the compatibility level is too old). Any issues on the MySQL/MariaDB side tracking these?? It certainly isn't great if the engine itself crashes 😅 |
@roji Yeah, that is what we are currently doing. We will cleanup some code for the next release and will probably duplicate the test class a couple of times for the different database engine version and workaround cases.
I have not filed the bugs yet, but will over the next days, after I assembled the respective MREs. If Oracle isn't fixing this in a timely manner, I might do it myself to figure out appropriate workarounds along the way that we can implement. |
Yeah, we similarly have two implementations of PrimitiveCollectionsQueryRelationalTestBase, one for modern SQL Server and one with the compatibility flag set, where the older expand-to-constant strategy is used (source code).
Good luck! It will be interesting to follow what happens with this, and I hope MySQL/MariaDB get to a place where JSON_TABLE can be used safely by anyone... |
@lauxjpn Really appreciate your hard work on this, as always. |
Indeed! |
@lauxjpn Late to the party here, but I'm currently looking into primitive collections and especially the Also, I tried enabling the option (see below) but I still get a "Primitive collections support has not been enabled" (using v8.0.2)
|
The order of the options extensions is important. If I move However, a standard EF query that produces correct results in a SQLite database, does not produce any result at all in MySQL so there might still be some issues with the implementation. |
The upgrade is compatible with EF Core 8.0 RC1.
Everything compiles and all supported tests are green for all officially supported database engine versions:
The following versions have reached their end-of-live and are not actively tested by us anymore (but are expected to work anyway):
We currently have the following test statistics (here for MySQL 8):
Primitive collections support
There are some serious bugs in the implementation of
JSON_TABLE()
in both, MySQL and MariaDB.Because of that, we have disabled primitive collections support by default for now.
It can be enabled using the
EnablePrimitiveCollectionsSupport
option. If you do, make sure you read about possible issues below.MySQL
While current versions of MySQL pretty much implement the whole spectrum that we need for proper primitive collections support, there are multiple fatal bugs that will crash the MySQL database engine (not the Pomelo provider, but the actual
mysqld
process).Most crashes are connected to using a parameter that contains a JSON array as the source of the
JSON_TABLE()
call (e.g.... FROM JSON_TABLE(@p0, ...)
with@p0 = "[1,2,3]"
). The bug is kind of non-deterministic and only crashes the database engine process after a couple of those queries.We work around this bug by inlining those constant values directly into the SQL, instead of using the parameter.
There is at least one more bug, that is deterministic and crashes the database engine process immediately every single time. This can be reproduced by running any of the following two tests:
NorthwindSelectQueryMySqlTest.Correlated_collection_after_distinct_not_containing_original_identifier(bool async)
NorthwindSelectQueryMySqlTest.Correlated_collection_after_groupby_with_complex_projection_not_containing_original_identifier(bool async)
MariaDB
MariaDB does not crash, but it still does not supports
LATERAL
join support (which is in many cases implicitly needed to makeJSON_TABLE()
useful).If aggregates are used over
JSON_TABLE()
(e.g.COUNT(*)
), then a referenced column from the outer table will always contain the value of the first row, instead of the current row, which is very much unexpected.Referencing columns further up is not supported at all (due to missing
LATERAL
join support).There are additional cases, where MariaDB behaves oddly, that have to be investigated further.
This all results in many primitive collection queries not working, when using
JSON_TABLE()
.Addresses #1746
Fixes #1784