Merge pull request #8215 from furo321/fix-timecp-mysql

Fix `/timecp` not working with MySQL
This commit is contained in:
Robert Müller 2024-04-14 20:23:18 +00:00 committed by GitHub
commit 47e4505193
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -220,11 +220,11 @@ bool CScoreWorker::LoadPlayerTimeCp(IDbConnection *pSqlServer, const ISqlData *p
str_format(aBuf, sizeof(aBuf),
"SELECT"
" Time, cp1, cp2, cp3, cp4, cp5, cp6, cp7, cp8, cp9, cp10, cp11, cp12, cp13, "
" cp14, cp15, cp16, cp17, cp18, cp19, cp20, cp21, cp22, cp23, cp24, cp25, "
" (cp1 + cp2 + cp3 + cp4 + cp5 + cp6 + cp7 + cp8 + cp9 + cp10 + cp11 + cp12 + cp13 + cp14 + "
" cp15 + cp16 + cp17 + cp18 + cp19 + cp20 + cp21 + cp22 + cp23 + cp24 + cp25 > 0) AS hasCP "
" cp14, cp15, cp16, cp17, cp18, cp19, cp20, cp21, cp22, cp23, cp24, cp25 "
"FROM %s_race "
"WHERE Map = ? AND Name = ? AND hasCP = true "
"WHERE Map = ? AND Name = ? AND "
" (cp1 + cp2 + cp3 + cp4 + cp5 + cp6 + cp7 + cp8 + cp9 + cp10 + cp11 + cp12 + cp13 + cp14 + "
" cp15 + cp16 + cp17 + cp18 + cp19 + cp20 + cp21 + cp22 + cp23 + cp24 + cp25) > 0 "
"ORDER BY Time ASC "
"LIMIT 1",
pSqlServer->GetPrefix());