On 12/15/06, Stefan Meretz <[EMAIL PROTECTED]> wrote:
> On 2006-12-13 22:38, Shannon -jj Behrens wrote:
> > My memory is that MySQLdb recently changed a bunch of stuff and that
> > it was a simple logic bug.
>
> You mean, that just the entire logic is reversed?
>
> This would explain, why reading is working (from Mike's Mail):
>
> >     def convert_result_value(self, value, dialect):
> >          if value is not None and not isinstance(value, unicode):
> >              return value.decode(dialect.encoding)
> >          else:
> >              return value
>
> If value is already unicode, then the value is simply handed over
> (else-part).
>
> However, writing goes wrong, because MySQLdb (wrongly) expects an
> unicode object but gets an utf8 encoded string (if-part):
>
> >     def convert_bind_param(self, value, dialect):
> >          if value is not None and isinstance(value, unicode):
> >               return value.encode(dialect.encoding)
> >          else:
> >               return value
>
> Am I right?

I can't say with certainty exactly how the code is broken.  If you can
write a simple, stand-alone test to prove your point, that would
indeed be a useful addition to the bug.  Remember to use the MySQL
client and the hex function to see what's *actually* stored in the
database.

> > Here's the bug I filed:
> > http://sourceforge.net/tracker/index.php?func=detail&aid=1592353&grou
> >p_id=22307&atid=374932
>
> If I am right, I would add a note to the bug you already filed.

Best Regards,
-jj

-- 
http://jjinux.blogspot.com/

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
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