-(deftest :db/1
- (let ((inner-db-same)
- (original-a)
- (outer-db-unchanged))
- (print "test-connection-spec")
- (print *test-connection-spec*)
- (clsql:with-database (a '*test-connection-spec* :database-type *test-connection-db-type*)
- (setq original-a a)
- (clsql:with-database (b '*test-connection-spec* :database-type *test-connection-db-type*)
- (setq inner-db-same (eq a b)))
- (setq outer-db-unchanged (eq a original-a))))
- t t)
+(deftest :connection/execute-command
+ ;;check that we can issue basic commands.
+ (values
+ (clsql-sys:execute-command "CREATE TABLE DUMMY (foo integer)")
+ (clsql-sys:execute-command "DROP TABLE DUMMY"))
+ nil nil)
+
+(deftest :connection/query
+ ;;check that we can do a basic query
+ (first (clsql:query "SELECT 1" :flatp t :field-names nil))
+ 1)
+
+(deftest :connection/query-command
+ ;;queries that are commands (no result set) shouldn't cause breakage
+ (values
+ (clsql-sys:query "CREATE TABLE DUMMY (foo integer)")
+ (clsql-sys:query "DROP TABLE DUMMY"))
+ nil nil)
+
+(deftest :connection/pool/procedure-mysql
+ (unwind-protect
+ (progn
+ (clsql-sys:disconnect)
+ (test-connect :pool t)
+ (clsql-sys:execute-command
+ "CREATE PROCEDURE prTest () BEGIN SELECT 1 \"a\",2 \"b\",3 \"c\" ,4 \"d\" UNION SELECT 5,6,7,8; END;")
+ (clsql-sys:disconnect)
+ (test-connect :pool t)
+ (let ((p0 (clsql-sys:query "CALL prTest();" :flatp t)))
+ (clsql-sys:disconnect)
+ (test-connect :pool t)
+ (let ((p1 (clsql-sys:query "CALL prTest();" :flatp t)))
+ (clsql-sys:disconnect)
+ (test-connect :pool t)
+ (values p0 p1))))
+ (ignore-errors
+ (clsql-sys:execute-command "DROP PROCEDURE prTest;"))
+ (test-connect))
+ ((1 2 3 4) (5 6 7 8))
+ ((1 2 3 4) (5 6 7 8)))