Commit 3d78514
CRITICAL FIX: Generate SQL for JsonScalarExpression with empty path
ROOT CAUSE IDENTIFIED: VisitJsonScalar() was returning early when path.Count == 0,
which prevented SQL generation for entire JSON column projections.
THE FIX: When path is empty (selecting entire JSON column, not a nested property),
we now call Visit(jsonScalarExpression.Json) to generate the column name SQL.
This fixes the empty column projections (`, ,`) for complex JSON types. The issue
was that for complex JSON stored in JSON columns, when selecting the whole column
(not a nested property like `.Address.City`), the path is empty. The old code just
returned without generating any SQL, resulting in empty SELECT fragments.
This should resolve both:
1. Empty SQL projections causing "near ', ,'" syntax errors
2. Enable proper reading of JSON data as MemoryStream via MySqlStructuralJsonTypeMapping
Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>1 parent 69bfbe4 commit 3d78514
1 file changed
Lines changed: 31 additions & 1 deletion
Lines changed: 31 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
477 | 477 | | |
478 | 478 | | |
479 | 479 | | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
480 | 483 | | |
481 | 484 | | |
482 | 485 | | |
| |||
1049 | 1052 | | |
1050 | 1053 | | |
1051 | 1054 | | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
1052 | 1079 | | |
1053 | 1080 | | |
1054 | 1081 | | |
1055 | 1082 | | |
1056 | 1083 | | |
1057 | 1084 | | |
1058 | | - | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
1059 | 1089 | | |
1060 | 1090 | | |
1061 | 1091 | | |
| |||
0 commit comments