Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ All changes that a user can see are in this file. The version is 0.M.patch, wher

- The facade takes a checkpoint when all the log rings together hold more than `Options::max_wal_size` bytes, default 1 GiB, as `max_wal_size` does in PostgreSQL. `Options::checkpoint_log` is now the limit of one ring (#454).

### Fixed

- The workspace builds again with Rust 1.88, the lowest supported version. Four match arms used `if let` guards, which need a newer Rust (#457).

## 0.1.53 (2026-10-20)

### Added
Expand Down
24 changes: 12 additions & 12 deletions crates/rupg-analyze/src/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,21 +235,21 @@ impl Analyzer<'_> {
for target in targets {
if let ExprKind::Var(var) = &target.expr.kind {
let relation = &self.level(var.levels_up).relations[var.relation];
target.origin = match &relation.subquery {
None if let Some(cte) = relation.cte.as_ref().filter(|c| c.write.is_some()) => {
usize::try_from(var.attnum - 1)
.ok()
.and_then(|i| cte.origins.get(i).copied().flatten())
}
None if relation.function.is_some()
|| relation.values.is_some()
|| relation.cte.is_some() =>
let written = relation.cte.as_ref().filter(|c| c.write.is_some());
target.origin = match (&relation.subquery, written) {
(None, Some(cte)) => usize::try_from(var.attnum - 1)
.ok()
.and_then(|i| cte.origins.get(i).copied().flatten()),
(None, None)
if relation.function.is_some()
|| relation.values.is_some()
|| relation.cte.is_some() =>
{
None
}
None => Some((relation.oid, var.attnum)),
Some(_) if relation.oid != 0 => Some((relation.oid, var.attnum)),
Some(sub) => usize::try_from(var.attnum - 1)
(None, None) => Some((relation.oid, var.attnum)),
(Some(_), _) if relation.oid != 0 => Some((relation.oid, var.attnum)),
(Some(sub), _) => usize::try_from(var.attnum - 1)
.ok()
.and_then(|i| sub.targets.iter().filter(|t| !t.junk).nth(i))
.and_then(|t| t.origin),
Expand Down
28 changes: 16 additions & 12 deletions crates/rupg-analyze/src/sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,14 @@ fn flatten_top<'a>(list: &'a List, has_sets: &mut bool) -> Vec<Flat<'a>> {
));
}
}
Some(node) if let Some(args) = implicit_row(node) => {
let mut items = Vec::new();
row_items(args, &mut items);
out.extend(items.into_iter().map(Flat::Item));
}
node => out.push(Flat::Item(node.as_ref())),
node => match node.as_ref().and_then(implicit_row) {
Some(args) => {
let mut items = Vec::new();
row_items(args, &mut items);
out.extend(items.into_iter().map(Flat::Item));
}
None => out.push(Flat::Item(node.as_ref())),
},
}
}
out
Expand All @@ -191,12 +193,14 @@ fn flatten_content(list: &List) -> Vec<Flat<'_>> {
Some(Node::GroupingSet(set)) => {
out.push(Flat::Set(set.kind, flatten_content(&set.content), place(set.location)));
}
Some(node) if let Some(args) = implicit_row(node) => {
let mut items = Vec::new();
row_items(args, &mut items);
out.push(Flat::Row(items));
}
node => out.push(Flat::Item(node.as_ref())),
node => match node.as_ref().and_then(implicit_row) {
Some(args) => {
let mut items = Vec::new();
row_items(args, &mut items);
out.push(Flat::Row(items));
}
None => out.push(Flat::Item(node.as_ref())),
},
}
}
out
Expand Down
10 changes: 5 additions & 5 deletions crates/rupg-session/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -613,8 +613,8 @@ impl Connection {
let mut updated = (Vec::new(), Vec::new());
let upsert = info.on_conflict.as_ref().filter(|conflict| !conflict.arbiters.is_empty());
let mut batches = Vec::new();
let (tag, count) = match info.kind {
WriteKind::Merge => {
let (tag, count) = match (info.kind, upsert) {
(WriteKind::Merge, _) => {
let Some(merge) = info.merge.as_ref() else {
return Err(Error::internal("a MERGE with no clauses"));
};
Expand All @@ -624,14 +624,14 @@ impl Connection {
view = done.view;
(CommandTag::Merge, done.count)
}
WriteKind::Insert if let Some(conflict) = upsert => {
(WriteKind::Insert, Some(conflict)) => {
let done = self.upsert(plan, info, conflict, params, &view, rows)?;
written = done.written;
new_rows = done.inserted;
updated = (done.new, done.old);
(CommandTag::Insert, done.count)
}
WriteKind::Insert => {
(WriteKind::Insert, None) => {
let count = rows.len() as u64;
if info.returning.is_some() {
written.clone_from(&rows);
Expand All @@ -652,7 +652,7 @@ impl Connection {
}
(CommandTag::Insert, count)
}
kind => {
(kind, _) => {
let update = kind == WriteKind::Update;
let (mut changes, mut given) = row_changes(rows, info)?;
let mut kept = Vec::new();
Expand Down