Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#1622 closed task (fixed)

Stored procedures in database

Reported by: mahouni Owned by: planetcruiser
Priority: minor Milestone: 0.5.9 - bugfixing
Component: BW Database Keywords: installation, database, stored function, stored procedure, IdTrad
Cc: planetcruiser, jeanyves, mahouni

Description

The reference database for local installations of BWRox is missing some stored functions/procedures. E.g. it is not possible to create new posts or reply to a forum post without the db function Next_Forum_trads_IdTrad().

Jean Yves has written to the bw-dev mailinglist how to create this stored function. I copy&paste his message here:

Hello, I just checked this stored function is really needed for the forum to work. Here is the code to run on mysql to create it:

CREATE FUNCTION `Next_Forum_trads_IdTrad`() RETURNS int(11)
    DETERMINISTIC
BEGIN
     DECLARE res INT;
select max(IdTrad)+1 from translations into res ;
               RETURN res;
    END

It should be added on the reference test database Greetings Jean Yves

Change History (3)

comment:1 Changed 7 years ago by mahouni

  • Owner changed from mahouni to planetcruiser
  • Status changed from new to assigned

comment:2 Changed 7 years ago by planetcruiser

  • Milestone changed from unassigned to 0.5.9 - bugfixing
  • Resolution set to fixed
  • Status changed from assigned to closed

added the following to the dump:

DELIMITER //
DROP FUNCTION IF EXISTS Next_Forum_trads_IdTrad//
CREATE FUNCTION Next_Forum_trads_IdTrad () RETURNS INT(11)
  DETERMINISTIC
BEGIN
    DECLARE res INT;
    SELECT MAX(IdTrad)+1 FROM translations INTO res;
    RETURN res;
  END//
DELIMITER ;

this is also what you need to run in order to make forum posting work in your local installation. make sure your bewelcome mysql user has *execute* privileges.

latest version of dump can be found in http://downloads.bewelcome.org/for_developers/rox_test_db/

comment:3 Changed 7 years ago by crumbking

seems to work. I just was running it on my local maschine.

Note: See TracTickets for help on using tickets.