commit 49da992285fe302d3c6e8bbfd8192f1832a16831
parent ea12afa045042a2e6042648c2c31b8caecdada3c
Author: Dan Stillman <dstillman@zotero.org>
Date: Fri, 5 Apr 2013 01:19:05 -0400
Fix queryMethod error
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/chrome/content/zotero/xpcom/db.js b/chrome/content/zotero/xpcom/db.js
@@ -247,10 +247,6 @@ Zotero.DBConnection.prototype.getStatement = function (sql, params, checkParams)
throw ("Cannot access database layer from a higher wait level if a transaction is open");
}
- // First, determine the type of query using first word
- var matches = sql.match(/^[^\s\(]*/);
- var queryMethod = matches[0].toLowerCase();
-
[sql, params] = this.parseQueryAndParams(sql, params);
try {
@@ -372,6 +368,10 @@ Zotero.DBConnection.prototype.getStatement = function (sql, params, checkParams)
Zotero.DBConnection.prototype.parseQueryAndParams = function (sql, params) {
if (params) {
+ // First, determine the type of query using first word
+ var matches = sql.match(/^[^\s\(]*/);
+ var queryMethod = matches[0].toLowerCase();
+
// If single scalar value or single non-array object, wrap in an array
if (typeof params != 'object' || params === null ||
(typeof params == 'object' && !params.length)) {