From 16d1e7e6a90ab8f4e7ff2b63b0489d6dd06882b3 Mon Sep 17 00:00:00 2001 From: PThorpe92 Date: Sat, 27 Sep 2025 07:51:59 -0400 Subject: [PATCH] Rename function and update comment to match behavior --- core/translate/upsert.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/core/translate/upsert.rs b/core/translate/upsert.rs index 96ae01bac..4696f10b9 100644 --- a/core/translate/upsert.rs +++ b/core/translate/upsert.rs @@ -124,9 +124,8 @@ fn effective_collation_for_index_col(idx_col: &IndexColumn, table: &Table) -> St .unwrap_or_else(|| "binary".to_string()) } -/// Match ON CONFLICT target to the PRIMARY KEY, if any. -/// If no target is specified, it is an automatic match for PRIMARY KEY -pub fn upsert_matches_pk(upsert: &Upsert, table: &Table) -> bool { +/// Match ON CONFLICT target to the PRIMARY KEY/rowid alias. +pub fn upsert_matches_rowid_alias(upsert: &Upsert, table: &Table) -> bool { let Some(t) = upsert.index.as_ref() else { // omitted target matches everything, CatchAll handled elsewhere return false; @@ -302,7 +301,7 @@ pub fn resolve_upsert_target( } // Targeted: must match PK, only if PK is a rowid alias - if upsert_matches_pk(upsert, table) { + if upsert_matches_rowid_alias(upsert, table) { return Ok(ResolvedUpsertTarget::PrimaryKey); }