Skip to content

Commit 5ac36f3

Browse files
committed
Use insert/update combination instead of select.
See bullet 2) for https://bugs.mysql.com/bug.php?id=45679.
1 parent ef4f7ee commit 5ac36f3

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

tests/SideBySide/CancelTests.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,26 @@ public async Task CancelCommandWithTokenBeforeExecuteReader()
231231
[Fact]
232232
public async Task CancelCompletedCommand()
233233
{
234+
await m_database.Connection.ExecuteAsync(@"drop table if exists cancel_completed_command;
235+
create table cancel_completed_command (
236+
id bigint unsigned,
237+
value varchar(45)
238+
);").ConfigureAwait(false);
239+
234240
using (var cmd = m_database.Connection.CreateCommand())
235241
{
236-
cmd.CommandText = @"select 1;";
242+
cmd.CommandText = @"insert into cancel_completed_command (id, value) values (1, null);";
237243

238244
using (await cmd.ExecuteReaderAsync().ConfigureAwait(false))
239245
cmd.Cancel();
240246
}
247+
248+
using (var cmd = m_database.Connection.CreateCommand())
249+
{
250+
cmd.CommandText = @"update cancel_completed_command SET value = ""value"" where id = 1;";
251+
252+
await cmd.ExecuteNonQueryAsync().ConfigureAwait(false);
253+
}
241254
}
242255

243256
[UnbufferedResultSetsFact]

0 commit comments

Comments
 (0)