Skip to content

Commit dc52f24

Browse files
committed
Escape reserved SQL properties names
1 parent 58cb1ce commit dc52f24

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Form/JSON/SQL.cls.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Is this column reference valid.
126126
set currentClass = $case(j, 1:conditionClass, :##class(Form.Property).getPropertyType(currentClass, currentProperty)) // first piece - conditionClass, otherwise - previous class
127127
set currentProperty = $piece(column,"->",j)
128128
129-
// Last property may be an ID (which is not a %Dictionary.CompiledProperty cilumn,
129+
// Last property may be an ID (which is not a %Dictionary.CompiledProperty column,
130130
// so quit from the for cycle
131131
if ((j=length) && ($zcvt(currentProperty, "U") = "ID")) {
132132
set columnOut = columnOut _ "ID"
@@ -140,6 +140,7 @@ Is this column reference valid.
140140
141141
// Get property SQL name (usually equal to property name)
142142
set currentPropertySQLName = ##class(Form.Property).getPropertySQLName(currentClass, currentProperty)
143+
set:$system.SQL.IsReservedWord(currentPropertySQLName) currentPropertySQLName = """" _ currentPropertySQLName _ """"
143144
144145
// Append property SQL name to resulting sql expression
145146
set columnOut = columnOut _ currentPropertySQLName

0 commit comments

Comments
 (0)