Patrick Galbraith | 9 May 2011 20:24
Gravatar

DBD::mysql 4.019 Released

Dear Perl and MySQL enthusiasts,

I’m pleased to announce the release of DBD::mysql 4.019. I’m
especially pleased because there are some new enhancements and
features that have been provided by contributions from the community:

* Asynchronous support, added by Rob Hoelz. This is a new feature to
DBD::mysql that takes advantage of libmysql’s asynchronous functions
(see Jan’s article from 2008
http://jan.kneschke.de/2008/9/9/async-mysql-queries-with-c-api/) .
From the DBD::mysql documentation:

You can make a single asynchronous query per MySQL connection; this
allows you to submit a long-running query to the server and have an
event loop
inform you when it’s ready. An asynchronous query is started by either
setting the ‘async’ attribute to a true value in the DBI do() method,
or in the DBI prepare() method. Statements created with async set to
true in prepare always run their queries asynchronously when DBI
execute() is called. The driver also offers three additional methods:
mysql_async_result, mysql_async_ready(), and mysql_fd.
mysql_async_result() returns what do or execute would have; that is,
the number of rows affected. mysql_async_ready() returns true if
mysql_async_result() will not block, and zero otherwise. They both
return undef if that handle is not currently running an asynchronous
query. mysql_fd returns the file descriptor number for the MySQL
connection; you can use this in an event loop.

  use feature 'say';
  $dbh->do('SELECT SLEEP(10)', { async => 1 });
(Continue reading)

Tim Bunce | 9 May 2011 21:08
Picon
Favicon

Re: DBD::mysql 4.019 Released

On Mon, May 09, 2011 at 02:24:21PM -0400, Patrick Galbraith wrote:
> 
> You can make a single asynchronous query per MySQL connection; this
> allows you to submit a long-running query to the server and have an
> event loop inform you when it’s ready.

That's great, but...

> An asynchronous query is started by either
> setting the ‘async’ attribute to a true value

... that should be 'mysql_async'. I.e., the name of the driver-private
attribute should include the drivers prefix.

Please add mysql_async and deprecate async in the next release.

Tim.

--

-- 
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:    http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules <at> m.gmane.org

Curtis Jewell | 11 May 2011 07:10
Picon
Favicon

Re: DBD::mysql 4.019 Released

On Mon, 09 May 2011 14:24 -0400, "Patrick Galbraith" <patg <at> patg.net>
wrote:
> Dear Perl and MySQL enthusiasts,
> 
> I’m pleased to announce the release of DBD::mysql 4.019. I’m
> especially pleased because there are some new enhancements and
> features that have been provided by contributions from the community:

And I'm sorry to say that it DOES NOT COMPILE on Strawberry Perl 5.10.x
32-bit or 5.12.x 64-bit:

Putting it in the compilation chain:
http://hg.curtisjewell.name/Perl-Dist-Strawberry/rev/5659321f22fa

Taking it back out:
http://hg.curtisjewell.name/Perl-Dist-Strawberry/rev/6eabb352a96d

Why? (64-bit output, 32-bit is similar)

STDOUT:
cp lib/DBD/mysql.pm blib\lib\DBD\mysql.pm
cp lib/DBD/mysql/GetInfo.pm blib\lib\DBD\mysql\GetInfo.pm
cp lib/DBD/mysql/INSTALL.pod blib\lib\DBD\mysql\INSTALL.pod
cp lib/Bundle/DBD/mysql.pm blib\lib\Bundle\DBD\mysql.pm
gcc -c  -IC:\strawberry\perl\vendor\lib\auto\DBI
-IC:\strawberry\c\bin\..\include\mysql_5 -DDBD_MYSQL_INSERT_ID_IS_GOOD
-g      -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DWIN64 -DCONSERVATIVE
-DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS
-fno-strict-aliasing -mms-bitfields -DPERL_MSVCRT_READFIX -s -O2        
 -DVERSION=\"4.019\"   -DXS_VERSION=\"4.019\" 
(Continue reading)


Gmane