List:MySQL and Perl« Previous MessageNext Message »
From:Bob McGowan Date:November 14 2009 12:03am
Subject:select fails to find updates of from other connections
View as plain text  
Hello,

My apologies if this is a well known issue, I could not figure out a way
to search that didn't end up returning way too much irrelevant information.

I'm having trouble with retrieving data from mySQL, where the update or
create was done by another application connection and happened while my
Perl DBI/DBD connection was active.

If I disconnect/reconnect to the server, I can see the changes.

Is this expected behavior?  Or is there some parameter that I'm missing?
 Neither the standard 'mysql' client nor the Bugzilla GUI seem to have
this problem.

I'm connecting to a Bugzilla 'bugs' database, mySQL is 5.0.32 (Debian
etch package), Bugzilla is "Virtual Bugzilla Server 3.2.2 brought to you
by ALM Works", Perl is 5.8.8, DBI is v. 1.52, DBD::mysql is v. 4.013.

My connect string is "dbi:mysql:host=$_db_host;database=$_db_dbname",
and I'm using the Bugzilla::DB->db_new method to create the database
handle.  I also set AutoCommit=>0 on the handle when it is created.  I'm
connecting as the Bugzilla 'bugs' user.

This is the select that is built by my script and which works just fine
if I run it in the 'mysql' client:

  select bug_id as seq_number,
  date_format(delta_ts, '%Y/%m/%d %H:%i:%s') as datetime
  from bugs
  where product_id = (select id from products where name = 'XXXX')
  and
  bug_status != 'CLOSED'
  and
  delta_ts > str_to_date('2009/11/13 08:29:15', '%Y/%m/%d %H:%i:%s')
  and
  delta_ts <= str_to_date('2009/11/13 08:32:16', '%Y/%m/%d %H:%i:%s')
  order by bug_id

This is the string as printed by the debugger just before the call to
'selectall_arrayref'.

The two date strings are substituted in as variables during the initial
processing.

Thank your for your help.

-- 
Bob McGowan
Symantec, Inc.
Thread
select fails to find updates of from other connectionsBob McGowan14 Nov
AW: select fails to find updates of from other connectionsGisbert W. Selke16 Nov