It seems to work but I get a warning for every node (see attached .jpg):
user warning: FUNCTION poland24_usterki.grant_view does not exist query: SELECT t.* FROM term_node r INNER JOIN term_data t ON r.tid = t.tid INNER JOIN vocabulary v ON t.vid = v.vid WHERE (t.vid NOT IN('1','2') OR grant_view(t.tid, 3)) AND ( r.vid = 3 )ORDER BY v.weight, t.weight, t.name in

CommentFileSizeAuthor
#1 add_definer-723888-1.patch1.13 KBmparker17
drupal.jpg68.34 KBgkanski

Comments

mparker17’s picture

StatusFileSize
new1.13 KB

You get this SELECT error when the module tries to use a database function that doesn't exist. These database functions are supposed to be created when the module is installed, but if you're running MySQL 5.0.3 or later, they will fail in most circumstances.

--

The module tries to create four MySQL functions when it is installed: grant_view, grant_update, grant_delete and grant_admin. In order to do this, the database-user that Drupal is connecting with needs the CREATE ROUTINE privilege (which may not be available on certain shared hosting environments).

Additionally, if the database-user that Drupal is connecting with does not have the SUPER privilege (which will probably not be available on most shared hosting environments), these functions will still fail, because users without the SUPER privilege need to state DEFINER = CURRENT_USER when creating the function in MySQL 5.0.3 and later (i.e.: CREATE DEFINER = CURRENT_USER FUNCTION grant_admin (atid INT, auid INT) RETURNS ...).

I've attached a patch to add the DEFINER = CURRENT_USER clause to the CREATE FUNCTION queries. Hopefully this will allow the module to install properly on your site.

--

IMHO, considering that the Drupal database requirements state that users should only need the SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX and ALTER privileges (and some old modules may require CREATE TEMPORARY TABLES and LOCK TABLES), and considering that Drupal is supposed to work on both PostgreSQL and MySQL, it would be better to convert these functions into code, even if that makes things run a bit slower.

--

Update: since the Great Git Migration, creating and applying patches is a bit different. Check out the Git Patch Contributor Guide.

driki_’s picture

Hello,
We will be posting soon an update of this version that fixes this bug.
Thanks for your reply and patch.

superbaloo’s picture

Status: Active » Closed (fixed)

Fixed by 408e4d2
Thanks !

diaxpro’s picture

Hi, i have this problem, i need update module, not uninstall and install, how i can make this?

fab971’s picture

I add the same issue on my website.

1- i deactivated the module
2- Uninstalled it
3- i rebuilt the rights on nodes
4- Gave my mysql user 'grant' rights
5- Re-installed the module
6- Rebuilt the rights on nodes

That seems to work right now
Thank you very mutch for your help!

Mysql: 5.1.41
Ubuntu server 4.5
Php 5.3.2