X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;ds=sidebyside;f=db-mysql%2Fmysql-api.lisp;h=d49a0894d943f292722219f124b57f00aa8a38c0;hb=bada52b7a8fd2cc484dee33cccd64ca09a52ec3d;hp=6842f8b2aaad031988a304e5bbc437a4b8f45469;hpb=7d50938ba2db52a713498e49aa1679deae6f0b6b;p=clsql.git diff --git a/db-mysql/mysql-api.lisp b/db-mysql/mysql-api.lisp index 6842f8b..d49a089 100644 --- a/db-mysql/mysql-api.lisp +++ b/db-mysql/mysql-api.lisp @@ -2,13 +2,13 @@ ;;;; ************************************************************************* ;;;; FILE IDENTIFICATION ;;;; -;;;; Name: mysql.cl +;;;; Name: mysql-api.lisp ;;;; Purpose: Low-level MySQL interface using UFFI ;;;; Programmers: Kevin M. Rosenberg based on ;;;; Original code by Pierre R. Mai ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: mysql-api.lisp,v 1.1 2002/09/30 10:19:23 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai @@ -18,9 +18,7 @@ ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. ;;;; ************************************************************************* -(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0))) - -(in-package :mysql) +(in-package #:mysql) ;;;; Modifications from original code ;;;; - Updated C-structures to conform to structures in MySQL 3.23.46 @@ -107,7 +105,12 @@ (:blob 252) (:var-string 253) (:string 254))) - + +#-(or mysql-client-v3 mysql-client-v4) +(eval-when (:compile-toplevel :load-toplevel :execute) + (pushnew :mysql-client-v3 cl:*features*)) + +#+mysql-client-v3 (uffi:def-struct mysql-field (name (* :char)) (table (* :char)) @@ -118,6 +121,20 @@ (flags :unsigned-int) (decimals :unsigned-int)) +;; structure changed in mysql 4 client +#+mysql-client-v4 +(uffi:def-struct mysql-field + (name (* :char)) + (table (* :char)) + (org_table (* :char)) + (db (* :char)) + (def (* :char)) + (length :unsigned-int) + (max-length :unsigned-int) + (flags :unsigned-int) + (decimals :unsigned-int) + (type mysql-field-types)) + ;;; MYSQL-ROWS (uffi:def-array-pointer mysql-row (* :unsigned-char))