Mariano Montone | 10 Mar 18:52 2015
Picon

Bug: NO-NEXT-METHOD error on read-sql-value (SBCL)

Hi.

When trying to use latest version from SBCL, read-sql-value signals a
NO-NEXT-METHOD error for the :around read-sql-value definition. It
should work, as I understand the code, and maybe this is a bug in SBCL,
but I'm posting FYI. Dosn't work on latest SBCL or older versions.

This is the conflicting code:

596 (defmethod read-sql-value :around
597     (val type database db-type
598      ;; never eval while reading values, always read base 10
599      &aux *read-eval* (*read-base* #10r10))
600   (declare (ignore db-type))
601   (cond
602     ;; null value or type
603     ((or (equalp "nil" val) (eql 'null val)) nil)
604    
605     ;; no specified type or already the right type
606     ((or (null type)
607          (ignore-errors (typep val type)))
608      val)
609
610     ;; actually convert
611     (t
612      (let ((res (handler-bind
613                     ;; all errors should be converted to
sql-value-conversion-error
614                     ((error (lambda (c)
615                               (when *debugger-hook*
(Continue reading)

DJ | 7 Mar 04:58 2015

problem resolving foreign function (I think)

OK - I'm in over my head here. I did search the archives for help on this, but I am not that sure what I am looking for.

I can connect to a mysql database, but when I do any query with (clsql:query...) I get:

Can't resolve foreign symbol "clsql_mysql_field_flags"

So, here is the setup. I am running:

Linux Mint 17 64-bit
Clozure CL Version 1.10-r16196 64-bit

I do NOT have the debian clsql packages installed. When I had them installed, doing (ql:quickload :clsql-mysql) caused a compile error. Some of the uffi stuff did not compile. I do not have the specifics of that right now because I uninstalled the clsql packages on the assumption that I could use the shared libraries within the quicklisp distribution, and so would not need to install the debian packages. (Let me know if that's wrong.)

Anyway, I did a "make" in the db-mysql directory of the the quicklisp distro of clsql. This made a 64-bit version of clsql_mysql64.so but crapped out on the 32-bit version. I don't know how to set up 32-bit development on my Linux MInt box, but I am not sure that's the real problem anyway.

I jthen did "readelf -Ws clsql_mysql64.so" and saw that the library exports "clsql_mysql_field_flags".

I did:

(clsql:push-library-path #p "/home/jakep/quicklisp/dists/quicklisp/software/clsql-20150302-git/db-mysql/")

As I understand it this should make the shared library available to clsql, which I would have thought would allow resolution of clsql_mysql_field_flags.

At one point I also pushed  the path to the uffi stuff also: "/home/jakep/quicklisp/dists/quicklisp/software/clsql-20150302-git/uffi/" but this made no difference.

I have had no trouble running clsql on two of my OS X machines, but cannot get it going on Linux Mint.

Any help will be deeply appreciated.

Best,

- DJ -


_______________________________________________
CLSQL mailing list
CLSQL@...
http://lists.b9.com/cgi-bin/mailman/listinfo/clsql
Russ Tyndall | 25 Feb 15:28 2015
Picon

Re: CLSQL Release

Thanks as always Zach, and apologies. 

That back end worked last I checked it (~6mo), but apparently that was too long ago.

Everything compiles and all the tests pass for me again, once I resolved the type error.
I thought it a little odd that the "warning" stopped compilation, but it seems SBCL does that more frequently as releases progress.

The fix has been pushed to git.b9.org and http://github.com/Unwashedmeme/clsql

Cheers,
Russ Tyndall
Developer
Acceleration.net


On 02/24/2015 07:08 PM, Zach Beane wrote:
Unfortunately, there seems to be a bug - http://report.quicklisp.org/2015-02-24/failure-report/clsql.html#clsql-mysql has the log.

; caught WARNING: ; Constant NIL conflicts with its asserted type (SB-ALIEN:ALIEN (* T)). ; See also: ; The SBCL Manual, Node "Handling of Types"

On Tue, Feb 24, 2015 at 2:06 PM, Russ Tyndall <russ <at> acceleration.net> wrote:
Spurred on by a message from the SBCL-devel list, I think its time for
a clsql release.

> It is actually a clsql problem, its reinitialize-instance around methods
> for standard-db-class do not return the passed instance to them.
> I made SBCL ignore that again, but things should be prepared that
> SBCL won't be so lenient in the future, maybe with type and equality
> assertions for all standard GFs.
>
> --
> With best regards, Stas.

I made the `reinitialize-instance :around`, return the passed in
instance.

Also in this release are some encoding bug fixes for sqlite backends
(thanks Zach Beane). Fixes for procedures and multiple result sets in
the mysql backend (thanks Ilya Khaprov). There was also a fixed load
bug for mysql on recent Ubuntu's (hopefully not causing problems
elsewhere).

I believe this will be release 6.6.0, but as always I leave that to
Kevin's discretion. Nathan Bird will push this all to b9.org in a bit.

Cheers,
Russ Tyndall
Developer
Acceleration.net

_______________________________________________
CLSQL mailing list
CLSQL <at> b9.com
http://lists.b9.com/cgi-bin/mailman/listinfo/clsql


_______________________________________________
CLSQL mailing list
CLSQL@...
http://lists.b9.com/cgi-bin/mailman/listinfo/clsql
Russ Tyndall | 24 Feb 20:06 2015
Picon

CLSQL Release

Spurred on by a message from the SBCL-devel list, I think its time for
a clsql release.

> It is actually a clsql problem, its reinitialize-instance around methods
> for standard-db-class do not return the passed instance to them.
> I made SBCL ignore that again, but things should be prepared that
> SBCL won't be so lenient in the future, maybe with type and equality
> assertions for all standard GFs.
>
> --
> With best regards, Stas.

I made the `reinitialize-instance :around`, return the passed in
instance.

Also in this release are some encoding bug fixes for sqlite backends
(thanks Zach Beane). Fixes for procedures and multiple result sets in
the mysql backend (thanks Ilya Khaprov). There was also a fixed load
bug for mysql on recent Ubuntu's (hopefully not causing problems
elsewhere).

I believe this will be release 6.6.0, but as always I leave that to
Kevin's discretion. Nathan Bird will push this all to b9.org in a bit.

Cheers,
Russ Tyndall
Developer
Acceleration.net
Mark Meyer | 5 Feb 12:40 2015
Picon

Maria DB Problems

Hi,
I've got a problem using MariaDB with CLSQL. Using the MariaDB Client libs CLSQL does not compile because mysql-client-info.lisp does check for a specific Version of the MySQL libs. The *mysql-client-info* is retrieved from mysql-get-client-info and the result should be something like 5.0.0-mysql but it is in fact 10.0.0-MariaDB. I did a quick fix to work around this (checking if the first letter of the string is 1), but would like a more permanent fix. Any ideas on how a good fix should look?

Regards, Mark
_______________________________________________
CLSQL mailing list
CLSQL@...
http://lists.b9.com/cgi-bin/mailman/listinfo/clsql
Christopher Laux | 20 Dec 12:38 2014
Picon

clsql-mysql problem with join

Hi,

the second point of your post helped thanks, I had to modify 2 Makefiles.

I have another problem with clsql: when querying an object (user) with a one-to-many join

(jobs :reader user-jobs :db-kind :join :db-info (:join-class job
   :home-key id
   :foreign-key user-id
   :set t))

the slot sometimes returns all 4 job objects sometimes only 2 randomly. What could this be?

Chris


On Sat, Dec 20, 2014 at 8:04 AM, Jussi Lahdenniemi <jlahd <at> iki.fi> wrote:
Hello,

> using the most recent quicklisp version of clsql on sbcl 1.2.0 on ubuntu
> 14.04 with the corresponding mysql and libmysqlclient-dev definitely
> installed I receive this error upon loading clsql-mysql:
>
> OPERATION-ERROR while invoking #<COMPILE-OP > on
> #<CLSQL-MYSQL-SOURCE-FILE "clsql-mysql" "db-mysql" "clsql_mysql">

About a month ago I listed in my answer at Stackoverflow
(http://stackoverflow.com/questions/27123292/installing-clsql-sqlite3-using-sbcl-quicklisp)
the three issues I have faced when installing clsql on different
systems. Maybe one of these covers your situation as well?

--
Jussi Lahdenniemi
_______________________________________________
CLSQL mailing list
CLSQL-0lovp2JerKU@public.gmane.org
http://lists.b9.com/cgi-bin/mailman/listinfo/clsql

_______________________________________________
CLSQL mailing list
CLSQL@...
http://lists.b9.com/cgi-bin/mailman/listinfo/clsql
Christopher Laux | 19 Dec 20:45 2014
Picon

clsql-mysql load error

Hi all,

using the most recent quicklisp version of clsql on sbcl 1.2.0 on ubuntu 14.04 with the corresponding mysql and libmysqlclient-dev definitely installed I receive this error upon loading clsql-mysql:

OPERATION-ERROR while invoking #<COMPILE-OP > on #<CLSQL-MYSQL-SOURCE-FILE "clsql-mysql" "db-mysql" "clsql_mysql">

Unfortunately it doesn't say much more...

What can I do?

Cheers,
Chris

_______________________________________________
CLSQL mailing list
CLSQL@...
http://lists.b9.com/cgi-bin/mailman/listinfo/clsql
Zach Beane | 25 Nov 20:33 2014

clsql-sqlite does not build on sbcl - argument error

I get this when trying to build clsql-sqlite:

  ; file: /home/quicklisp/quicklisp-controller/dist/build-cache/clsql/369f4bee8ea4573e08e35f09583a1ea0c1b03c08/clsql-20141124-git/db-sqlite/sqlite-sql.lisp
  ; in: DEFUN CANONICALIZE-RESULT-TYPES
  ;     (SQLITE:SQLITE-AREF CLSQL-SQLITE::COL-NAMES CLSQL-SQLITE::J)
  ; 
  ; caught WARNING:
  ;   The function was called with two arguments, but wants exactly three.

More of a log is here:

  http://report.quicklisp.org/2014-11-25/failure-report/clsql.html#clsql-sqlite

Zach
Russ Tyndall | 10 Jun 19:32 2014
Picon

Makefile Change for db-mysql backend

Hello,

Something apparently changed in the output of `dpkg-buildflags --get 
LDFLAGS` that caused this makefile to output invalid command line 
arguments to `ld`.  I made a change that I think is backwards compatible 
and should result
Mackram Raydan | 12 Apr 12:51 2014
Picon

Patch for the handling of symbols in clsql

Hey everyone,

Based on a previous thread, I have submitted a pull request to handle 
the output of symbols when saved with clsql. In line with the discussion 
with Russ, the functionality I submitted continues to use intern but 
makes checks on whether there are packages or not in the saved symbol 
and acts accordingly.

One thing I have missed is writing test cases because I was not sure how 
best to proceed (although I have done tests on my end to verify 
everything is in order). The current tests call directly the high level 
functions such as select or update and not the lower functions like 
read-sql-value. I was not sure if I should change some of the 
def-view-classes to add a symbol column, or to add a new def-view-class 
for this specific test or to basically put the tests that I did directly 
on read-sql-value. Any suggestions on what you would like me to do?

Finally I did the pull request to the git repository found at github.com 
even though the change is small (I am just used to pull requests), if 
someone prefers another method I have no problem in resubmitting in a 
different way.

Thank you

Mackram Raydan
Jussi Lahdenniemi | 8 Apr 16:16 2014
Picon
Picon

Problem with the new db-mysql makefile

Hello,

I just upgraded to the latest clsql with quicklisp, after which the 
db-mysql module failed to compile. Digging into the problem, the culprit 
was the new Makefile with its logic for finding out the ld flags:

LDFLAGS:=$(LDFLAGS) $(shell dpkg-buildflags --get LDFLAGS | sed 
"/-Wl,\(.*\)/ s//\1/g")

I was building clsql in the AWS EC2 environment; there dpkg-buildflags 
--get LDFLAGS results in the following:

-Wl,-Bsymbolic-functions -Wl,-z,relro

The regex above removes the first -Wl, but not the second one, which 
makes the linker unhappy. I fixed this by changing the regex to 
"/-Wl,\([^ ]*\)/ s//\1/g", you might want to incorporate something 
similar into the official version as well.

--

-- 
Jussi Lahdenniemi

Gmane