Passing client_flag = 2 to the MySQLDb.connect solves the problem but again
I am confused why this was working with the earlier version. Looks
like 3.9version has  an update which makes  the code that does not
specifies
client_flag fail ?



On 7/31/07, King Simon-NFHD78 <[EMAIL PROTECTED]> wrote:
>
>  databases/mysql.py has this snippet in create_connect_args (0.3.10):
>
>         # FOUND_ROWS must be set in CLIENT_FLAGS for to enable
>         # supports_sane_rowcount.
>         client_flag = opts.get('client_flag', 0)
>         if self.dbapi is not None:
>             try:
>                 import MySQLdb.constants.CLIENT as CLIENT_FLAGS
>                 client_flag |= CLIENT_FLAGS.FOUND_ROWS
>             except:
>                 pass
>             opts['client_flag'] = client_flag
> So CLIENT.FOUND_ROWS is a constant that should be passed as part of the
> 'client_flag' options to MySQLdb's connect method. I don't know you didn't
> need this before though.
>
> Hope that helps,
>
> Simon
>
>  ------------------------------
> *From:* [email protected] [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Arun Kumar PG
> *Sent:* 31 July 2007 09:47
> *To:* [email protected]
> *Subject:* [sqlalchemy] Re: ConcurrentModificationError: Updated rowcount
> 0 does not match number of objects updated 1
>
> The MySQLdb library has CLIENT.FOUND_ROWS = 2. What value ideally it
> should have ?
>
> I am still now clear why this problem was not coming in the earlier SA
> version!
>
> On 7/31/07, Arun Kumar PG <[EMAIL PROTECTED]> wrote:
> >
> > I am using pool.QueuePool for managing connections and this pool is fed
> > with a creator function which returns an instance of my own custom DBAPI
> > class (I need this because of some logging stuff that I am doing). This
> > custom DBAPI class returns a Connection object returned by
> > MySQLdb.connect.
> >
> > >>> The FOUND_ROWS client flag must be enabled on MySQL connections to
> > make rowcount return what you (and SA) are expecting.
> >
> > This has been enabled recently on SA 3.9 ? because the previous version
> > was working fine.
> >
> >
> > On 7/31/07, jason kirtland < [EMAIL PROTECTED]> wrote:
> > >
> > >
> > > Arun Kumar PG wrote:
> > > > Looks like the problem is coming because of the fact when we are
> > > > updating a row in table with the same data the rowcount returned by
> > > > mysql is 0. Only when there is a change in data the rowcount is
> > > returned.
> > >
> > > Are you creating connections outside of SQLAlchemy?  (I seem to recall
> > > you were using a custom creator function.)  The FOUND_ROWS client flag
> > > must be enabled on MySQL connections to make rowcount return what you
> > > (and SA) are expecting.
> > >
> > >
> > >
> >
> >
> > --
> > Cheers,
> >
> > - A
>
>
>
>
> --
> Cheers,
>
> - A
> >
>


-- 
Cheers,

- A

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to