Patrick Galbraith wrote:
Martin,

Thanks for the info. Do you have a script that does this? mysql_st_execute41 should be called if mysql supports prepared statements, that is, >= SERVER_PREPARE_VERSION. I'm a bit suprised it works, but I think I have code that catches it even if it doesn't support prepared statements, so mysql_st_execute41 might have better handling, even for versions < 4.1. Please send whatever script you have to reproduce this. I'd like to see why it works where it shouldn't and where it doesn't where it should.

Kind regards,

Patrick

Patrick,

I posted the following patch for a test case to dbi-users list:

http://www.nntp.perl.org/group/perl.dbi.users/28909

Original posting and followups:

http://www.nntp.perl.org/group/perl.dbi.users/28896
http://www.nntp.perl.org/group/perl.dbi.users/28908

Martin

Martin J. Evans wrote:

Hi,

I could really do with a little assistance form the dbd::mysql maintainers or authors please.

I am investigating the issue I reported here with execute_array or all executes failing after one execute fails.

i.e.
create table test (a int primary key)
prepare(insert into test values(?)
execute(1) - OK
execute(2) - OK
execute(1) - fails but expected
execute(3) - fails but row inserted and not expected to fail

It appears this has something to do with whether MYSQL_VERSION_ID is <= SERVER_PREPARE_VERSION.

My myql is 50015 and my client lib is also 50015 - as client and server are on the same machine.
SERVER_PREPARE_VERSION is 40103 (in dbimp.h)

When I run with dbd::mysql (from 3.0002_4) it fails.
When I turn all comparisons of MYSQL_VERSION_ID >= SERVER_PREPARE_VERSION around so it is < it works. Can someone tell my if dbd_st_execute is supposed to call mysql_st_internal_execute41 for versions of MySQL
40103 and lower or the opposite way around. I suspect it should be:

if MYSQL_VERSION_ID < SERVER_PREPARE_VERSION
 use mysql_st_internal_execute41

because other places in the code do things like:

#if MYSQL_VERSION_ID < SERVER_PREPARE_VERSION if (mysql_real_query(&imp_dbh->mysql, "COMMIT", 6))
#else
     if (mysql_commit(&imp_dbh->mysql))
#endif

because functions like mysql_commit were introduced in 4.1

I'd greatly appreciate any help here as I'm desparately trying to make this work and trying very hard to feedback problems and fixes to DBD::mysql.

Martin





Reply via email to