RE: Suddenly $dbh->{AutoCommit}=0 => "Transactions notsupported by database"

RE: Suddenly $dbh->{AutoCommit}=0 => "Transactions notsupported by database"

am 24.08.2006 18:01:17 von kevin.benton

> Some users of the Debian packages I create recently reported that
after
> the
> upgrade from MySQL 5.0.22 to 5.0.24 Perl scripts that try to
explicitly
> set
> $dbh->{AutoCommit} =3D 0;
> die with the error message:
> "Transactions not supported by database"
>=20
> I could verify this but failed to trace down the exact reason due to
the
> confusing perl-xs code :) At least I figured out that
> * ethereal tells me that the greeting and login request both set the
> "client knows transactions" flag to 1
> * the default for imp_dbh->has_transactions is TRUE in dbdimp.c of
> DBD::mysql and
> * that set variable setting triggers dbd_db_STORE_attrib() from
dbdimp.c
> which for some reason thinks that imp_dbh->has_transactions is
FALSE.
>=20
> Has anybody a clue if this really is a recent change or if it should
work?

From the docs... (http://dev.mysql.com/doc/refman/5.1/en/commit.html)

To disable autocommit mode for a single series of statements, use the
START TRANSACTION statement:

START TRANSACTION;
SELECT @A:=3DSUM(salary) FROM table1 WHERE type=3D1;
UPDATE table2 SET summary=3D@A WHERE type=3D1;
COMMIT;

With START TRANSACTION, autocommit remains disabled until you end the
transaction with COMMIT or ROLLBACK. The autocommit mode then reverts to
its previous state.

---
Kevin Benton
Perl/Bugzilla Developer/Administrator, Perforce SCM Administrator
AMD - ECSD Software Validation and Tools
=20
The opinions stated in this communication do not necessarily reflect the
view of Advanced Micro Devices and have not been reviewed by management.
This communication may contain sensitive and/or confidential and/or
proprietary information. Distribution of such information is strictly
prohibited without prior consent of Advanced Micro Devices. This
communication is for the intended recipient(s) only. If you have
received this communication in error, please notify the sender, then
destroy any remaining copies of this communication.




--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=3Dgcdmp-msql-mysql-modules @m.gmane.org

Re: Suddenly $dbh->{AutoCommit}=0 => "Transactions not supported bydatabase"

am 24.08.2006 18:29:52 von Christian Hammers

Hello

On 2006-08-24 Benton, Kevin wrote:
> > Some users of the Debian packages I create recently reported that after
> > the upgrade from MySQL 5.0.22 to 5.0.24 Perl scripts that try to
> > explicitly set
> > $dbh->{AutoCommit} = 0;
> > die with the error message:
> > "Transactions not supported by database"
....

> From the docs... (http://dev.mysql.com/doc/refman/5.1/en/commit.html)
>
> To disable autocommit mode for a single series of statements, use the
> START TRANSACTION statement:

Although this is true, the "perldoc DBI" specification not only allows
the explicit use of the AutoCommit flag, it even recommends using it
this way:
$dbh = DBI->connect($dsn, $user, $password,
{ RaiseError => 1, AutoCommit => 0 });
...
Explicitly defining the required "AutoCommit" behaviour is strongly
recommended and may become mandatory in a later version. This deter-
mines whether changes are automatically committed to the database when
executed, or need to be explicitly committed later.

But this is not even the point, DBD::mysql understands this flag but
it suddenly says that the MySQL installations had no transaction support
in which case it would be allowed to issue a fatal error but which is
definitely not the case here as I have innodb enabled.
So how does it come to that conclusion?

bye,

-christian-


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