@@ -125,6 +125,8 @@ public ConnectionSettings(MySqlConnectionStringBuilder csb)
125
125
UseXaTransactions = csb . UseXaTransactions ;
126
126
}
127
127
128
+ public ConnectionSettings CloneWith ( string host , int port , string userId , bool isRedirected ) => new ConnectionSettings ( this , host , port , userId , isRedirected ) ;
129
+
128
130
private static MySqlGuidFormat GetEffectiveGuidFormat ( MySqlGuidFormat guidFormat , bool oldGuids )
129
131
{
130
132
switch ( guidFormat )
@@ -210,6 +212,7 @@ private static MySqlGuidFormat GetEffectiveGuidFormat(MySqlGuidFormat guidFormat
210
212
public bool UseXaTransactions { get ; }
211
213
212
214
public byte [ ] ? ConnectionAttributes { get ; set ; }
215
+ public bool IsRedirected { get ; }
213
216
214
217
// Helper Functions
215
218
int ? m_connectionTimeoutMilliseconds ;
@@ -235,6 +238,66 @@ public int ConnectionTimeoutMilliseconds
235
238
}
236
239
}
237
240
241
+ private ConnectionSettings ( ConnectionSettings other , string host , int port , string userId , bool isRedirected )
242
+ {
243
+ ConnectionStringBuilder = other . ConnectionStringBuilder ;
244
+ ConnectionString = other . ConnectionString ;
245
+
246
+ ConnectionProtocol = MySqlConnectionProtocol . Sockets ;
247
+ HostNames = new [ ] { host } ;
248
+ LoadBalance = other . LoadBalance ;
249
+ Port = port ;
250
+ PipeName = other . PipeName ;
251
+
252
+ UserID = userId ;
253
+ Password = other . Password ;
254
+ Database = other . Database ;
255
+
256
+ SslMode = other . SslMode ;
257
+ CertificateFile = other . CertificateFile ;
258
+ CertificatePassword = other . CertificatePassword ;
259
+ SslCertificateFile = other . SslCertificateFile ;
260
+ SslKeyFile = other . SslKeyFile ;
261
+ CACertificateFile = other . CACertificateFile ;
262
+ CertificateStoreLocation = other . CertificateStoreLocation ;
263
+ CertificateThumbprint = other . CertificateThumbprint ;
264
+
265
+ Pooling = other . Pooling ;
266
+ ConnectionLifeTime = other . ConnectionLifeTime ;
267
+ ConnectionReset = other . ConnectionReset ;
268
+ ConnectionIdlePingTime = other . ConnectionIdlePingTime ;
269
+ ConnectionIdleTimeout = other . ConnectionIdleTimeout ;
270
+ MinimumPoolSize = other . MinimumPoolSize ;
271
+ MaximumPoolSize = other . MaximumPoolSize ;
272
+
273
+ AllowLoadLocalInfile = other . AllowLoadLocalInfile ;
274
+ AllowPublicKeyRetrieval = other . AllowPublicKeyRetrieval ;
275
+ AllowUserVariables = other . AllowUserVariables ;
276
+ AllowZeroDateTime = other . AllowZeroDateTime ;
277
+ ApplicationName = other . ApplicationName ;
278
+ AutoEnlist = other . AutoEnlist ;
279
+ ConnectionTimeout = other . ConnectionTimeout ;
280
+ ConvertZeroDateTime = other . ConvertZeroDateTime ;
281
+ DateTimeKind = other . DateTimeKind ;
282
+ DefaultCommandTimeout = other . DefaultCommandTimeout ;
283
+ ForceSynchronous = other . ForceSynchronous ;
284
+ IgnoreCommandTransaction = other . IgnoreCommandTransaction ;
285
+ IgnorePrepare = other . IgnorePrepare ;
286
+ InteractiveSession = other . InteractiveSession ;
287
+ GuidFormat = other . GuidFormat ;
288
+ Keepalive = other . Keepalive ;
289
+ NoBackslashEscapes = other . NoBackslashEscapes ;
290
+ PersistSecurityInfo = other . PersistSecurityInfo ;
291
+ ServerRsaPublicKeyFile = other . ServerRsaPublicKeyFile ;
292
+ ServerSPN = other . ServerSPN ;
293
+ TreatTinyAsBoolean = other . TreatTinyAsBoolean ;
294
+ UseAffectedRows = other . UseAffectedRows ;
295
+ UseCompression = other . UseCompression ;
296
+ UseXaTransactions = other . UseXaTransactions ;
297
+
298
+ IsRedirected = isRedirected ;
299
+ }
300
+
238
301
static readonly string [ ] s_localhostPipeServer = { "." } ;
239
302
}
240
303
}
0 commit comments