File tree Expand file tree Collapse file tree
src/EFCore.MySql/Query/ExpressionVisitors/Internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -516,7 +516,7 @@ protected override Expression VisitJsonScalar(JsonScalarExpression jsonScalarExp
516516 // MariaDB does not support CAST(... AS json), so skip the CAST entirely when JsonDataTypeEmulation is enabled.
517517 // MariaDB stores JSON as LONGTEXT, so no explicit cast is needed - the data is already in a compatible text format.
518518 // This prevents SQL syntax errors like "near 'json) IS NULL'" on MariaDB while maintaining correct NULL comparison semantics.
519- if ( castStoreType == "json" && _options . ServerVersion . Supports . JsonDataTypeEmulation )
519+ if ( castStoreType == "json" && _options ? . ServerVersion ? . Supports ? . JsonDataTypeEmulation == true )
520520 {
521521 castStoreType = null ;
522522 }
@@ -729,7 +729,7 @@ private SqlUnaryExpression VisitConvert(SqlUnaryExpression sqlUnaryExpression)
729729 // MariaDB does not support CAST(... AS json) syntax, so skip the conversion entirely when JsonDataTypeEmulation is enabled.
730730 // MariaDB stores JSON as LONGTEXT, so no explicit cast is needed - comparisons work correctly without it.
731731 // This avoids SQL syntax errors on MariaDB while maintaining correct NULL and equality comparison semantics.
732- if ( castMapping == "json" && _options . ServerVersion . Supports . JsonDataTypeEmulation )
732+ if ( castMapping == "json" && _options ? . ServerVersion ? . Supports ? . JsonDataTypeEmulation == true )
733733 {
734734 // For MariaDB with JsonDataTypeEmulation, skip the CAST by returning early
735735 Visit ( sqlUnaryExpression . Operand ) ;
You can’t perform that action at this time.
0 commit comments