Permalink
Browse files

fix problem with mismatched number of parameters

  • Loading branch information...
Brian Bruns
Brian Bruns committed Aug 4, 2011
1 parent 313b73d commit 7cbbbf5cd76e7be5243cba7c080d43759c137703
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/db.c
View
@@ -581,11 +581,12 @@ dbrelay_resolve_params(dbrelay_request_t *request, char *sql)
}
while (request->params[i]) {
prevpos = pos;
- pos += dbrelay_find_placeholder(&tmpsql[pos]);
+ pos = dbrelay_find_placeholder(&tmpsql[pos]);
if (pos==-1) {
// ignore missing placeholders
pos = prevpos;
} else {
+ pos = prevpos + pos;
tmpsql[pos]='\0';
sb_append(sb, &tmpsql[prevpos]);
if (is_quoted_param(request->params[i])) sb_append(sb, "'");

0 comments on commit 7cbbbf5

Please sign in to comment.