Querying a column of Guid type
See original GitHub issueWhich service(blob, file, queue, table) does this issue concern?
Table
Which version of the Azurite was used?
3.17.1
Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)
npm
What’s the Node.js version?
14.4.0
What problem was encountered?
When querying for a record with a column of Guid
type w/o specifying the keyword guid
in front of the value, Azurite returns the record where the real Storage Table would not.
Steps to reproduce the issue?
Step 1
Create a table with a custom column named InstructionId
with Guid
values in it.
Step 2
Write a value of a Guid
type into the table
Step 3
Query for the item using the PartitionKey
and the column value w/o using the guid
keyword.
Guid instructionId = someGuidValue;
var pages = client.QueryAsync<TableEntity>($"PartitionKey eq '{userIdDeviceIdCompositeKey}' and InstructionId eq '{instructionId}'", maxPerPage: 1);
Assuming the table contains the record, Azurite will return it. The real storage account will not. To make it work with the real storage account, the following query must be used:
Guid instructionId = someGuidValue;
var pages = client.QueryAsync<TableEntity>($"PartitionKey eq '{userIdDeviceIdCompositeKey}' and InstructionId eq guid'{instructionId}'", maxPerPage: 1);
Note the InstructionId eq
guid'{instructionId}'
Have you found a mitigation/solution?
No
Issue Analytics
- State:
- Created a year ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Understanding the GUID data type in SQL Server
GUID is a 16 byte binary SQL Server data type that is globally unique across tables, databases, and servers. The term GUID stands...
Read more >uniqueidentifier (Transact-SQL) - SQL Server - Microsoft Learn
A column or local variable of uniqueidentifier data type can be initialized to a value in the following ways:.
Read more >An Essential Guide To SQL Server GUID By Examples
In SQL Server, the UNIQUEIDENTIFIER data type holds GUID values. The following statements declare a variable with type UNIQUEIDENTIFIER and assign it a...
Read more >How to check if a value in a column is GUID in sql server?
I found a way to check it: SELECT 1 WHERE @StringToCompare LIKE REPLACE('00000000-0000-0000-0000-000000000000', '0', '[0-9a-fA-F]');.
Read more >Inserting a value into a global ID or GUID column in SQL ...
If you use SQL to insert records to a table that contains a global ID or GUID column, you must populate the column...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for raising this. Agreed, we are aiming for service behaviors rather than documented behavior. I am working on several related issues to entity types and querying. I shall roll this up into that work.
@blueww & @XiaoningLiu approved changes are checked into main, can you help with flagging this for a milestone / release? Thanks.