MySqlConnector icon indicating copy to clipboard operation
MySqlConnector copied to clipboard

`CommandBehavior.SchemaOnly` not working as expected.

Open guptaheena opened this issue 1 year ago • 3 comments
trafficstars

Software versions MySqlConnector version: Server type (MySQL, MariaDB, Aurora, etc.) and version: MySQL

Describe the bug The SchemaOnly command behaviour is not working as expected for DML commands such as insert/update. When executing CommandBehaviour.SchemaOnly on insert/update statements, it executes the command in the backend which is not the desired behaviour for this command.

Code sample string query ="" using var command = new MySqlCommand(query, connection) { CommandTimeout = connection.ConnectionTimeout }; MySqlDataReader mysqlDataReader = (MySqlDataReader)await command.ExecuteReaderAsync(CommandBehavior.SchemaOnly, requestCancellationToken).ConfigureAwait(false);

Expected behavior Only the schema of the table should be returned. The query should not be executed.

guptaheena avatar Mar 18 '24 08:03 guptaheena