← Back to team overview

agesys-dev team mailing list archive

[Bug 686246] Re: odd mis-interpretation of bind parameter on OSX

 

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.

-- 
You received this bug notification because you are a member of Agesys
Team, which is subscribed to oursql.
https://bugs.launchpad.net/bugs/686246

Title:
  odd mis-interpretation of bind parameter on OSX

Status in oursql:
  Incomplete

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.





References