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
Comment #1
ebeyrent CreditAttribution: ebeyrent commentedComment #2
ebeyrent CreditAttribution: ebeyrent commentedThanks 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.