Having some difficulty with dbmysql..

BlitzMax Forums/Brucey's Modules/Having some difficulty with dbmysql..

LT(Posted 2013) [#1]
Hello, I downloaded the database and dbmysql modules back in 2011 and just played long enough to get the basics working. Recently, I decided to look into it again as I am in need of database features for my engine.

The new implementation was pretty easy and I had my own world objects saving and retrieving meta data. So far, so good.

The problem is that at some point, I decided to recompile the modules and now they are not retrieving data properly, though I can still do DROP and INSERT statements. I had recently updated BlitzMax to 1.48, so I thought that was the problem. But as of right now, I am unable to successfully compile a functional mysql module - but it reports no errors (!).

At some point, I did switch to a later version of libmysql.dll, but it's 5.5 so I assume that should still work. The reason I recompiled in the first place is that I was unable to get blobs to work. I keep getting an error..

(3) Error resetting statement (4068)

Any ideas? Has something changed in 1.48 that could cause this issue?

EDIT: I've also tried libmysql.dll from Connector 6.1.2 and that gives me an "Entry Point Not Found" error with KERNAL32.dll.


LT(Posted 2013) [#2]
Well now, this is very confusing. I did manage to get the module working again (sort of), but I had to comment out a line in dbmysql..

in method TMySQLResultSet.nextRow()

If preparedQuery Then

...

Else

'If Not bmx_mysql_rowField_isNull(row, i) Then
'^^Commenting this out makes non-prepared queries work again!!??^^

Endif


Looking at the C source, I can see nothing wrong with it, but it was returning a non-zero value when it shouldn't. Whatever conditions I had two years ago that generated a working module - I am unable to reproduce them now - without commenting out that line. I can't help but wonder if there is some CC_OPT or something that I'm missing.


LT(Posted 2013) [#3]
Even with that issue (somewhat) sorted out, I can't get any of the binding stuff to work.

Deciding to start a clean build - I downloaded the zips containing database_1.08 and dbmysql_1.06. I have a MySQL 5.5 database set up and grabbed libmysql.dll from Connector 6.0.2. The modules compile with no errors, but none of the tests work!?

Very odd, indeed. :/


Henri(Posted 2013) [#4]
Hello,

where did you download the database module ?


-Henri


LT(Posted 2013) [#5]
Hello,

I downloaded them both at MaxMods at GoogleCode. Now I realize the first issue had something to do with the bool return value. Still don't know why it was a problem.

I decided to try making a stripped-down version of the module and run through the MySql (textbook) example. Still have not got bindings working. :(


LT(Posted 2013) [#6]
Here's the stripped down version of the module. It's basically just the common part of dbmysql wrapping the mysql and bmx_mysql functions.

Any external imported files are unchanged.



And here's the simple test case (local database).



Running the test case results in the existing table being wiped and replaced and one new entry is added, but without the bound values!!

/scratches head


Henri(Posted 2013) [#7]
Latest version of the module can be found from SVN-repository. The version in website is outdated.

-Henri


LT(Posted 2013) [#8]
Ah, I had grabbed them from there before, but not for some time. The only difference I could find is the libmysql.a file in lib/win32, but that made a difference! At least the original tests work now, so thanks!! :)

Also have to say, the sheer number of modules there is quite impressive!

EDIT: Different set of includes, also. Now I feel sheepish. :/