Problem/Motivation

When using the permissions_create_role() function (during installation of a custom module), I received the following error:

User warning: Incorrect integer value: '' for column 'rid' at row 1 query: INSERT INTO role VALUES('', 'setup user') in _db_query() (line 128 of C:\Program Files\Eclipse\drupal-workspace\fidi\drupal\includes\database.mysqli.inc).

Proposed resolution

Updating the code (around line 318 of the permissions_api.module file) from
db_query("INSERT INTO {role} VALUES('', '%s')", $role_name); to
db_query("INSERT INTO {role} (name) VALUES ('%s')", $role_name); resolved the issue.

I am using MySQL Server 5.5 on Windows XP, and presume that the empty string in VALUES('', '%s') is causing the problem.

Remaining tasks

I suggest the INSERT statement to be updated, as a similar syntax (db_query("INSERT INTO {role} (name) VALUES ('%s')", 'anonymous user');) is used in the system.install file.

Comments

ebeyrent’s picture

Assigned: Unassigned » ebeyrent
ebeyrent’s picture

Status: Active » Fixed

Thanks for reporting this, and for the solution. Greatly appreciated!

This should be fixed in the latest dev release. Please give it a try and let me know if this issue has been resolved.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.