Jump to content


Photo

Redbean error while running unit tests

redbean unit-test

  • Please log in to reply
3 replies to this topic

#1 nbezzala

nbezzala

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 07 January 2012 - 04:51 AM

C:\wamp\www\Zurmo\app\protected\tests\unit>phpunit --verbose TestSuite.php All
Testing with database: 'mysql:host=localhost;dbname=zurmo', username: 'zurmo'.
Auto building database schema...
Failed to create:
create function get_permitable_explicit_actual_right(
permitable_id int(11),
module_name varchar(255),
right_name varchar(255)
)
returns tinyint
begin
declare result tinyint;
declare exit handler for 1054, 1146 # Column, table doesn't exist.
begin # RedBean hasn't created it yet.
return 0;
end;

select max(type)
into result
from _right
where _right.modulename = module_name and
name = right_name and
_right.permitable_id = permitable_id;
if result is null then
return 0;
end if;
return result;
end;
PHP Fatal error: Uncaught [HY000] - SQLSTATE[HY000]: General error: 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_functio
n_creators variable)
thrown in C:\wamp\www\Zurmo\redbean\rb.php on line 902

Fatal error: Uncaught [HY000] - SQLSTATE[HY000]: General error: 1418 This function has none of DETERMINISTIC, NO SQL, or READ
S SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_cre
ators variable)
thrown in C:\wamp\www\Zurmo\redbean\rb.php on line 902


C:\wamp\www\Zurmo\app\protected\tests\unit>


Is there something I haven't setup correctly?

#2 Jason

Jason

    Administrator

  • Administrators
  • 717 posts
  • LocationChicago

Posted 07 January 2012 - 01:18 PM

Rakesh,
Sorry for the delay, i just saw this response now.

Change in mysql the log_bin_trust_function_creators to 1 from 0.

I found this out looking here:
http://dev.mysql.com...ms-logging.html

I will need to add a task to go through and declare the stored procedures correctly so that you don't need to change this setting in the future. Please let me know if changing the above mysql setting solves the problem.

Jason Green
Zurmo Team
Need support? Upgrade now


#3 nbezzala

nbezzala

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 07 January 2012 - 06:16 PM

Thanks Jason. But no, it didn't work. I'm still getting the same error.

I ran this query in phpmyadmin, after selecting the zurmo database.

SET GLOBAL log_bin_trust_function_creators = 0;
commit;

Restarted mysql, and then ran the tests.

#4 Jason

Jason

    Administrator

  • Administrators
  • 717 posts
  • LocationChicago

Posted 08 January 2012 - 02:21 PM

Try
SET GLOBAL log_bin_trust_function_creators = 1;
commit;

Jason Green
Zurmo Team
Need support? Upgrade now






Also tagged with one or more of these keywords: redbean, unit-test

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users