Skip to content

Commit 628fc08

Browse files
committed
Fix checking ignore empty update flags
1 parent e93f16c commit 628fc08

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

crates/core/src/crud_vtab.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ impl VirtualTable {
109109
let metadata = args[5];
110110
let data = Self::value_to_json(&args[3]);
111111

112-
if flags.include_old_only_when_changed()
112+
if flags.ignore_empty_update()
113113
&& op == "PATCH"
114114
&& data.map(|r| r.get()) == Some("{}")
115115
{

crates/core/src/schema/table_info.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ impl TableInfoFlags {
149149
self.0 & Self::INCLUDE_OLD_ONLY_WHEN_CHANGED != 0
150150
}
151151

152+
pub const fn ignore_empty_update(self) -> bool {
153+
self.0 & Self::IGNORE_EMPTY_UPDATE != 0
154+
}
155+
152156
const fn with_flag(self, flag: u32) -> Self {
153157
Self(self.0 | flag)
154158
}

0 commit comments

Comments
 (0)