From 0bab475c05ecaa39c27416e01d0d7445308b0e60 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Mon, 8 Dec 2008 17:39:30 +0100 Subject: [PATCH] Bug Fix : 2844 Some old mysql versions were not happy with the proposed SQL syntax. Now it is more Mysql version safe. Adding table names on JOIN Signed-off-by: Henri-Damien LAURENT --- C4/Auth.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 6058a6bc9c..4116292b06 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -1342,11 +1342,11 @@ sub get_user_subpermissions { my $userid = shift; my $dbh = C4::Context->dbh; - my $sth = $dbh->prepare("SELECT flag, code + my $sth = $dbh->prepare("SELECT flag, user_permissions.code as code FROM user_permissions JOIN permissions USING (module_bit, code) - JOIN userflags ON (module_bit = bit) - JOIN borrowers USING (borrowernumber) + JOIN userflags ON (permissions.module_bit = userflags.bit) + JOIN borrowers ON (user_permissions.borrowernumber=borrowers.borrowernumber) WHERE userid = ?"); $sth->execute($userid); -- 2.39.5