import, libmysqlclient problems
Posted: Tue Jun 02, 2009 2:50 pm
After upgrading to OSX 10.5, I am having some problems with imported functions from libmysqlclient. Many functions that return my_ulonglong are all returning 0. Other applications using the same libmysqlclient and importing the same functions work fine, and a short program I wrote in C using the library confirms that it is returning the correct values.
This happens in newlisp 10.2 and the development version. I have tried both versions using the compiled binary as well as compiling myself (darwin/utf8/readline). It happens with all of them.
Here is the sample code:
mysql_affected_rows is also behaving similarly.
I tried recompiling mysql after the upgrade, and using the new library, I get the same results.
Does anyone have *any* idea what might be happening?
This happens in newlisp 10.2 and the development version. I have tried both versions using the compiled binary as well as compiling myself (darwin/utf8/readline). It happens with all of them.
Here is the sample code:
Code: Select all
(constant 'libmysqlclient "/usr/local/mysql/lib/libmysqlclient.dylib")
(import libmysqlclient "mysql_init")
(import libmysqlclient "mysql_real_connect")
(import libmysqlclient "mysql_real_query")
(import libmysqlclient "mysql_store_result")
(import libmysqlclient "mysql_free_result")
(import libmysqlclient "mysql_close")
(import libmysqlclient "mysql_num_rows")
(import libmysqlclient "mysql_field_count")
(setf sql "select * from some_table_with_lots_of_records")
(setf MYSQL (mysql_init 0))
(println "Connecting: " (mysql_real_connect MYSQL "localhost" "user" "secret" "db" 0 0 0))
(println "Querying: " (mysql_real_query MYSQL sql (+ 1 (length sql))))
(println "Storing: " (setf MYSQL_RES (mysql_store_result MYSQL)))
;; !!! This should return a number in the thousands, but always returns 0.
(println "Rows found: " (mysql_num_rows MYSQL_RES))
(println "Freeing: " (mysql_free_result MYSQL_RES))
(println "Cleaning up: " (mysql_close MYSQL))
(exit 0)
I tried recompiling mysql after the upgrade, and using the new library, I get the same results.
Does anyone have *any* idea what might be happening?