Skip to content

Commit

Permalink
Escape reserved SQL properties names
Browse files Browse the repository at this point in the history
  • Loading branch information
eduard93 committed Mar 23, 2017
1 parent 58cb1ce commit dc52f24
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Form/JSON/SQL.cls.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Is this column reference valid.
set currentClass = $case(j, 1:conditionClass, :##class(Form.Property).getPropertyType(currentClass, currentProperty)) // first piece - conditionClass, otherwise - previous class
set currentProperty = $piece(column,"->",j)
// Last property may be an ID (which is not a %Dictionary.CompiledProperty cilumn,
// Last property may be an ID (which is not a %Dictionary.CompiledProperty column,
// so quit from the for cycle
if ((j=length) && ($zcvt(currentProperty, "U") = "ID")) {
set columnOut = columnOut _ "ID"
Expand All @@ -140,6 +140,7 @@ Is this column reference valid.
// Get property SQL name (usually equal to property name)
set currentPropertySQLName = ##class(Form.Property).getPropertySQLName(currentClass, currentProperty)
set:$system.SQL.IsReservedWord(currentPropertySQLName) currentPropertySQLName = """" _ currentPropertySQLName _ """"
// Append property SQL name to resulting sql expression
set columnOut = columnOut _ currentPropertySQLName
Expand Down

0 comments on commit dc52f24

Please sign in to comment.