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
30 changes: 15 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ sudo apt-get install make gcc pkg-config clang postgresql-server-dev-14 libssl-d
Next you need [cargo-pgrx](https://github.com/tcdi/pgrx), which can be installed with

```bash
cargo install --version '=0.12.8' --force cargo-pgrx
cargo install --version '=0.12.9' --force cargo-pgrx
```

You must reinstall cargo-pgrx whenever you update your Rust compiler, since cargo-pgrx needs to be built with the same compiler as Toolkit.
Expand Down
58 changes: 58 additions & 0 deletions crates/udd-sketch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,7 @@ mod tests {
}
}

use crate::SketchHashKey::Invalid;
use quickcheck::*;

#[derive(Hash, PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Debug)]
Expand All @@ -685,6 +686,63 @@ mod tests {
}
}

#[test]
fn test_entry_insertion_order() {
let mut map = SketchHashMap {
map: HashMap::new(),
head: Invalid,
};

map.entry(SketchHashKey::Negative(i64::MIN)).count += 5;
map.entry(SketchHashKey::Negative(10)).count += 1;
map.entry(SketchHashKey::Positive(i64::MAX - 100)).count += 17;
map.entry(SketchHashKey::Zero).count += 7;
map.entry(SketchHashKey::Positive(-10)).count += 11;
map.entry(SketchHashKey::Negative(-10)).count += 3;
map.entry(SketchHashKey::Positive(10)).count += 13;

let keys: Vec<_> = map.iter().collect::<Vec<_>>();
assert_eq!(
keys,
vec![
(SketchHashKey::Negative(10), 1),
(SketchHashKey::Negative(-10), 3),
(SketchHashKey::Negative(i64::MIN), 5),
(SketchHashKey::Zero, 7),
(SketchHashKey::Positive(-10), 11),
(SketchHashKey::Positive(10), 13),
(SketchHashKey::Positive(i64::MAX - 100), 17),
]
);

// We add some things before the current head, insert some new ones,
// add some to the end, and again inbetween some others
map.entry(SketchHashKey::Negative(i64::MAX)).count += 3;
map.entry(SketchHashKey::Negative(-10)).count += 23;
map.entry(SketchHashKey::Positive(10)).count += 123;
map.entry(SketchHashKey::Positive(9)).count += 29;
map.entry(SketchHashKey::Positive(11)).count += 31;
map.entry(SketchHashKey::Positive(i64::MAX)).count += 8;

let keys: Vec<_> = map.iter().collect::<Vec<_>>();
assert_eq!(
keys,
vec![
(SketchHashKey::Negative(i64::MAX), 3),
(SketchHashKey::Negative(10), 1),
(SketchHashKey::Negative(-10), 26), // 3 + 23
(SketchHashKey::Negative(i64::MIN), 5),
(SketchHashKey::Zero, 7),
(SketchHashKey::Positive(-10), 11),
(SketchHashKey::Positive(9), 29),
(SketchHashKey::Positive(10), 136), // 13 + 123
(SketchHashKey::Positive(11), 31),
(SketchHashKey::Positive(i64::MAX - 100), 17),
(SketchHashKey::Positive(i64::MAX), 8),
]
);
}

#[quickcheck]
// Use multiple hashsets as input to allow a small number of duplicate values without getting ridiculous levels of duplication (as quickcheck is inclined to create)
fn fuzzing_test(
Expand Down
10 changes: 5 additions & 5 deletions extension/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ path = "./src/bin/pgrx_embed.rs"
crate-type = ["cdylib", "lib"]

[features]
default = ["pg16"]
default = ["pg17"]
pg12 = ["pgrx/pg12", "pgrx-tests/pg12"]
pg13 = ["pgrx/pg13", "pgrx-tests/pg13"]
pg14 = ["pgrx/pg14", "pgrx-tests/pg14"]
Expand All @@ -23,9 +23,9 @@ pg_test = ["approx"]
[dependencies]
# Keep synchronized with `cargo install --version N.N.N cargo-pgrx` in Readme.md and docker/ci/Dockerfile
# Also `pgrx-tests` down below in `dev-dependencies`.
pgrx = "=0.12.8"
pgrx-macros = "=0.12.8"
pgrx-sql-entity-graph = "=0.12.8"
pgrx = "=0.12.9"
pgrx-macros = "=0.12.9"
pgrx-sql-entity-graph = "=0.12.9"
encodings = {path="../crates/encodings"}
flat_serialize = {path="../crates/flat_serialize/flat_serialize"}
flat_serialize_macro = {path="../crates/flat_serialize/flat_serialize_macro"}
Expand Down Expand Up @@ -62,5 +62,5 @@ spfunc = "0.1.0"
statrs = "0.15.0"

[dev-dependencies]
pgrx-tests = "=0.12.8"
pgrx-tests = "=0.12.9"
approx = "0.4.0"
4 changes: 2 additions & 2 deletions tools/dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
# information across all those.

PG_VERSIONS='12 13 14 15 16 17'
# TODO: extend this with 16 this once TimescaleDB supports PostgreSQL 16: issue #5752
# TODO: extend this with 18 this once TimescaleDB supports PostgreSQL 18
TSDB_PG_VERSIONS='12 13 14 15 16 17'

CARGO_EDIT=0.11.2

# Keep synchronized with extension/Cargo.toml and `cargo install --version N.N.N cargo-pgrx` in Readme.md .
PGRX_VERSION=0.12.8
PGRX_VERSION=0.12.9

RUST_TOOLCHAIN=1.82.0
RUST_PROFILE=minimal
Expand Down
Loading