Fix new-account creation failing under MariaDB strict mode
accounts.lastlogin/logtime had no defaults and were NOT NULL, but the auto-create-account INSERT never set them, so new accounts failed under MariaDB strict mode (silently accepted under the old MySQL 5.0 target). Insert explicit empty/zero values and give lastlogin a default; also widen it to varchar(32) to match the runtime.sql fix already applied to the starttime column. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5f600d0e61
commit
582e29106b
3 files changed
+3
-3
No files matched your search
@@ -131,7 +131,7 @@ bool CLoginServer::pakUserLogin( CLoginClient* thisclient, CPacket* P )
|
||||
DB->QFree( );
|
||||
if(Config.CreateLoginAccount)
|
||||
{
|
||||
if(!DB->QExecute("INSERT into accounts (username,password,accesslevel) values ('%s','%s',100)",thisclient->username.c_str(),thisclient->password.c_str()))
|
||||
if(!DB->QExecute("INSERT into accounts (username,password,accesslevel,lastlogin,logtime) values ('%s','%s',100,'',0)",thisclient->username.c_str(),thisclient->password.c_str()))
|
||||
return true;
|
||||
Log( MSG_INFO, "New Account created '%s'", thisclient->username.c_str() );
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ CREATE TABLE IF NOT EXISTS `accounts` (
|
||||
`isSiteLogged` tinyint(1) default '0',
|
||||
`ktpoints` int(11) NOT NULL default '0',
|
||||
`newpoints` int(11) NOT NULL default '0',
|
||||
`lastlogin` varchar(20) NOT NULL,
|
||||
`lastlogin` varchar(32) NOT NULL default '',
|
||||
`logtime` int(11) NOT NULL,
|
||||
`totlogtime` int(11) NOT NULL default '0',
|
||||
PRIMARY KEY (`id`)
|
||||
|
||||
@@ -41,7 +41,7 @@ CREATE TABLE IF NOT EXISTS `accounts` (
|
||||
`isSiteLogged` tinyint(1) default '0',
|
||||
`ktpoints` int(11) NOT NULL default '0',
|
||||
`newpoints` int(11) NOT NULL default '0',
|
||||
`lastlogin` varchar(20) NOT NULL,
|
||||
`lastlogin` varchar(32) NOT NULL default '',
|
||||
`logtime` int(11) NOT NULL,
|
||||
`totlogtime` int(11) NOT NULL default '0',
|
||||
PRIMARY KEY (`id`)
|
||||
|
||||
Reference in new issue
Block a user