mysql.lsp

Started by Ryon, April 13, 2004, 08:06:49 PM

Previous topic - Next topic

Ryon

I'd like to try mysql.lsp on my hosted site. The host is running MySQL 4.0 as required, but they apparently upgraded from an earlier version and are using libmysqlclient.so.10 rather than the .12 version. The instructions say to use mysql.lsp from a previous version of newLISP in this case, but no versions other than the latest v.8.0 are available in the newlisp.org/download directory.
\"Give me a Kaypro 64 and a dial tone, and I can do anything!\"

Lutz

#1
libmysqlclient.so.10 should be fine as long as they are running MySQL 4.0 and it is running with it. Most of the time you just specify 'libmysqlclient.so' and your machine it is linked to whatever lib is the current one.



You also can try to compile and run sql.c from the distribution, it will give the correct data offset to be used inside mysql.lsp in various places.



An older version of mysql.lsp for the 3.23 series in in newlisp_7400.tgz at Sourceforge.net, but I think you should use the current mysql.lsp, if you are running MysQL 4.0.



Lutz

Lutz

#2
At my ISP they are running MySQL 3.23 with libmysql.so.10 on a freeBSD system. If libmysql.so.10 is always MySQL 3.23 based, then there is now way to run it with MySQL 4.0, no matter what mysql.lsp you are using. On my Mandrake 9.2 system MySQL 4.0 runs with libmysql.so.12.



On the freeBSD system libmysql.so.10 was in /usr/local/mysql-3.23/lib, so it was stored in a version specific place. Perhaps you also have to check if they made a correct link from the version-speicifuc lib to /usr/lib/libmysql.so or wherever they put it.



Lutz

Ryon

#3
Quote"libmysqlclient.so.10 should be fine as long as they are running MySQL 4.0 and it is running with it. Most of the time you just specify 'libmysqlclient.so' and your machine it is linked to whatever lib is the current one."

I changed the ('set libmysqlclient "/usr/lib/libmysqlclient.so.12") to .10. Running (test-mysql) returns a segmentation fault. Taking this step-by-step, (MySQL:init) returns true, (MySQL:connect ...) returns true (hooray!), (MySQL:query "show databases;") returns true, (MySQL:num-rows) returns 1, but (MySQL:fetch-row) returns the segmentation fault.



Some further information: This is a stable environment on a hosted web server, Debian 2.4.24. The libmysqlclient files are located in /usr/lib, all of them are the .10 version. I do not see any libmysqlclient files on either /usr/local or /usr/local/lib. The database, MySQL 4.0.18 is hosted on a separate machine which I do not have system access to.
\"Give me a Kaypro 64 and a dial tone, and I can do anything!\"

Lutz

#4
I wonder if they installed MySQL 4.0.18 on a separate machine but the machine your are on still uses libmysqlclient.so.10 from a previous MySQL 3.23 installation? I seems to me that you need libmysqlclient.so.12.





Lutz

Ryon

#5
That's exactly what happened. They didn't change the web servers when they upgraded the DB server. It's now in the pipeline, all I have to do is wait.



Thanks for the help!
\"Give me a Kaypro 64 and a dial tone, and I can do anything!\"

Ryon

#6
Here's the answer I got back from the hosting company. I think they say that older v3 code should be okay, but I'm not sure what this means regarding code intended for v4, such as the current mysql.lsp.


Quote ... the problem is not the libmysqlclient.so lib but rather the client mods build with a V3 series libmysqlclient.so, therefore referencing the V4 lib with a V3 layout, but this shouldn't be a problem.



The structure of libmysqlclient.so has changed in V4, the old clients should still work, in that it should normaly be backward compatible for some time, only lacking in support of the new V4 features when using old clients.



But since we can't exclude anything with a major upgrade, it would be interesting to have any specific error message(s) you get, what exactly isn't working? It might be worth a bug report unless its older code broken by some change in how V4 handles certain query returns or operand behavior.
\"Give me a Kaypro 64 and a dial tone, and I can do anything!\"

Lutz

#7
There are two things you can do:



(1) try mysql.lsp from version newLISP 7.4. This was working with clitnes comliled for V3 (3.23)



(2) get the header files those client libraries have been compiled with so you can compile sql.c, run it and give me the numbers, and I can make you a mysql.lsp which works for you.



For the 7.4 based sql.c

#include "/usr/include/mysql/mysql.h"

#include "/usr/include/mysql/mysql_com.h"



For the  latest sql.c

#include "/usr/include/mysql/mysql.h"

#include "/usr/include/mysql/mysql_com.h"

#include "/usr/include/mysql/mysql_version.h"

#include "/usr/include/mysql/my_alloc.h"



Lutz