Select Where != 'AA=='

Jun 9, 2010 at 5:43 PM

I've run into an issue executing select queries attempting to filter out null (AA==) values.  The queries I am trying to run are of the form:

select * from Domain where Attribute != 'AA=='

The problem is that the results contain plenty of items with these AA== values.  Should this be working as described or is there an alternative approach?  If it is any help I think the issue has to do with the == characters as queries of this form obviously work fine with other values.

 

Coordinator
Jun 10, 2010 at 12:44 AM
Edited Jun 10, 2010 at 3:12 PM

The value stored in SimpleDB is actually not "AA==" but a single null character ('\0'). The null character is not allowed in Xml and so is encoded as 'AA==' by the SimpleDB service for inclusion in the Xml response.

Try formulating your query so the comparison value is a string containing a single null character and let me know if that does/doesn't work. If it doesn't work I'll open an issue for a code fix to allow this type of query in the future and try to help you find another workaround.

UPDATE: I've verified that the following select syntax works correctly for excluding records with null character attributes:


string
select = "select * from Domain where Attribute != '\0'";

Also, keep in mind that you can configure Savant to stop storing these null characters by setting SavantConfig.NullPutBehavior to NullBehavior.Ignore.