Skip to content

Commit 6165c90

Browse files
committed
MariaDB 11.5 support
This commit marks MariaDB 11.5 as a supported DB flavor, now that its GA release occurred on 14 Aug 2024. This is a rolling (short term support) MariaDB server release. Note the following schema management impacts of MariaDB 11.5: * MariaDB 11.5 changes the default collation for Unicode character sets to use uca1400_ai_ci collations. See MDEV-25829. This only required a minor tweak to one of Skeema's test suite helper functions. Aside from this, uca1400 collation support was already added in ee25133 (Skeema v1.11.1). * Prior to MariaDB 11.5, the TIMESTAMP column type suffered from the Y2K38 limitation. This has now been solved; see MDEV-32188. Skeema's lint-has-time annotation message has been adjusted accordingly for MariaDB, depending on the server version. * Users of foreign keys should note that MariaDB 11.5.2 suffers from bug MDEV-34756, which means that when you ALTER a table to add a new foreign key, the existing data in the table is not validated against the new constraint by default, even with foreign_key_checks=ON. For a workaround, set global variable innodb_alter_copy_bulk to OFF for now. We expect the next quarter's MariaDB server releases to fix this bug. However, since 11.5 is a rolling release, there won't be a MariaDB 11.5.3 release, as rolling releases don't have updates after GA (X.Y.2).
1 parent 1adb963 commit 6165c90

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

internal/linter/check_has_time.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,15 @@ func hasTimeChecker(table *tengo.Table, createStatement string, _ *tengo.Schema,
2424
for _, col := range table.Columns {
2525
var message string
2626
if strings.HasPrefix(col.TypeInDB, "timestamp") {
27-
message = fmt.Sprintf(
28-
"Column %s of %s is using type timestamp. This column type cannot store values beyond January 2038, which is problematic for software with long-term support requirements. It should not be used for storing arbitrary future dates, especially from user input.\nAlso note that timestamps have automatic timezone conversion behavior, between the time_zone session variable and UTC.",
29-
col.Name, table.ObjectKey(),
30-
)
27+
prefix := fmt.Sprintf("Column %s of %s is using type timestamp. ", col.Name, table.ObjectKey())
28+
suffix := "timestamps have automatic timezone conversion behavior, between the time_zone session variable and UTC."
29+
if opts.flavor.IsMySQL() {
30+
message = prefix + "This column type cannot store values beyond January 2038, which is problematic for software with long-term support requirements. It should not be used for storing arbitrary future dates, especially from user input.\nAlso note that " + suffix
31+
} else if opts.flavor.MinMariaDB(11, 5) { // MariaDB 11.5+ fixes the Y2K38 problem with timestamp (assuming 64bit platforms)
32+
message = prefix + "Note that " + suffix
33+
} else { /* opts.flavor.IsMariaDB() && !opts.flavor.MinMariaDB(11, 5) */
34+
message = prefix + "Prior to MariaDB 11.5, this column type cannot store values beyond January 2038. It should not be used for storing arbitrary future dates, especially from user input.\nAlso note that " + suffix
35+
}
3136
if oldTimestampDefaults && !alreadySeenTimestamp && !col.Nullable {
3237
when := "MySQL 8"
3338
if opts.flavor.IsMariaDB() {

internal/tengo/flavor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type Version [3]uint16
1717
// numbers; corresponding logic handles this appropriately.
1818
var (
1919
LatestMySQLVersion = Version{9, 0}
20-
LatestMariaDBVersion = Version{11, 4}
20+
LatestMariaDBVersion = Version{11, 5}
2121
)
2222

2323
// Variables representing the oldest major.minor releases of MySQL and MariaDB

internal/tengo/tengo_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,14 @@ func aTableForFlavor(flavor Flavor, nextAutoInc uint64) Table {
229229
if flavor.MinMySQL(8, 0, 29) || flavor.MinMariaDB(10, 6) {
230230
// MySQL 8.0.29+ and MariaDB 10.6+ report the legacy utf8 charset as utf8mb3.
231231
// MySQL 8.0.30+ and MariaDB 10.6+ also update collation names accordingly.
232+
// MariaDB 11.5+ changes utf8mb3's default collation to utf8mb3_uca1400_ai_ci.
232233
utf8mb3 = "utf8mb3"
233234
if !flavor.IsMySQL(8, 0, 29) {
234235
utf8mb3DefaultCollation = "utf8mb3_general_ci"
235236
}
237+
if flavor.MinMariaDB(11, 5) {
238+
utf8mb3DefaultCollation = "utf8mb3_uca1400_ai_ci"
239+
}
236240
}
237241
lastUpdateCol := &Column{
238242
Name: "last_update",

0 commit comments

Comments
 (0)