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:
ThomasandClaude Sonnet 5 committed 2026-07-09 06:35:31 +02:00
1 parent 5f600d0e61
commit 582e29106b
3 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -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() );
}