diff --git a/core/rs/core/src/changes_vtab_write.rs b/core/rs/core/src/changes_vtab_write.rs index c35339889..c9a28c249 100644 --- a/core/rs/core/src/changes_vtab_write.rs +++ b/core/rs/core/src/changes_vtab_write.rs @@ -107,6 +107,7 @@ fn did_cid_win( let ret = crsql_compare_sqlite_values(insert_val, local_value); reset_cached_stmt(col_val_stmt.stmt)?; // insert site id won and values differ. We should take the update. + // if values are the same (ret == 0) then we return false and do not take the update return Ok(ret != 0); } _ => { @@ -121,8 +122,6 @@ fn did_cid_win( return Err(ResultCode::ERROR); } } - - return Ok(ret > 0); } fn set_winner_clock( diff --git a/core/src/changes-vtab.c b/core/src/changes-vtab.c index ac089d101..923f68391 100644 --- a/core/src/changes-vtab.c +++ b/core/src/changes-vtab.c @@ -176,5 +176,9 @@ sqlite3_module crsql_changesModule = { /* xSavepoint */ 0, /* xRelease */ 0, /* xRollbackTo */ 0, - /* xShadowName */ 0, - /* xPreparedSql */ 0}; + /* xShadowName */ 0 +#ifdef LIBSQL + , + /* xPreparedSql */ 0 +#endif +};