Menu

#89 bad None type handling in selectBy method

closed-out-of-date
nobody
MySQL (29)
5
2005-06-01
2005-05-27
Anonymous
No

release 0.6.1, mysql connection

class Value (sqlobject.SQLObject):
_connection = conn

arg = sqlobject.ForeignKey ('arg')
value = sqlobject.StringCol (notNull = False,
default = None)

v = Value.selectBy (argID = 1, value = None)

which becomes something like:
select .... where arg_id = 1 and value = NULL
and is wrong query. What I expected was:
select .... where arg_id = 1 and value IS NULL

in MySQL "value = NULL" is different from "value is
NULL" (later is correct)

switching to sqlbuilder for the same query works nicely
with "Value.q.value == None", which becomes correct
"value is NULL"

Thank You.

Discussion

  • Oleg Broytman

    Oleg Broytman - 2005-06-01
    • status: open --> closed-out-of-date
     
  • Oleg Broytman

    Oleg Broytman - 2005-06-01

    Logged In: YES
    user_id=4799

    This has been fixed long ago in the Subversion repository.

     

Log in to post a comment.