From 9567f1f99b00eb57d15b346a2b26eef06a35a386 Mon Sep 17 00:00:00 2001 From: David Cook Date: Wed, 7 Aug 2024 01:15:10 +0000 Subject: [PATCH] Bug 37508: Test for errors when returning an aliased password column Signed-off-by: David Cook Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- t/db_dependent/Reports/Guided.t | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Reports/Guided.t b/t/db_dependent/Reports/Guided.t index 0db1a6295b..18bd7763d2 100755 --- a/t/db_dependent/Reports/Guided.t +++ b/t/db_dependent/Reports/Guided.t @@ -501,7 +501,7 @@ subtest 'nb_rows() tests' => sub { subtest 'Returning passwords tests' => sub { - plan tests => 3; + plan tests => 4; my $dbh = C4::Context->dbh; $schema->storage->txn_begin; @@ -524,6 +524,12 @@ subtest 'Returning passwords tests' => sub { is( defined($errors), 1, 'Query returns password field' ); + $query = q{ SELECT password as secret FROM borrowers }; + + ( $sth, $errors ) = execute_query( { sql => $query } ); + + is( defined($errors), 1, 'Error raised for returning password' ); + $schema->storage->txn_rollback; }; -- 2.39.5