On 03/27/2014 04:47 PM, Chris Friesen wrote:

Interestingly, unit test
nova.tests.api.openstack.compute.contrib.test_server_groups.ServerGroupTest.test_display_members
passes just fine, and it seems to be running the same sqlalchemy code.

Is this a case where sqlite behaves differently from mysql?

Sorry to keep replying to myself, but this might actually hit us other places.

Down in db/sqlalchemy/api.py we end up calling


query = query.filter(column_attr.op(db_regexp_op)('None'))


When using mysql, it looks like a regexp comparison of the string 'None' against a NULL field fails to match.

Since sqlite doesn't have its own regexp function we provide one in openstack/common/db/sqlalchemy/session.py. In the buggy case we end up calling it as regexp('None', None), where the types are "unicode" and "NoneType". However, we end up converting the second arg to text type before calling reg.search() on it, so it matches.

Chris

_______________________________________________
OpenStack-dev mailing list
[email protected]
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to