;;;;
;;;; CLSQL users are granted the rights to distribute and use this software
;;;; as governed by the terms of the Lisp Lesser GNU Public License
;;;;
;;;; CLSQL users are granted the rights to distribute and use this software
;;;; as governed by the terms of the Lisp Lesser GNU Public License
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Lisp types used in declarations.
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Lisp types used in declarations.
;;;;
(def-type sqlite-row string-pointer)
(def-type sqlite-row-pointer-type (* string-pointer))
(def-type sqlite-vm-pointer (* sqlite-vm))
(def-type sqlite-row string-pointer)
(def-type sqlite-row-pointer-type (* string-pointer))
(def-type sqlite-vm-pointer (* sqlite-vm))
(defun sqlite-compile (db sql)
(with-cstring (sql-native sql)
(let ((vm (allocate-foreign-object 'sqlite-vm)))
(defun sqlite-compile (db sql)
(with-cstring (sql-native sql)
(let ((vm (allocate-foreign-object 'sqlite-vm)))
- (with-foreign-object (sql-tail '(* :char))
- (let ((result (%compile db sql-native sql-tail vm nil)))
+ (with-foreign-object (sql-tail '(* :unsigned-char))
+ (let ((result (%compile db sql-native sql-tail vm +null-errmsg-pointer+)))
- (let ((cols (allocate-foreign-object '(* (* :char))))
- (col-names (allocate-foreign-object '(* (* :char)))))
+ (let ((cols (allocate-foreign-object '(* (* :unsigned-char))))
+ (col-names (allocate-foreign-object '(* (* :unsigned-char)))))
(declare (type sqlite-row-pointer-type cols col-names))
(let ((result (%step (deref-pointer vm 'sqlite-vm)
cols-n cols col-names)))
(declare (type sqlite-row-pointer-type cols col-names))
(let ((result (%step (deref-pointer vm 'sqlite-vm)
cols-n cols col-names)))
(declare (type sqlite-row-pointer-type rows))
(with-foreign-object (rows-n :int)
(with-foreign-object (cols-n :int)
(declare (type sqlite-row-pointer-type rows))
(with-foreign-object (rows-n :int)
(with-foreign-object (cols-n :int)