Skip to content

Commit cdfc6c7

Browse files
committed
Run DataTypes tests with prepared commands.
Call MySqlCommand.Prepare for all commands in the test class; normally this is a no-op (since IgnorePrepare=true in the connection string), but test runners could use a custom connection string to test prepared commands. Make MySqlCommand.Prepare a no-op so that the tests pass. Signed-off-by: Bradley Grainger <[email protected]>
1 parent 43e6da8 commit cdfc6c7

File tree

3 files changed

+86
-62
lines changed

3 files changed

+86
-62
lines changed

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,6 @@ public override void Prepare()
7070
throw new InvalidOperationException("Connection must be Open; current state is {0}".FormatInvariant(Connection.State));
7171
if (string.IsNullOrWhiteSpace(CommandText))
7272
throw new InvalidOperationException("CommandText must be specified");
73-
if (Connection.IgnorePrepare)
74-
return;
75-
76-
// NOTE: Prepared statements in MySQL are not currently supported.
77-
// 1) Only a subset of statements are actually preparable by the server: http://dev.mysql.com/worklog/task/?id=2871
78-
// 2) Although CLIENT_MULTI_STATEMENTS is supposed to mean that the Server "Can handle multiple statements per COM_QUERY and COM_STMT_PREPARE" (https://dev.mysql.com/doc/internals/en/capability-flags.html#flag-CLIENT_MULTI_STATEMENTS),
79-
// this is not actually true because "Prepared statement handles are defined to work only with strings that contain a single statement" (http://dev.mysql.com/doc/refman/5.7/en/c-api-multiple-queries.html).
80-
throw new NotSupportedException("Prepared commands are not supported.");
8173
}
8274

8375
public override string CommandText

0 commit comments

Comments
 (0)