You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/MySqlConnector/MySql.Data.MySqlClient/MySqlCommand.cs
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -72,6 +72,11 @@ public override object ExecuteScalar()
72
72
73
73
publicoverridevoidPrepare()
74
74
{
75
+
if(Connection==null)
76
+
thrownewInvalidOperationException("Connection property must be non-null.");
77
+
if(Connection.State!=ConnectionState.Open)
78
+
thrownewInvalidOperationException("Connection must be Open; current state is {0}".FormatInvariant(Connection.State));
79
+
75
80
// NOTE: Prepared statements in MySQL are not currently supported.
76
81
// 1) Only a subset of statements are actually preparable by the server: http://dev.mysql.com/worklog/task/?id=2871
77
82
// 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),
0 commit comments