diff --git a/FU.xs b/FU.xs index ef8d60b..221740b 100644 --- a/FU.xs +++ b/FU.xs @@ -55,7 +55,6 @@ if (!ix) ix = FUPG_CACHE;\ if (items == 1 || SvTRUE(ST(1))) x->stflags |= ix; \ else x->stflags &= ~ix; \ - XSRETURN(1); \ } while(0) MODULE = FU @@ -343,6 +342,7 @@ void cache(fupg_st *x, ...) CODE: if (ix == 0 && x->prepared) fu_confess("Invalid attempt to change statement configuration after it has already been prepared or executed"); FUPG_STFLAGS; + XSRETURN(1); void exec(fupg_st *st) CODE: diff --git a/t/pgconnect.t b/t/pgconnect.t index d2dfbf5..798734c 100644 --- a/t/pgconnect.t +++ b/t/pgconnect.t @@ -17,7 +17,9 @@ okerr FATAL => connect => qr/missing "=" after "invalid"/; ok FU::Pg::lib_version() > 100000; -my $conn = FU::Pg->connect($ENV{FU_TEST_DB})->text->cache(0); +my $conn = FU::Pg->connect($ENV{FU_TEST_DB}); +$conn->text; +$conn->cache(0); $conn->_debug_trace(0); is ref $conn, 'FU::Pg::conn'; @@ -364,7 +366,9 @@ subtest 'txn', sub { } subtest 'Prepared statement cache', sub { - my $txn = $conn->cache_size(2)->txn->cache; + $conn->cache_size(2); + my $txn = $conn->txn; + $txn->cache; my sub numexec($sql) { $txn->q('SELECT generic_plans + custom_plans FROM pg_prepared_statements WHERE statement = $1', $sql)->cache(0)->val }