Skip to content

Commit bc6785e

Browse files
committed
Use troubleshooting URLs at the mysqlconnector.net domain.
1 parent 72ee684 commit bc6785e

File tree

9 files changed

+43
-12
lines changed

9 files changed

+43
-12
lines changed

docs/content/overview/version-history.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ weight: 30
723723

724724
* **Breaking** `MySqlBulkLoader` (for local files) and `LOAD DATA LOCAL INFILE` are disabled by default.
725725
* Set `AllowLoadLocalInfile=true` in the connection string to enable loading local data.
726-
* This is a security measure; see https://fl.vu/mysql-load-data for details.
726+
* This is a security measure; see https://mysqlconnector.net/load-data for details.
727727
* Add `AllowLoadLocalInfile` connection string option: [#643](https://github.com/mysql-net/MySqlConnector/issues/643).
728728
* Add `SslCert` and `SslKey` connection string options to specify a client certificate using PEM files: [#641](https://github.com/mysql-net/MySqlConnector/issues/641).
729729
* Add `SslCa` alias for the `CACertificateFile` connection string option: [#640](https://github.com/mysql-net/MySqlConnector/issues/640).

docs/content/troubleshooting/transaction-usage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ menu:
1616

1717
When using `MySqlTransaction` from a C# program, you may receive the following error:
1818

19-
* **System.InvalidOperationException: The transaction associated with this command is not the connection's active transaction; see https://fl.vu/mysql-trans**
19+
* **System.InvalidOperationException: The transaction associated with this command is not the connection's active transaction**
2020

2121
By default, MySqlConnector requires `MySqlCommand.Transaction` to be set to the connection's active transaction in order for the command to be executed successfully. This strictness is intended to catch programming bugs related to using the wrong transaction, a disposed transaction, or forgetting to set the transaction (and using the default value `null`).
2222

2323
However, this strictness can make migrating from Connector/NET more difficult, as it may require significant code changes to pass the current transaction through to all command objects. It can also be challenging when using a library like Dapper that creates the `MySqlCommand` objects itself.
2424

2525
## Workaround: Use IgnoreCommandTransaction=true
2626

27-
To easily migrate code from Connector/NET, use the `IgnoreCommandTransaction=true` connection string setting to emulate Connector/NET's behaviour and not validate the value of `MySqlCommand.Transaction`. By doing this, you will not need the code fixes prescribed below.
27+
To easily migrate code from Connector/NET, use the `IgnoreCommandTransaction=true` connection string setting to emulate Connector/NET's behavior and not validate the value of `MySqlCommand.Transaction`. By doing this, you will not need the code fixes prescribed below.
2828

2929
## Code Fix: Set MySqlCommand.Transaction
3030

netlify.toml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,34 @@ from = "/connection%E2%80%91options/"
124124
to = "/connection-options/"
125125
status = 301
126126
force = true
127+
128+
[[redirects]]
129+
from = "/conn-reuse"
130+
to = "/troubleshooting/connection-reuse/"
131+
status = 301
132+
force = true
133+
134+
[[redirects]]
135+
from = "/delimiter"
136+
to = "/troubleshooting/delimiter/"
137+
status = 301
138+
force = true
139+
140+
[[redirects]]
141+
from = "/load-data"
142+
to = "/troubleshooting/load-data-local-infile/"
143+
status = 301
144+
force = true
145+
146+
[[redirects]]
147+
from = "/param-type"
148+
to = "/troubleshooting/parameter-types/"
149+
status = 301
150+
force = true
151+
152+
[[redirects]]
153+
from = "/trans"
154+
to = "/troubleshooting/transaction-usage/"
155+
status = 301
156+
force = true
157+

src/MySqlConnector/Core/ResultSet.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ public async Task ReadResultSetHeaderAsync(IOBehavior ioBehavior)
6262
try
6363
{
6464
if (!Connection.AllowLoadLocalInfile)
65-
throw new NotSupportedException("To use LOAD DATA LOCAL INFILE, set AllowLoadLocalInfile=true in the connection string. See https://fl.vu/mysql-load-data");
65+
throw new NotSupportedException("To use LOAD DATA LOCAL INFILE, set AllowLoadLocalInfile=true in the connection string. See https://mysqlconnector.net/load-data");
6666
var localInfile = LocalInfilePayload.Create(payload.Span);
6767
var hasSourcePrefix = localInfile.FileName.StartsWith(MySqlBulkLoader.SourcePrefix, StringComparison.Ordinal);
6868
if (!IsHostVerified(Connection) && !hasSourcePrefix)
69-
throw new NotSupportedException("Use SourceStream or SslMode >= VerifyCA for LOAD DATA LOCAL INFILE. See https://fl.vu/mysql-load-data");
69+
throw new NotSupportedException("Use SourceStream or SslMode >= VerifyCA for LOAD DATA LOCAL INFILE. See https://mysqlconnector.net/load-data");
7070

7171
var source = hasSourcePrefix ?
7272
MySqlBulkLoader.GetAndRemoveSource(localInfile.FileName) :

src/MySqlConnector/Core/ServerSession.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ public void StartQuerying(ICancellableCommand command)
285285
if (m_state is State.Querying or State.CancelingQuery)
286286
{
287287
CannotExecuteNewCommandInState(m_logger, Id, m_state);
288-
throw new InvalidOperationException("This MySqlConnection is already in use. See https://fl.vu/mysql-conn-reuse");
288+
throw new InvalidOperationException("This MySqlConnection is already in use. See https://mysqlconnector.net/conn-reuse");
289289
}
290290

291291
VerifyState(State.Connected);
@@ -940,7 +940,7 @@ public static void ThrowIfStatementContainsDelimiter(MySqlException exception, I
940940
var parser = new DelimiterSqlParser(command);
941941
parser.Parse(command.CommandText);
942942
if (parser.HasDelimiter)
943-
throw new MySqlException(MySqlErrorCode.DelimiterNotSupported, "'DELIMITER' should not be used with MySqlConnector. See https://fl.vu/mysql-delimiter", exception);
943+
throw new MySqlException(MySqlErrorCode.DelimiterNotSupported, "'DELIMITER' should not be used with MySqlConnector. See https://mysqlconnector.net/delimiter", exception);
944944
}
945945
}
946946

src/MySqlConnector/MySqlBatch.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ private bool IsValid([NotNullWhen(false)] out Exception? exception)
334334
else if (Connection.State is not ConnectionState.Open and not ConnectionState.Connecting)
335335
exception = new InvalidOperationException($"Connection must be Open; current state is {Connection.State}");
336336
else if (!Connection.IgnoreCommandTransaction && Transaction != Connection.CurrentTransaction)
337-
exception = new InvalidOperationException("The transaction associated with this batch is not the connection's active transaction; see https://fl.vu/mysql-trans");
337+
exception = new InvalidOperationException("The transaction associated with this batch is not the connection's active transaction; see https://mysqlconnector.net/trans");
338338
else if (BatchCommands.Count == 0)
339339
exception = new InvalidOperationException("BatchCommands must contain a command");
340340
else

src/MySqlConnector/MySqlBulkLoader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ internal async ValueTask<int> LoadAsync(IOBehavior ioBehavior, CancellationToken
202202
try
203203
{
204204
if (Local && !Connection.AllowLoadLocalInfile)
205-
throw new NotSupportedException("To use MySqlBulkLoader.Local=true, set AllowLoadLocalInfile=true in the connection string. See https://fl.vu/mysql-load-data");
205+
throw new NotSupportedException("To use MySqlBulkLoader.Local=true, set AllowLoadLocalInfile=true in the connection string. See https://mysqlconnector.net/load-data");
206206

207207
using var cmd = new MySqlCommand(CreateSql(), Connection, Connection.CurrentTransaction)
208208
{

src/MySqlConnector/MySqlCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ private bool IsValid([NotNullWhen(false)] out Exception? exception)
448448
else if (Connection.State is not ConnectionState.Open and not ConnectionState.Connecting)
449449
exception = new InvalidOperationException($"Connection must be Open; current state is {Connection.State}");
450450
else if (!Connection.IgnoreCommandTransaction && Transaction != Connection.CurrentTransaction)
451-
exception = new InvalidOperationException("The transaction associated with this command is not the connection's active transaction; see https://fl.vu/mysql-trans");
451+
exception = new InvalidOperationException("The transaction associated with this command is not the connection's active transaction; see https://mysqlconnector.net/trans");
452452
else if (string.IsNullOrWhiteSpace(CommandText))
453453
exception = new InvalidOperationException("CommandText must be specified");
454454
return exception is null;

src/MySqlConnector/MySqlParameter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ internal void AppendSqlString(ByteBufferWriter writer, StatementPreparerOptions
556556
}
557557
else
558558
{
559-
throw new NotSupportedException($"Parameter type {Value.GetType().Name} is not supported; see https://fl.vu/mysql-param-type. Value: {Value}");
559+
throw new NotSupportedException($"Parameter type {Value.GetType().Name} is not supported; see https://mysqlconnector.net/param-type. Value: {Value}");
560560
}
561561

562562
static void WriteString(ByteBufferWriter writer, bool noBackslashEscapes, ReadOnlySpan<char> value)
@@ -873,7 +873,7 @@ private void AppendBinary(ByteBufferWriter writer, object value, StatementPrepar
873873
}
874874
else
875875
{
876-
throw new NotSupportedException($"Parameter type {value.GetType().Name} is not supported; see https://fl.vu/mysql-param-type. Value: {value}");
876+
throw new NotSupportedException($"Parameter type {value.GetType().Name} is not supported; see https://mysqlconnector.net/param-type. Value: {value}");
877877
}
878878
}
879879

0 commit comments

Comments
 (0)