Servant-Software-LLC / FileBased.DataProviders

ADO.NET & EF Core Data Providers for common serializable formats (JSON, XML, and CSV) stored to disk.
2 stars 1 forks source link

Bug: Improper interpretation of identifiers with square brackets. #43

Closed DaveRMaltby closed 1 year ago

DaveRMaltby commented 1 year ago

Our current implementation assumes that a space in between square brackets for a table name implies that the second word is the alias for the table name, when according to Delimited Identifiers, it is supposed to be intrepreted as the table name having a space in it.

For example, in our unit test for the DataAdapters, we are running a query that begins like: SELECT [c].[CustomerName], [o].[OrderDate], [oi].[Quantity], [p].[Name] FROM [Customers c]

As you can see, by the first field in the SELECT, it is using an table alias 'c' which if you look at the FROM shouldn't be aliased. The brackets there implies that there is a table named 'Customers c' (a table name with a space in it).