From f84bbaa477cc48aefa8343b3e55751ed37996017 Mon Sep 17 00:00:00 2001 From: Timothy J Warren Date: Fri, 4 Dec 2015 09:13:26 -0500 Subject: [PATCH] Update travis build and simplify a nested if statement --- .travis.yml | 4 ++-- lib/QueryParser.js | 15 ++++++--------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0f60068..5a8085b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,8 +14,8 @@ before_script: - psql -c 'DROP DATABASE IF EXISTS test;' -U postgres - psql -c 'create database test;' -U postgres - mysql -e 'create database IF NOT EXISTS test;' - - mysql -v -uroot test < ./tests/sql/mysql.sql - - psql test postgres -f ./tests/sql/pgsql.sql + - mysql -v -uroot test < ./test/sql/mysql.sql + - psql test postgres -f ./test/sql/pgsql.sql script: gulp diff --git a/lib/QueryParser.js b/lib/QueryParser.js index e3beee6..a0510de 100644 --- a/lib/QueryParser.js +++ b/lib/QueryParser.js @@ -202,18 +202,15 @@ module.exports = class QueryParser { // Remove the value from the combined list // and replace it with a placeholder - if (combIndex !== -1) + if (combIndex !== -1 && funcIndex === -1) { // Make sure to skip functions when replacing values - if (funcIndex === -1) - { - parts.combined[combIndex] = '?'; + parts.combined[combIndex] = '?'; - if ( ! inOutputArray) - { - outputValues.push(value); - inOutputArray = true; - } + if ( ! inOutputArray) + { + outputValues.push(value); + inOutputArray = true; } } }