Browse Source

Changed cache description string parsing

master
Michael Uleysky 4 months ago
parent
commit
6180648ac5
  1. 13
      include/cache.h

13
include/cache.h

@ -375,15 +375,11 @@ class PostgreSQLCache: public GenericCache
inline GenericCache* CreateCache(const MString& cachedesc)
{
auto i = cachedesc.GetPos(':');
if(i == 0)
{
if(cachedesc == "no") return new FakeCache;
return nullptr;
}
auto i = cachedesc.GetPos(':');
auto name = i == 0 ? cachedesc : cachedesc.SubStr(1, i - 1);
auto par = i == 0 ? "" : cachedesc.SubStr(i + 1, cachedesc.Len() - i);
auto name = cachedesc.SubStr(1, i - 1);
auto par = cachedesc.SubStr(i + 1, cachedesc.Len() - i);
if(name == "no") return new FakeCache;
if(name == "sqlite")
{
@ -392,6 +388,7 @@ inline GenericCache* CreateCache(const MString& cachedesc)
if(*ret) return ret;
delete ret;
}
if(name == "postgre" || name == "postgres" || name == "postgresql")
{
auto ret = new PostgreSQLCache;

Loading…
Cancel
Save