Skip to content

Commit

Permalink
Run tests on MariaDB 11.6.
Browse files Browse the repository at this point in the history
This adds support for the 'parsec' plugin.

Signed-off-by: Bradley Grainger <[email protected]>
  • Loading branch information
bgrainger committed Jan 27, 2025
1 parent a64e5c4 commit 11937af
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .ci/docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ MYSQL_EXTRA=
MYSQL=mysql

if [[ "$IMAGE" == mariadb* ]]; then
MYSQL_EXTRA='--in-predicate-conversion-threshold=100000'
MYSQL_EXTRA='--in-predicate-conversion-threshold=100000 --plugin-maturity=beta'
fi
if [ "$IMAGE" == "mariadb:11.4" ]; then
if [ "$IMAGE" == "mariadb:11.4" ] || [ "$IMAGE" == "mariadb:11.6" ]; then
MYSQL='mariadb'
fi

Expand Down
4 changes: 4 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ jobs:
image: 'mariadb:11.4'
connectionStringExtra: ''
unsupportedFeatures: 'CachingSha2Password,CancelSleepSuccessfully,Json,RoundDateTime,QueryAttributes,Sha256Password,Tls11,UuidToBin,Redirection'
'MariaDB 11.6':
image: 'mariadb:11.6'
connectionStringExtra: ''
unsupportedFeatures: 'CachingSha2Password,CancelSleepSuccessfully,Json,RoundDateTime,QueryAttributes,Redirection,Sha256Password,Tls11,UuidToBin'
steps:
- template: '.ci/integration-tests-steps.yml'
parameters:
Expand Down
2 changes: 1 addition & 1 deletion docs/content/home.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Server | Versions | Notes
Amazon Aurora RDS | 2.x, 3.x | Use `Pipelining=False` [for Aurora 2.x](https://mysqlconnector.net/troubleshooting/aurora-freeze/)
Azure Database for MySQL | 5.7, 8.0 | Single Server and Flexible Server
Google Cloud SQL for MySQL | 5.6, 5.7, 8.0 |
MariaDB | 10.x (**10.6**, **10.11**), 11.x (**11.4**) |
MariaDB | 10.x (**10.6**, **10.11**), 11.x (**11.4**, **11.6**) |
MySQL | 5.5, 5.6, 5.7, 8.x (**8.0**, **8.4**), 9.x (**9.2**) | 5.5 is EOL and has some [compatibility issues](https://github.com/mysql-net/MySqlConnector/issues/1192); 5.6 and 5.7 are EOL
Percona Server | 5.6, 5.7, 8.0 |
PlanetScale | | See PlanetScale [MySQL compatibility notes](https://planetscale.com/docs/reference/mysql-compatibility)
Expand Down
2 changes: 2 additions & 0 deletions src/MySqlConnector/Protocol/CharacterSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,11 @@ internal enum CharacterSet : ushort
Utf8Mb3CroatianCaseInsensitiveMariaDb = 576,
Utf8Mb3MyanmarCaseInsensitive = 577,
Utf8Mb3ThaiUnicode520Weight2 = 578,
Utf8Mb3General1400AccentSensitiveCaseInsensitive = 579,
Utf8Mb4CroatianCaseInsensitiveMariaDb = 608,
Utf8Mb4MyanmarCaseInsensitive = 609,
Utf8Mb4ThaiUnicode520Weight2 = 610,
Utf8Mb4General1400AccentSensitiveCaseInsensitive = 611,
Ucs2CroatianCaseInsensitiveMariaDb = 640,
Ucs2MyanmarCaseInsensitive = 641,
Ucs2ThaiUnicode520Weight2 = 642,
Expand Down
2 changes: 2 additions & 0 deletions src/MySqlConnector/Protocol/Serialization/ProtocolUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ public static int GetBytesPerCharacter(CharacterSet characterSet)
case CharacterSet.Utf8Mb3CroatianCaseInsensitiveMariaDb:
case CharacterSet.Utf8Mb3MyanmarCaseInsensitive:
case CharacterSet.Utf8Mb3ThaiUnicode520Weight2:
case CharacterSet.Utf8Mb3General1400AccentSensitiveCaseInsensitive:
case CharacterSet.UjisJapaneseNoPadCaseInsensitive:
case CharacterSet.Utf8Mb3GeneralNoPadCaseInsensitive:
case CharacterSet.Utf8Mb3NoPadBinary:
Expand Down Expand Up @@ -384,6 +385,7 @@ public static int GetBytesPerCharacter(CharacterSet characterSet)
case CharacterSet.Utf8Mb4CroatianCaseInsensitiveMariaDb:
case CharacterSet.Utf8Mb4MyanmarCaseInsensitive:
case CharacterSet.Utf8Mb4ThaiUnicode520Weight2:
case CharacterSet.Utf8Mb4General1400AccentSensitiveCaseInsensitive:
case CharacterSet.Utf16CroatianCaseInsensitiveMariaDb:
case CharacterSet.Utf16MyanmarCaseInsensitive:
case CharacterSet.Utf16ThaiUnicode520Weight2:
Expand Down
2 changes: 1 addition & 1 deletion tests/IntegrationTests/CharacterSetTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void CollationConnection(bool reopenConnection)

var collation = connection.Query<string>(@"select @@collation_connection;").Single();
var expected = connection.ServerVersion.Substring(0, 2) is "8." or "9." ? "utf8mb4_0900_ai_ci" :
connection.ServerVersion.StartsWith("11.4.", StringComparison.Ordinal) ? "utf8mb4_uca1400_ai_ci" :
connection.ServerVersion.StartsWith("11.4.", StringComparison.Ordinal) || connection.ServerVersion.StartsWith("11.6.", StringComparison.Ordinal) ? "utf8mb4_uca1400_ai_ci" :
"utf8mb4_general_ci";
Assert.Equal(expected, collation);
}
Expand Down
13 changes: 10 additions & 3 deletions tests/IntegrationTests/TestUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,18 @@ private static async Task AssertExecuteScalarReturnsOneOrThrowsExceptionAsync(My
}
else
{
var ex = await Assert.ThrowsAsync<MySqlException>(async () => await command.ExecuteScalarAsync(token));
var ex = await Assert.ThrowsAnyAsync<Exception>(async () => await command.ExecuteScalarAsync(token));
MySqlException exception = ex as MySqlException;
while (exception is null && ex is not null)
{
ex = ex.InnerException;
exception = ex as MySqlException;
}
Assert.NotNull(exception);
#if MYSQL_DATA
Assert.Equal((int) expectedCode, ex.Number);
Assert.Equal((int) expectedCode, exception.Number);
#else
Assert.Equal(expectedCode, ex.ErrorCode);
Assert.Equal(expectedCode, exception.ErrorCode);
#endif
}
}
Expand Down

0 comments on commit 11937af

Please sign in to comment.