Skip to content

Commit

Permalink
Spelling, stable EXPECTORATE tests
Browse files Browse the repository at this point in the history
  • Loading branch information
smklein committed Feb 14, 2024
1 parent 1ec1c81 commit b2bdaff
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions nexus/db-queries/src/db/queries/region_allocation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pub fn allocation_query(
let seed = seed.to_le_bytes().to_vec();

let size_delta = block_size * blocks_per_extent * extent_count;
let redunancy: i64 = i64::try_from(REGION_REDUNDANCY_THRESHOLD).unwrap();
let redundancy: i64 = i64::try_from(REGION_REDUNDANCY_THRESHOLD).unwrap();

let builder = QueryBuilder::new().sql(
// Find all old regions associated with a particular volume
Expand Down Expand Up @@ -191,7 +191,7 @@ pub fn allocation_query(
ORDER BY md5((CAST(candidate_datasets.id as BYTEA) || ").param().sql(")) LIMIT ").param().sql("
),")
.bind::<sql_types::Bytea, _>(seed)
.bind::<sql_types::BigInt, _>(redunancy)
.bind::<sql_types::BigInt, _>(redundancy)
// Create the regions-to-be-inserted for the volume.
.sql("
candidate_regions AS (
Expand Down Expand Up @@ -255,10 +255,10 @@ pub fn allocation_query(
CAST(IF(((SELECT COUNT(DISTINCT dataset.pool_id) FROM (candidate_regions INNER JOIN dataset ON (candidate_regions.dataset_id = dataset.id)) LIMIT 1) >= ")).param().sql(concatcp!("), 'TRUE', '", NOT_ENOUGH_UNIQUE_ZPOOLS_SENTINEL, "') AS BOOL)
) AS insert
),"))
.bind::<sql_types::BigInt, _>(redunancy)
.bind::<sql_types::BigInt, _>(redunancy)
.bind::<sql_types::BigInt, _>(redunancy)
.bind::<sql_types::BigInt, _>(redunancy)
.bind::<sql_types::BigInt, _>(redundancy)
.bind::<sql_types::BigInt, _>(redundancy)
.bind::<sql_types::BigInt, _>(redundancy)
.bind::<sql_types::BigInt, _>(redundancy)
.sql("
inserted_regions AS (
INSERT INTO region
Expand Down Expand Up @@ -309,7 +309,7 @@ mod test {
// how the output SQL has been altered.
#[tokio::test]
async fn expectorate_query() {
let volume_id = Uuid::new_v4();
let volume_id = Uuid::nil();
let block_size = 512;
let blocks_per_extent = 4;
let extent_count = 8;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ UNION
(
SELECT updated_datasets.id, updated_datasets.time_created, updated_datasets.time_modified, updated_datasets.time_deleted, updated_datasets.rcgen, updated_datasets.pool_id, updated_datasets.ip, updated_datasets.port, updated_datasets.kind, updated_datasets.size_used, inserted_regions.id, inserted_regions.time_created, inserted_regions.time_modified, inserted_regions.dataset_id, inserted_regions.volume_id, inserted_regions.block_size, inserted_regions.blocks_per_extent, inserted_regions.extent_count
FROM (inserted_regions INNER JOIN updated_datasets ON (inserted_regions.dataset_id = updated_datasets.id))
) -- binds: [b1aa0a63-9afa-4fc3-b61e-0ebdc7854840, 16384, [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 3, b1aa0a63-9afa-4fc3-b61e-0ebdc7854840, 512, 4, 8, 3, 3, 3, 3]
) -- binds: [00000000-0000-0000-0000-000000000000, 16384, [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 3, 00000000-0000-0000-0000-000000000000, 512, 4, 8, 3, 3, 3, 3]
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ UNION
(
SELECT updated_datasets.id, updated_datasets.time_created, updated_datasets.time_modified, updated_datasets.time_deleted, updated_datasets.rcgen, updated_datasets.pool_id, updated_datasets.ip, updated_datasets.port, updated_datasets.kind, updated_datasets.size_used, inserted_regions.id, inserted_regions.time_created, inserted_regions.time_modified, inserted_regions.dataset_id, inserted_regions.volume_id, inserted_regions.block_size, inserted_regions.blocks_per_extent, inserted_regions.extent_count
FROM (inserted_regions INNER JOIN updated_datasets ON (inserted_regions.dataset_id = updated_datasets.id))
) -- binds: [b1aa0a63-9afa-4fc3-b61e-0ebdc7854840, 16384, [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 3, b1aa0a63-9afa-4fc3-b61e-0ebdc7854840, 512, 4, 8, 3, 3, 3, 3]
) -- binds: [00000000-0000-0000-0000-000000000000, 16384, [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 3, 00000000-0000-0000-0000-000000000000, 512, 4, 8, 3, 3, 3, 3]

0 comments on commit b2bdaff

Please sign in to comment.