mikependon / RepoDB

A hybrid ORM library for .NET.
Apache License 2.0
1.68k stars 122 forks source link

#1132 Bug: PostgreSQL BinaryBulkMerge not working when table has name "schema.table" #1141

Closed SergerGood closed 1 year ago

SergerGood commented 1 year ago

When we call bulk methods for tables with schema, we get result _RepoDb_BinaryBulkMerge_schema.table in this line https://github.com/mikependon/RepoDB/blob/3dc60f117dcddc9cade2d2071570c93599530f97/RepoDb.Extensions/RepoDb.PostgreSql.BulkOperations/RepoDb.PostgreSql.BulkOperations/Extensions/NpgsqlText.cs#L1175

So, when trying to use this name, we call the AsQuoted method https://github.com/mikependon/RepoDB/blob/74ced7851a8256460170c0429ab391e705f8b0b2/RepoDb.Extensions/RepoDb.PostgreSql.BulkOperations/RepoDb.PostgreSql.BulkOperations/Extensions/NpgsqlPseudoTable.cs#L357 and get new table with schema "_RepoDb_BinaryBulkMerge_schema"."table"

To avoid this I added call the AsAlphaNumeric method.

mikependon commented 1 year ago

Thanks for this PR.