Skip to content

Commit b73d723

Browse files
committed
Don't quote DestinationTableName. Fixes #818
1 parent ef01e58 commit b73d723

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/content/api/mysql-bulk-copy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ The number of seconds for the operation to complete before it times out, or `0`
5454

5555
`public string DestinationTableName { get; set; }`
5656

57-
Name of the destination table on the server. (This name shouldn't be quoted or escaped.)
57+
Name of the destination table on the server. (This name needs to be quoted if it contains special characters.)
5858

5959
`public int NotifyAfter { get; set; }`
6060

src/MySqlConnector/MySql.Data.MySqlClient/MySqlBulkCopy.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ private async ValueTask WriteToServerAsync(IOBehavior ioBehavior, CancellationTo
139139
Local = true,
140140
NumberOfLinesToSkip = 0,
141141
Source = this,
142-
TableName = QuoteIdentifier(tableName),
142+
TableName = tableName,
143143
Timeout = BulkCopyTimeout,
144144
};
145145

@@ -153,7 +153,7 @@ private async ValueTask WriteToServerAsync(IOBehavior ioBehavior, CancellationTo
153153
// if no user-supplied column mappings, compute them from the destination schema
154154
if (ColumnMappings.Count == 0)
155155
{
156-
using var cmd = new MySqlCommand("select * from " + QuoteIdentifier(tableName) + ";", m_connection, m_transaction);
156+
using var cmd = new MySqlCommand("select * from " + tableName + ";", m_connection, m_transaction);
157157
using var reader = (MySqlDataReader) await cmd.ExecuteReaderAsync(CommandBehavior.SchemaOnly, ioBehavior, cancellationToken).ConfigureAwait(false);
158158
var schema = reader.GetColumnSchema();
159159
for (var i = 0; i < schema.Count; i++)

0 commit comments

Comments
 (0)