Merge pull request #1222 from Awesomerly/thegame
Some checks failed
Compile / Build SM ${{ matrix.sm-version }} (1.11) (push) Has been cancelled
Compile / Build SM ${{ matrix.sm-version }} (1.12) (push) Has been cancelled
Compile / Release (push) Has been cancelled

Fix database verison parsing
This commit is contained in:
rtldg 2025-01-10 19:35:33 +00:00 committed by GitHub
commit ab75ef4c43
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1304,25 +1304,32 @@ public void SQL_UpdateTop100_Callback(Database db, DBResultSet results, const ch
bool DoWeHaveWindowFunctions(const char[] sVersion)
{
float fVersion = StringToFloat(sVersion);
char buf[100][2];
ExplodeString(sVersion, ".", buf, 2, 100);
int iMajor = StringToInt(buf[0]);
int iMinor = StringToInt(buf[1]);
if (gI_Driver == Driver_sqlite)
{
return fVersion >= 3.25; // 2018~
// 2018~
return iMajor > 3 || (iMajor == 3 && iMinor >= 25); // 2018~
}
else if (gI_Driver == Driver_pgsql)
{
return fVersion >= 8.4; // 2009~
// 2009~
return iMajor > 8 || (iMajor == 8 && iMinor >= 4);
}
else if (gI_Driver == Driver_mysql)
{
if (StrContains(sVersion, "MariaDB") != -1)
{
return fVersion >= 10.2; // 2016~
// 2016~
return iMajor > 10 || (iMajor == 10 && iMinor >= 2);
}
else // mysql then...
{
return fVersion >= 8.0; // 2018~
// 2018~
return iMajor > 8 || (iMajor == 8 && iMinor >= 0);
}
}