Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion rust/src/runtime/schema_upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub(super) const DEVELOPMENT_ENGINE: &str = "rust-development";
pub(super) const UPGRADING_ENGINE: &str = "rust-upgrading";
/// Earlier native schema versions this binary upgrades in place. Release
/// candidates `3.0.0-rc.1` and `3.0.0-rc.2` shipped version 7.
pub(super) const UPGRADABLE: &[i64] = &[7, 8, 10, 11, 12, 13, 14, 15];
pub(super) const UPGRADABLE: &[i64] = &[7, 8, 10, 11, 12, 13, 14, 15, 16];

/// The refusal for a native marker this binary does not open as it is.
pub(super) fn marker_refusal(engine: &str, version: i64, current: i64) -> RuntimeError {
Expand Down Expand Up @@ -149,6 +149,16 @@ mod tests {
#[test]
fn markers_refuse_with_the_reason_that_names_the_next_step() {
assert_eq!(reason(marker_refusal(DEVELOPMENT_ENGINE, 7, 8)), "native_schema_upgrade_required");
// Every earlier released schema must name the upgrade step, including
// MySQL 16 from native 3.10/3.11 when this binary is at 17.
for previous in UPGRADABLE {
assert_eq!(
reason(marker_refusal(DEVELOPMENT_ENGINE, *previous, previous + 1)),
"native_schema_upgrade_required",
"version {previous}"
);
}
assert_eq!(reason(marker_refusal(DEVELOPMENT_ENGINE, 16, 17)), "native_schema_upgrade_required");
assert_eq!(reason(marker_refusal(DEVELOPMENT_ENGINE, 9, 8)), "native_schema_newer_than_binary");
assert_eq!(reason(marker_refusal(DEVELOPMENT_ENGINE, 99, 8)), "native_schema_newer_than_binary");
assert_eq!(reason(marker_refusal(DEVELOPMENT_ENGINE, 2, 8)), "unsupported_rust_schema");
Expand Down
Loading