MySql Fehler bei Stored Procedure

ProLeg

Grünschnabel
Hallo zusammen,

ich habe folgen Fehler beim erstellen einer Funktion, hoff das ihr mir weiter helfen könnt.

FEHLER:
MySQL Fehlernummer 1418
This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled(you *might* want to use the less safe log_bin_trust_function_creators cariable)

SQL FUNCTION:
Code:
CREATE FUNCTION `cms_dobotech`.`addCategorie` (name VARCHAR(45), parent INT, sortno INT, keywords VARCHAR(225), description VARCHAR(250)) RETURNS INT
BEGIN
/*Define the varibales for the method*/
DECLARE levelno INT;
DECLARE urlname VARCHAR(90);
DECLARE id INT; 

/*Get the level of the new Categorie an set the parent on NULL if no parent needed*/
IF parent = 0 THEN
        SET parent = NULL, levelno = 0;
ELSE
        SELECT cate_level+1 FROM cms_categorie WHERE cate_id = parent INTO levelno;
END IF;

/*Check if a categorie with the same Level and Parent already exsist, an exit with a error code if it is true*/
SELECT cate_id FROM cms_categorie WHERE (cate_name LIKE name) && (cate_level = levelno) && (cate_parent = parent) LIMIT 1 INTO @checkname;
IF @checkname <> NULL THEN
       RETURN -404;
END IF;

/*Get the new sort number or make the given sortnumber free*/
IF sortno = 0 THEN
        SELECT MAX(cate_sortno) FROM cms_categorie WHERE (cate_level = levelno) && (cate_parent = parent) INTO sortno;
ELSE
        UPDATE cms_categorie SET cate_sortno = cate_sortno+1 WHERE (cate_sortno <= sortno) && (cate_level = levelno) && (cate_parent = parent);
END IF;

/*Parse the name to an url conform name for the links*/
SET urlname = LOWER(REPLACE(name,' ','_'));
SET urlname = REPLACE(urlname,'ü','ue');
SET urlname = REPLACE(urlname,'ä','ae');
SET urlname = REPLACE(urlname,'ö','oe');
SET urlname = REPLACE(urlname,'ß','ss');

/*Insert the new categorie with the generatet and given infos*/
INSERT INTO cms_categorie (cate_name, cate_urlname, cate_sortno, cate_level, cate_parent, cate_keywords, cate_description)
        VALUES (name,urlname,sortno,levelno,parent,keywords,description);

/*Get the id of the new categorie as result*/
SELECT LAST_INSERT_ID() INTO id;
RETURN id;

END

Mit freundlichen Grüßen
ProLeg
 
Ja hab ich mir schon durchgelesen aber wenn ich das richtig verstehe das bruach ich SUPER-Recht damit ich das machen kann aber ich weiß nicht wo ich das setzten kann.

MfG ProLeg
 
Ja hab ich mir schon durchgelesen aber wenn ich das richtig verstehe das bruach ich SUPER-Recht damit ich das machen kann aber ich weiß nicht wo ich das setzten kann.
Ich weiß ja nicht was du da gelesen hast bzw. warum, aber das wäre die relevante Stelle:
Damit eine CREATE FUNCTION-Anweisung akzeptiert wird, muss nach Voreinstellung DETERMINISTIC bzw. entweder NO SQL oder READS SQL DATA explizit angegeben werden. Andernfalls tritt ein Fehler auf:

ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL,
or READS SQL DATA in its declaration and binary logging is enabled
(you *might* want to use the less safe log_bin_trust_function_creators
variable)
Gruß
 
Zurück