• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

generic_queries.sql error?

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
version: 2.15(Head) from CVS on 9/26/2005
mysql: 3.23.58
resin: 2.1.14
file: /jforum/web-inf/config/database/generic/generic_queries.sql

After having done the manual install I ran into errors generated by an sql query whenever i wanted to load the forum's main page. I tried redoing the database a number of time and used both the normal and MySQL323 drivers and was not able to correct the problem.

Looking at the sql queries themselves I found the one causing the error and could not run it from the mysql command line. It is referencing a field "user_id" in a query that joins two tables. Neither table referenced contains the "user_id" field (which is in jforum_users) and it statically references the user 0. This made me believe it was not supposed to be left in the query and I took it out. If this was in error or I was doing something wrong I would appriciate any feedback.

/integrate/web-inf/config/database/generic/generic_queries.sql
Change
PermissionControl.loadGroupRoles = SELECT r.role_id, r.name, rv.role_value, rv.role_type AS rv_type, r.role_type \
FROM jforum_roles r \
LEFT JOIN jforum_role_values rv ON rv.role_id = r.role_id \
WHERE r.group_id = ? \
AND user_id = 0 \
ORDER BY r.role_id
To
-> PermissionControl.loadGroupRoles = SELECT r.role_id, r.name, rv.role_value, rv.role_type AS rv_type, r.role_type \
FROM jforum_roles r \
LEFT JOIN jforum_role_values rv ON rv.role_id = r.role_id \
WHERE r.group_id = ? \
ORDER BY r.role_id

Thomas
[originally posted on jforum.net by Anonymous]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As I see it should be in CVS since v 1.118
revision 1.118
date: 2005/09/26 19:13:13; author: vmal; state: Exp; lines: +0 -1
user_id removal from SQL
(Tthis is a part of user permission removal. User permissions are not necessary.
If you need some user to be a very very cpecial moderator - create a group and give these very very special permission to the group and put the user into it)

diff -u original/jforum/WEB-INF/config/database/generic/generic_queries.sql.~1.117~ original/jforum/WEB-INF/config/database/generic/generic_queries.sql.~1.118~
--- original/jforum/WEB-INF/config/database/generic/generic_queries.sql.~1.117~2005-09-26 10:59:53.000000000 -0400
+++ original/jforum/WEB-INF/config/database/generic/generic_queries.sql.~1.118~2005-10-01 10:32:55.000000000 -0400
@@ -410,7 +410,6 @@
FROM jforum_roles r \
LEFT JOIN jforum_role_values rv ON rv.role_id = r.role_id \
WHERE r.group_id = ? \
- AND user_id = 0 \
ORDER BY r.role_id

# #############

[originally posted on jforum.net by Anonymous]
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic