diff --git a/lib/mysql.js b/lib/mysql.js index 7fabe86..a57f6bb 100644 --- a/lib/mysql.js +++ b/lib/mysql.js @@ -339,7 +339,7 @@ function buildOrderBy(order) { order = [order]; } return 'ORDER BY ' + order.map(function(o) { - var t = o.split(/\s+/); + var t = o.split(/[\s,]+/); if (t.length === 1) return '`' + o + '`'; return '`' + t[0] + '` ' + t[1]; }).join(', ');