projects
/
clsql.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r9517: initial rename to db2 files
[clsql.git]
/
db-mysql
/
mysql-sql.lisp
diff --git
a/db-mysql/mysql-sql.lisp
b/db-mysql/mysql-sql.lisp
index 08f50fb582e0d0f67ebe8de0f9018319a4c8db3c..513c9ed3602db3c95cf602a1ec7ad23201213ba5 100644
(file)
--- a/
db-mysql/mysql-sql.lisp
+++ b/
db-mysql/mysql-sql.lisp
@@
-99,11
+99,11
@@
(let ((mysql-ptr (mysql-init (uffi:make-null-pointer 'mysql-mysql)))
(socket nil))
(if (uffi:null-pointer-p mysql-ptr)
(let ((mysql-ptr (mysql-init (uffi:make-null-pointer 'mysql-mysql)))
(socket nil))
(if (uffi:null-pointer-p mysql-ptr)
- (error '
clsql-connect
-error
+ (error '
sql-connection
-error
:database-type database-type
:connection-spec connection-spec
:database-type database-type
:connection-spec connection-spec
- :err
no
(mysql-errno mysql-ptr)
- :
error
(mysql-error-string mysql-ptr))
+ :err
or-id
(mysql-errno mysql-ptr)
+ :
message
(mysql-error-string mysql-ptr))
(uffi:with-cstrings ((host-native host)
(user-native user)
(password-native password)
(uffi:with-cstrings ((host-native host)
(user-native user)
(password-native password)
@@
-117,11
+117,11
@@
db-native 0 socket-native 0))
(progn
(setq error-occurred t)
db-native 0 socket-native 0))
(progn
(setq error-occurred t)
- (error '
clsql-connect
-error
+ (error '
sql-connection
-error
:database-type database-type
:connection-spec connection-spec
:database-type database-type
:connection-spec connection-spec
- :err
no
(mysql-errno mysql-ptr)
- :
error
(mysql-error-string mysql-ptr)))
+ :err
or-id
(mysql-errno mysql-ptr)
+ :
message
(mysql-error-string mysql-ptr)))
(make-instance 'mysql-database
:name (database-name-from-spec connection-spec
database-type)
(make-instance 'mysql-database
:name (database-name-from-spec connection-spec
database-type)
@@
-173,16
+173,16
@@
(when field-names
(result-field-names num-fields res-ptr))))
(mysql-free-result res-ptr))
(when field-names
(result-field-names num-fields res-ptr))))
(mysql-free-result res-ptr))
- (error '
clsql-sql
-error
+ (error '
sql-database-data
-error
:database database
:expression query-expression
:database database
:expression query-expression
- :err
no
(mysql-errno mysql-ptr)
- :
error
(mysql-error-string mysql-ptr))))
- (error '
clsql-sql
-error
+ :err
or-id
(mysql-errno mysql-ptr)
+ :
message
(mysql-error-string mysql-ptr))))
+ (error '
sql-database-data
-error
:database database
:expression query-expression
:database database
:expression query-expression
- :err
no
(mysql-errno mysql-ptr)
- :
error
(mysql-error-string mysql-ptr))))))
+ :err
or-id
(mysql-errno mysql-ptr)
+ :
message
(mysql-error-string mysql-ptr))))))
(defmethod database-execute-command (sql-expression (database mysql-database))
(uffi:with-cstring (sql-native sql-expression)
(defmethod database-execute-command (sql-expression (database mysql-database))
(uffi:with-cstring (sql-native sql-expression)
@@
-191,11
+191,11
@@
(if (zerop (mysql-real-query mysql-ptr sql-native
(length sql-expression)))
t
(if (zerop (mysql-real-query mysql-ptr sql-native
(length sql-expression)))
t
- (error '
clsql-sql
-error
+ (error '
sql-database-data
-error
:database database
:expression sql-expression
:database database
:expression sql-expression
- :err
no
(mysql-errno mysql-ptr)
- :
error
(mysql-error-string mysql-ptr))))))
+ :err
or-id
(mysql-errno mysql-ptr)
+ :
message
(mysql-error-string mysql-ptr))))))
(defstruct mysql-result-set
(defstruct mysql-result-set
@@
-233,16
+233,16
@@
(mysql-num-rows res-ptr))
(values result-set
num-fields)))
(mysql-num-rows res-ptr))
(values result-set
num-fields)))
- (error '
clsql-sql
-error
+ (error '
sql-database-data
-error
:database database
:expression query-expression
:database database
:expression query-expression
- :err
no
(mysql-errno mysql-ptr)
- :
error
(mysql-error-string mysql-ptr))))
- (error '
clsql-sql
-error
+ :err
or-id
(mysql-errno mysql-ptr)
+ :
message
(mysql-error-string mysql-ptr))))
+ (error '
sql-database-data
-error
:database database
:expression query-expression
:database database
:expression query-expression
- :err
no
(mysql-errno mysql-ptr)
- :
error
(mysql-error-string mysql-ptr))))))
+ :err
or-id
(mysql-errno mysql-ptr)
+ :
message
(mysql-error-string mysql-ptr))))))
(defmethod database-dump-result-set (result-set (database mysql-database))
(mysql-free-result (mysql-result-set-res-ptr result-set))
(defmethod database-dump-result-set (result-set (database mysql-database))
(mysql-free-result (mysql-result-set-res-ptr result-set))
@@
-398,12
+398,11
@@
name)
(if (or (not (eql 0 status))
(and (search "failed" output) (search "error" output)))
name)
(if (or (not (eql 0 status))
(and (search "failed" output) (search "error" output)))
- (error 'clsql-access-error
- :connection-spec connection-spec
- :database-type type
- :error
- (format nil "database-create failed: ~A" output))
- t))))
+ (error 'sql-database-error
+ :message
+ (format nil "mysql database creation failed with connection-spec ~A."
+ connection-spec))
+ t))))
(defmethod database-destroy (connection-spec (type (eql :mysql)))
(destructuring-bind (host name user password) connection-spec
(defmethod database-destroy (connection-spec (type (eql :mysql)))
(destructuring-bind (host name user password) connection-spec
@@
-414,11
+413,10
@@
name)
(if (or (not (eql 0 status))
(and (search "failed" output) (search "error" output)))
name)
(if (or (not (eql 0 status))
(and (search "failed" output) (search "error" output)))
- (error 'clsql-access-error
- :connection-spec connection-spec
- :database-type type
- :error
- (format nil "database-destroy failed: ~A" output))
+ (error 'sql-database-error
+ :message
+ (format nil "mysql database deletion failed with connection-spec ~A."
+ connection-spec))
t))))
(defmethod database-probe (connection-spec (type (eql :mysql)))
t))))
(defmethod database-probe (connection-spec (type (eql :mysql)))