不要怂,就是干,撸起袖子干!

Commit 20c432ca by Dirk Raeder

Using this.quoteIdentifier() to escape attribute names; fixing linting issue.

1 parent a9c51a84
Showing with 9 additions and 9 deletions
...@@ -379,17 +379,17 @@ module.exports = (function() { ...@@ -379,17 +379,17 @@ module.exports = (function() {
this.createTableQuery(tableName, attributes), this.createTableQuery(tableName, attributes),
"INSERT INTO <%= tableName %> SELECT <%= attributeNamesExport %> FROM <%= tableName %>_backup;", "INSERT INTO <%= tableName %> SELECT <%= attributeNamesExport %> FROM <%= tableName %>_backup;",
"DROP TABLE <%= tableName %>_backup;" "DROP TABLE <%= tableName %>_backup;"
].join("") ].join("");
return Utils._.template(query, { return Utils._.template(query, {
tableName: tableName, tableName: tableName,
attributeNamesImport: Utils._.keys(attributes).map(function(attr) { attributeNamesImport: Utils._.keys(attributes).map(function(attr) {
return (attrNameAfter === attr) ? '`' + attrNameBefore + '` AS `' + attr + '`' : '`' + attr + '`' return (attrNameAfter === attr) ? this.quoteIdentifier(attrNameBefore) + ' AS ' + this.quoteIdentifier(attr) : this.quoteIdentifier(attr);
}.bind(this)).join(', '), }.bind(this)).join(', '),
attributeNamesExport: Utils._.keys(attributes).map(function(attr) { attributeNamesExport: Utils._.keys(attributes).map(function(attr) {
return '`' + attr + '`' return this.quoteIdentifier(attr);
}.bind(this)).join(', ') }.bind(this)).join(', ')
}) });
}, },
startTransactionQuery: function(options) { startTransactionQuery: function(options) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!