Quote identifiers correctly in auto-complete. Fixes #1992

This commit is contained in:
Akshay Joshi 2016-12-05 13:15:03 +09:00 committed by Dave Page
parent a64824a851
commit e160909423

View File

@ -252,7 +252,14 @@ class SQLAutoComplete(object):
result = dict()
for m in matches:
result[m.completion.display] = {'object_type': m.completion.display_meta}
# Escape name only if meta type is not a keyword and datatype.
if m.completion.display_meta != 'keyword' and \
m.completion.display_meta != 'datatype':
name = self.escape_name(m.completion.display)
else:
name = m.completion.display
result[name] = {'object_type': m.completion.display_meta}
return result