Opened 5 years ago

Closed 5 years ago

#2083 closed unknown (invalid)

sql query works with several users but fails with other

Reported by: pablobd Owned by:
Priority: minor Milestone: unassigned
Component: BW Admin Keywords: query sql error
Cc:

Description (last modified by pablobd)

I gave user safetyteam access to query # 35 this query is used by volunteers on the safety team, but the team wanted to use that account for the queries instead of personal accounts. the query works fine when used by other members or by bwadmin but it gives an error when used with user safetyteam

#0 debug( query problem with select count(*) as cnt from sqlforgroupsmembers where IdGroup? in () and IdQuery?=38 mysql_error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') and IdQuery?=38 /* /bw/admin/adminquery.php */' at line 1 ) called at var/rox/deployment/www.bewelcome.org-f69e97e/htdocs/bw/lib/bwdb.php:129 #1 sql_query(select count(*) as cnt from sqlforgroupsmembers where IdGroup? in () and IdQuery?=38) called at var/rox/deployment/www.bewelcome.org-f69e97e/htdocs/bw/lib/bwdb.php:141 #2 LoadRow?(select count(*) as cnt from sqlforgroupsmembers where IdGroup? in () and IdQuery?=38) called at var/rox/deployment/www.bewelcome.org-f69e97e/htdocs/bw/admin/adminquery.php:236 query problem with select count(*) as cnt from sqlforgroupsmembers where IdGroup? in () and IdQuery?=38 mysql_error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') and IdQuery?=38 /* /bw/admin/adminquery.php */' at line 1 query problem 192.168.42.4 September 6, 2013, 4:33 pm

the query reads: select m1.Username as UsernameFrom?,m2.Username as UsernameTo?,comments.updated,concat(concat(TextWhere?,' '),TextFree?) as comment,comments.Quality from comments,members as m1,members as m2 where m1.id=IdFromMember? and m2.id=IdToMember? and m1.Status='Active' and m2.Status='Active' order by comments.id desc limit 20

Change History (2)

comment:1 Changed 5 years ago by pablobd

  • Description modified (diff)

comment:2 Changed 5 years ago by pablobd

  • Priority changed from major to minor
  • Resolution set to invalid
  • Status changed from new to closed
  • Type changed from bug to unknown

It seems we have to be member of a group before this works. When adding the Safety Team profile to the Safety Team group, then the queries work.

Note: See TracTickets for help on using tickets.