I have this table (generated by MySql workbench):
CREATE TABLE `system_users` (
`UserNum` int NOT NULL AUTO_INCREMENT,
`UserName` varchar(45) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`UserFullName` varchar(45) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`SaveDoc` char(1) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT 'N',
`MailOnExpire` char(1) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT 'N',
`ExpirationValue` int DEFAULT NULL,
PRIMARY KEY (`UserName`),
UNIQUE KEY `UserNum_UNIQUE` (`UserNum`),
UNIQUE KEY `UserName_UNIQUE` (`UserName`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
I also have this stored procedure with an update query:
CREATE DEFINER=`root`@`localhost` PROCEDURE `Set_Preferences`(
IN xUsername varchar(45),
IN xSaveDoc char(1),
IN xMailOnExpire char(1),
IN xExpirationValue int,
)
BEGIN
UPDATE system_users
SET SaveDoc = xSaveDoc,
MailOnExpire = xMailOnExpire,
ExpirationValue = xExpirationValue
WHERE Username = xUsername;
END
I made sure that Username is indeed the PK, then I restarted the workbench in case it's just a temporary error. No luck so far.
In addition, I prefer not to disable safe mode only to get rid of the error, but to find and solve the actual cause.
Thanks