odd mis-interpretation of bind parameter on OSX

Bug #686246 reported by Mike Bayer on 2010-12-06
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oursql
Undecided
Aaron Gallagher

Bug Description

I'm not sure what this one is about, as I've used OurSQL successfully on OSX in the past and I don't recall a bug like this one. This is reproducible with OurSQL 0.9.2 as well as trunk (your trunk still has "0.9.2" for __version__, FYI), on Mac OSX 10.6.5 MySQL 5.1.22:

    import oursql
    c = oursql.connect(user='scott', db='test', passwd='tiger')

    cursor = c.cursor()
    cursor.execute("select ?", ('foo', ))
    print cursor.fetchall()

result:

[(u'f',)]

it doesn't get much better if you try adding params:

    import oursql
    c = oursql.connect(user='scott', db='test', passwd='tiger')

    cursor = c.cursor()
    cursor.execute("select ?, 'bar', ?", ('foo', 'bat'))
    print cursor.fetchall()

[(u'f', u'bar', u'b')]

the correct answer is of course "(('foo', 'bar', 'bat'),)" which is what you get with MySQLdb, so this is an OurSQL issue.

Aaron Gallagher (habnabit) wrote :

I can't reproduce this bug on my computer. 10.6.5, mysql client/server 5.1.48, oursql trunk. I'll install 5.1.22 later tonight to try it, but I'm pretty sure this is a mysql bug that's since been fixed.

Changed in oursql:
assignee: nobody → Aaron Gallagher (habnabit)
status: New → Incomplete
Aaron Gallagher (habnabit) wrote :

Oh, also, python 2.6.6.

Mike Bayer (zzzeek) wrote :

I'm on 2.7.0+, which is in between 2.7.0 and 2.7.1. I can't get a 2.6 build to work for whatever reason, it says "ImportError: dynamic module does not define init function (initoursql)". Haven't seen that one before, maybe its something to do with cython, not sure.

Mike Bayer (zzzeek) wrote :

sure you wouldn't rather be writing Postgresql drivers instead ? :) mysql is such crap

Aaron Gallagher (habnabit) wrote :

I'll try using 2.7 trunk and see if I can't get it to do a thing.

And yes, I'm quite aware of how terrible mysql is. That's kinda why I wrote oursql in the first place; mysqldb embraces the same spirit of awfulness, when it really shouldn't. Unicode isn't difficult, etc.

Stephen Thorne (jerub) wrote :

I can't reproduce this either. Is this still an issue for you?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers