WindowsAzure/azure-sdk-for-node — Issue #49: TableQuery _replaceOperators function can overwrite Partition Key results
Author: andrerod
Created: 2012-02-06 07:04:59+00:00
State: open

I am writing a function that encodes a URL. The resulting partition key is:

aHR0cDovL2ZlZWRzLmZlZWRidXJuZXIuY29tL2ppbXdhbmdzYmxvZw==

However, when I use our TableQuery object to create a query containing this string like so:

var tableQuery = azure.TableQuery.select()
.from(feedDataTable)
.where('PartitionKey eq \'' + base64.encode64(feedUrl) + '\'');

The resulting query that gets pushed to the server is

PartitionKey eq 'aHR0cDovL2ZlZWRzLmZlZWRidXJuZXIuY29tL2ppbXdhbmdzYmxvZweq'

Which will return no results as the trailing == have been replaced by eq as per the _replaceOperators function in TableQuery. We should consider updating this to be a little smarter about when it does the replacement.