Closed wangjia184 closed 4 years ago
The reason is that, when ExecuteNonQueryAsync fails
Your original exception is probably being overwritten by the KeyNotFoundException
, but can you explain how or why the original failure is occurring during the bulk load?
The supplied stream contains NULL
but quotation is not used hence it cannot be recognized.
Anyway, because the exception is overridden in finally
block, it makes harder to locate the issue.
When loading a streaming into a table,
MySqlBulkLoader.LoadAsync()
may fail withKeyNotFoundException
My code:
The reason is that, when
ExecuteNonQueryAsync
fails,closeStream
is not set tofalse
but the key does not exist ins_sources
.KeyNotFoundException
is raised in thefinally
block when callingGetAndRemoveSource
https://github.com/mysql-net/MySqlConnector/blob/bec354497d8b26883bf85f07bfdd8abc1222ae55/src/MySqlConnector/MySql.Data.MySqlClient/MySqlBulkLoader.cs#L209