更新时间:2026-06-11 GMT+08:00
分享

set_current_snapshot

基本语法

可使用set_current_snapshot设置表的当前快照ID。与回滚不同,该操作不要求目标快照必须是表当前状态的祖先快照。例如:

db.sample表的当前快照设置为ID为1的快照:

CALL prod.system.set_current_snapshot('db.sample', 1);

db.sample表的当前快照设置为标签s1对应的快照:

CALL prod.system.set_current_snapshot(table => 'db.sample', ref => 's1');

其中,表名字段的类型为string,快照ID字段的类型为long,“ref”为设置当前快照的快照引用(分支或标签),类型为string。且必须设置快照ID或ref,二者不可同时提供,也不可均不提供。

输出结果介绍请参见表1

表1 快照设置输出结果

参数

类型

说明

previous_snapshot_id

long

设置前的当前快照ID。

current_snapshot_id

long

设置后新的当前快照ID。

相关文档