Hi!
I'm upgrading from v1.2.16 and I'm getting this error:
http://screencast.com/t/1KDNWDTSPa
Thanks,
Jackson
I'm upgrading from v1.2.16 and I'm getting this error:
http://screencast.com/t/1KDNWDTSPa
Thanks,
Jackson
mysql_upgrade -u root -p
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
This installation of MySQL is already upgraded to 5.6.16, use --force if you still need to run mysql_upgrade
You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
mysql_upgrade -u root -p
mysql_upgrade -u root -p
CREATE FUNCTION `es_isfriend` (p_source int, p_target int)
RETURNS INT DETERMINISTIC
BEGIN
DECLARE cnt INT;
select count(1) into cnt from `jos_social_friends` where ( `actor_id` = p_source and `target_id` = p_target) OR (`target_id` = p_source and `actor_id` = p_target) and `state` = 1;
RETURN cnt;
END
DELIMITER $$
CREATE FUNCTION `es_isfriend` (p_source int, p_target int)
RETURNS INT DETERMINISTIC
BEGIN
DECLARE cnt INT;
select count(1) into cnt from `jos_social_friends` where ( `actor_id` = p_source and `target_id` = p_target) OR (`target_id` = p_source and `actor_id` = p_target) and `state` = 1;
RETURN cnt;
END
$$
DELIMITER ;
CREATE FUNCTION `es_hasmutualfriend` (p_source int, p_target int)
RETURNS INT DETERMINISTIC
BEGIN
DECLARE cnt INT;
select count(1) into cnt from (
SELECT ( CASE f2.`actor_id` WHEN CASE f1.`actor_id` WHEN p_source THEN f1.`target_id` ELSE f1.`actor_id` END THEN f2.`target_id` ELSE f2.`actor_id` END ) as fid
FROM `jos_social_friends` f1
JOIN `jos_social_friends` f2
ON f2.`actor_id` = CASE f1.`actor_id` WHEN p_source THEN f1.`target_id` ELSE f1.`actor_id` END
OR f2.`target_id` = CASE f1.`actor_id` WHEN p_source THEN f1.target_id ELSE f1.`actor_id` END
WHERE (f1.`actor_id` = p_source OR f1.`target_id` = p_source)
AND f1.`state` = 1
AND f2.`state` = 1
AND NOT (f1.`actor_id`, f1.`target_id`) = (f2.`actor_id`, f2.`target_id`) ) as ff where ff.`fid` = p_target;
RETURN cnt;
END
DECLARE cnt INT;
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)
When you create a stored function, you must declare either that it is deterministic or that it does not modify data. Otherwise, it may be unsafe for data recovery or replication.
By default, for a CREATE FUNCTION statement to be accepted, at least one of DETERMINISTIC, NO SQL, or READS SQL DATA must be specified explicitly. Otherwise an error occurs:
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)
Ralf Riebe wrote:
i have the same Problem
DELIMITER $$
CREATE FUNCTION `es_isfriend_test` (p_source int, p_target int)
RETURNS INT
DETERMINISTIC
READS SQL DATA
BEGIN
DECLARE cnt INT;
select count(1) into cnt from `jos_social_friends` where ( `actor_id` = p_source and `target_id` = p_target) OR (`target_id` = p_source and `actor_id` = p_target) and `state` = 1;
RETURN cnt;
END $$
DELIMITER ;
so if you point me to which file to modify and add this new modification you created I will gladly test it
The error that the other server returned was:
551 Message contains ZIP file that is too deep (4) (Mode: normal)
Андрей Чесноков wrote:
Our provider does not support stored procedures. What to do?
Андрей Чесноков wrote:
Where can i get 1.2.16
#1419 - You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
Sam wrote:
Hi Alfonso,
I am sorry for the delay of this reply and thanks for the access info to your site
I've tried running the create function sql with your phpMyAdmin but it seems like your phpMyAdmin doesn't support the DELIMITER commandPlease see below link for more information about this DELIMITER command.
http://stackoverflow.com/questions/9017269/mysql-delimiter-syntax-error
Anyway, can you check with your web-hosting provider and see if your db user has granted the SUPER privilege? If not, your db user will need to grant with SUPER privilege in order to execute the create function or drop function statement.
Also, is there a way for me to connect directly to your MySQL database using other MySQL client since your phpMyAdmin is not supporting the DELIMITER command. Im using Sequel Pro program so if I can remotely access to your MySQL db, I might be able to create the stored function for you
Please advise.
LAC Infosys wrote:
Hi Sam,
Thanks for the docs, MySQL documentation can be vagueit just explains briefly what it does and give you choices but never explains best practices.
Looks like I made a mistakewhen I run your script in CLI I didn't realize I was using root so definitely MySQL allowed me to run it without errors.
So I turned ON log_bin_trust_function_creators variable, based on this:
http://serverfault.com/questions/55752/mysql-super-privilege-vs-log-bin-trust-function-creators
it is safer than SUPER PRIVILEGES in a shared hosting server, Amazon RDS allows that variable, so I guess it is safer
http://stackoverflow.com/questions/8919907/can-i-create-trigger-in-an-rds-db
Please try again.
Thanks,
Jackson
im in contact with my web hosting trying to find a solution for the db.
I noticed that you installed v 1.2.18 on the website, (which is down at the moment..) do you think i will be able to update versions from now on ? or you managed to install it "manually" and i still will need to fix my DB ?
Would it be possible to download 1.2.16 full package from some where so to restore the site in the meantime?
Thanks again for the help .
Anyway, for your information, we've decided to remove the MySQL stored function usage from EasySocial and we are now in the stage of fine tuning the SQL performance. These changes will most likely added into 1.2.19 so maybe you should wait for this version instead