From: Russ Tyndall Date: Wed, 3 Dec 2014 15:30:09 +0000 (-0500) Subject: fixed sqlite bug where sqlite-aref was called with incorrect args (thanks Zach) X-Git-Tag: v6.6.0~3 X-Git-Url: http://git.kpe.io/?p=clsql.git;a=commitdiff_plain;h=f9f46dd0bcddcec8439b31d0c17ca8f15b32d025 fixed sqlite bug where sqlite-aref was called with incorrect args (thanks Zach) --- diff --git a/ChangeLog b/ChangeLog index 4b16c13..7cb22c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2014-12-03 Russ Tyndall + * sqlite-sql.lisp + Added database arg to `canonicalize-result-types` so that it could + correctly call `sqlite-aref` with the required number of arguments + Thanks Zach Beane for the bug report. + 2014-07-29 Russ Tyndall * mysql-api.lisp, mysql-sql.lisp, test-connection.lisp Added code to the mysql backend to pull all result sets as diff --git a/db-sqlite/sqlite-sql.lisp b/db-sqlite/sqlite-sql.lisp index a2bc7cd..ef622dd 100644 --- a/db-sqlite/sqlite-sql.lisp +++ b/db-sqlite/sqlite-sql.lisp @@ -99,7 +99,7 @@ (setf col-names (loop for i from 0 below n-col collect (sqlite:sqlite-aref sqlite-col-names i (encoding database))))) (let ((canonicalized-result-types - (canonicalize-result-types result-types n-col sqlite-col-names))) + (canonicalize-result-types result-types n-col sqlite-col-names database))) (flet ((extract-row-data (row) (declare (type sqlite:sqlite-row-pointer-type row)) (loop for i from 0 below n-col @@ -147,7 +147,8 @@ (canonicalize-result-types result-types n-col - col-names)))) + col-names + database)))) (if full-set (values result-set n-col nil) (values result-set n-col))))) @@ -164,11 +165,12 @@ :error-id (sqlite:sqlite-error-code err) :message (sqlite:sqlite-error-message err))11))))) -(defun canonicalize-result-types (result-types n-col col-names) +(defun canonicalize-result-types (result-types n-col col-names database) (when result-types (let ((raw-types (if (eq :auto result-types) (loop for j from n-col below (* 2 n-col) - collect (ensure-keyword (sqlite:sqlite-aref col-names j))) + collect (ensure-keyword + (sqlite:sqlite-aref col-names j (encoding database)))) result-types))) (loop for type in raw-types collect