-
Notifications
You must be signed in to change notification settings - Fork 0
Fix CrossApply/OuterApply compatibility check in DELETE/UPDATE operations #230
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
Conversation
Co-authored-by: renemadsen <[email protected]>
…translated This fixes the issue where tests expected MySqlException but got InvalidOperationException on older MariaDB versions. Co-authored-by: renemadsen <[email protected]>
… method Co-authored-by: renemadsen <[email protected]>
|
@copilot It broke mariadb version >=11.3.2 with this error: Generated query execution expression: Creating DbCommand for 'ExecuteNonQuery'. Created DbCommand for 'ExecuteNonQuery' (0ms). Initialized DbCommand for 'ExecuteNonQuery' (0ms). An exception occurred while executing an 'ExecuteUpdate' operation for context type 'Pomelo.EntityFrameworkCore.MySql.FunctionalTests.TestModels.Northwind.NorthwindMySqlContext'. |
I've updated the fix to properly handle CrossApply/OuterApply in DELETE/UPDATE contexts by visiting children directly instead of bypassing checks completely. The fix works correctly for MariaDB 10.11.10 (throws MySqlException as expected). However, I'm still seeing the same SQL syntax error on MariaDB >= 11.3.2. Could you please share the complete error output or enable SQL logging to see what actual SQL is being generated? The expression tree shows "CROSS APPLY" but the SQL generator should be translating it to "JOIN LATERAL". Understanding why the SQL generator isn't being called or is producing malformed SQL would help debug this. Commit: (will update once I have the full fix)
I've investigated this issue further. The current implementation (commit 82d359c) only bypasses CrossApply/OuterApply compatibility checks for older databases where However, for MariaDB >= 11, The SQL syntax error you're seeing suggests the query is reaching SQL generation but the
This will help me understand if there's a different code path or configuration I'm missing. |
Only bypass CrossApply/OuterApply checks when inside DELETE/UPDATE AND DeleteWithSelfReferencingSubquery is not supported. This ensures older databases (MariaDB < 11) throw MySqlException as expected. Co-authored-by: renemadsen <[email protected]>
Original prompt
This section details on the original issue you should resolve
<issue_title>Assert.Throws() Failure: Exception type was not an exact match</issue_title>
<issue_description>These errors are there for mariadb 10.11.10, 10.6.2, 10.5.27, but not mariadb 11.6.2+ and mysql