On 03/31/2014 09:24 AM, Solly Ross wrote:
IMHO,Stringifying None and then expecting the *string* to match NULL is wrong.
Could we check to see if `filters[filter_name]` is None and deal with that case
separately
(i.e `if filters[filter_name] is None:
filter = column_is_null_check
else:
filter = column_attr.op(db_regexp_op)(
str(filters[filter_name]))`)?
I think we actually should do two separate things.
1) As you suggest, we should special-case testing for "None". I'm not
sure that it should be in regex_filter(), it might make more sense to do
it in instance_get_all_by_filters() and add a comment to regex_filter()
that it doesn't match "None".
2) The sqlite regexp() function should be modified to behave like mysql
regexp() so that we don't trigger other mismatches in the future.
Chris
_______________________________________________
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev