Skip to content

Commit

Permalink
Passing command arguments without Option
Browse files Browse the repository at this point in the history
  • Loading branch information
YohDeadfall committed Sep 9, 2024
1 parent 56446f5 commit 4eb4aa6
Show file tree
Hide file tree
Showing 14 changed files with 139 additions and 153 deletions.
2 changes: 1 addition & 1 deletion pgrx-tests/src/tests/array_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ mod tests {
.select(
"SELECT serde_serialize_array_i32($1)",
None,
Some(&[(PgBuiltInOids::INT4ARRAYOID.oid(), owned_vec.as_slice().into_datum())]),
&[(PgBuiltInOids::INT4ARRAYOID.oid(), owned_vec.as_slice().into_datum())],
)?
.first()
.get_one::<Json>()
Expand Down
4 changes: 2 additions & 2 deletions pgrx-tests/src/tests/bgworker_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub extern "C" fn bgworker(arg: pg_sys::Datum) {
.update(
"INSERT INTO tests.bgworker_test VALUES ($1);",
None,
Some(&[(PgOid::BuiltIn(PgBuiltInOids::INT4OID), arg.into_datum())]),
&[(PgOid::BuiltIn(PgBuiltInOids::INT4OID), arg.into_datum())],
)
.map(|_| ())
})
Expand Down Expand Up @@ -77,7 +77,7 @@ pub extern "C" fn bgworker_return_value(arg: pg_sys::Datum) {
c.update(
"INSERT INTO tests.bgworker_test_return VALUES ($1)",
None,
Some(&[(PgOid::BuiltIn(PgBuiltInOids::INT4OID), val.into_datum())]),
&[(PgOid::BuiltIn(PgBuiltInOids::INT4OID), val.into_datum())],
)
.map(|_| ())
})
Expand Down
2 changes: 1 addition & 1 deletion pgrx-tests/src/tests/heap_tuple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ mod tests {
fn test_tuple_desc_clone() -> Result<(), spi::Error> {
let result = Spi::connect(|client| {
let query = "select * from generate_lots_of_dogs()";
client.select(query, None, None).map(|table| table.len())
client.select(query, None, &[][..]).map(|table| table.len())
})?;
assert_eq!(result, 10_000);
Ok(())
Expand Down
8 changes: 6 additions & 2 deletions pgrx-tests/src/tests/pg_cast_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ mod tests {
#[pg_test]
fn test_pg_cast_assignment_type_cast() {
let _ = Spi::connect(|mut client| {
client.update("CREATE TABLE test_table(value int4);", None, None)?;
client.update("INSERT INTO test_table VALUES('{\"a\": 1}'::json->'a');", None, None)?;
client.update("CREATE TABLE test_table(value int4);", None, &[][..])?;
client.update(
"INSERT INTO test_table VALUES('{\"a\": 1}'::json->'a');",
None,
&[][..],
)?;

Ok::<_, spi::Error>(())
});
Expand Down
Loading

0 comments on commit 4eb4aa6

Please sign in to comment.