fix(db): 外部驱动增加最低版本门,OceanBase 低于 0.1.12 时引导用户更新 - #260
Merged
Merged
Conversation
宿主此前只判断外部驱动是否已安装,不校验版本:OceanBase 0.1.12 之前的驱动对 无符号列发十进制文本,宿主反序列化会直接判类型不匹配 (invalid type: string "4", expected u64),整表读取失败;而旧驱动既不会被自动 更新,宿主也不会提示,用户只能看到一句读不懂的报错。 - DriverRequirement::Required 增加 minimum_version - required_external_driver 按驱动 id 声明最低版本(当前: oceanbase -> 0.1.12) - 连接守卫改为版本感知:已安装但低于最低版本时同样走安装/更新引导, 提示文案带"(最低版本 0.1.12)" - 安装流程沿用既有 find_database_driver_entry_for_requirement 校验市场版本 Refs #249
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #249
Description
The host only checked whether an external database driver was installed, never which version. OceanBase drivers before 0.1.12 encoded
u64cells as decimal text, while the host struct field isu64, so reading a table with unsigned columns failed withinvalid external driver response: invalid type: string "4", expected u64. The driver contract is already fixed on the driver side (navop-extensions#9, shipped as oceanbase 0.1.12), but installed drivers are never updated automatically and the host showed no hint, so users on 0.1.10/0.1.11 kept hitting an error they cannot act on.This PR makes the host version-aware for external drivers:
DriverRequirement::Requirednow carriesminimum_version: Option<String>.required_external_driverdeclares a minimum version per driver id (currentlyoceanbase->0.1.12); undeclared drivers keep the old no-minimum behavior.driver_version_meets_minimuminstead of a plain "is installed" check, so an installed-but-too-old driver also goes through the install/update flow, with the existing prompt text(最低版本 0.1.12).find_database_driver_entry_for_requirement, which refuses a marketplace entry below the required version.Serialization and the driver contract are unchanged; this only decides whether a connection is opened or the user is asked to update the driver first.
Screenshot
需要安装或更新驱动 …(最低版本 0.1.12), one click installs/updates from the marketplaceHow to Test
cargo test -p extension-runtime— 215 passed, 1 pre-existing failure (extension_runtime_wasm_contract_tests::db_tree_action_runs_registered_wasm_component), which also fails on a cleanmaincheckout without this change.oceanbase_external_driver_requires_a_minimum_versionassertsrequired_driver_for_configreturnsminimum_version: Some("0.1.12")foroceanbase, and thatdriver_version_meets_minimumrejects0.1.11while accepting0.1.12/0.1.13.duckdb_requires_duckdb_marketplace_driver,external_database_requires_its_driver_id(bothminimum_version: None).cargo clippy -p extension-runtime --all-targets— no warnings in the touched files.Checklist
cargo runfor story tests related to the changes.