mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-02-17 07:33:57 +00:00
fix(core): avoid SQL aggregate function when testing table existence
This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
didOpen = YES;
|
||||
}
|
||||
|
||||
sql = [NSString stringWithFormat: @"SELECT COUNT(*) FROM %@ WHERE 1 = 2",
|
||||
sql = [NSString stringWithFormat: @"SELECT 1 FROM %@ WHERE 1 = 2",
|
||||
tableName];
|
||||
ex = [self evaluateExpressionX: sql];
|
||||
[self cancelFetch];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* GCSAlarmsFolder.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2010-2016 Inverse inc.
|
||||
* Copyright (C) 2010-2022 Inverse inc.
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -182,7 +182,7 @@ static NSString *alarmsFolderURLString = nil;
|
||||
|
||||
queries = [tc specialQueries];
|
||||
|
||||
sql = [NSString stringWithFormat: @"SELECT count(*) FROM %@",
|
||||
sql = [NSString stringWithFormat: @"SELECT 1 FROM %@ WHERE 1 = 2",
|
||||
[self _storeTableName]];
|
||||
if ([tc evaluateExpressionX: sql])
|
||||
{
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/* GCSSessionsFolder.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2010-2011 Inverse inc.
|
||||
*
|
||||
* Author: Ludovic Marcotte <lmarcotte@inverse.ca>
|
||||
* Copyright (C) 2010-2022 Inverse inc.
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -181,7 +179,7 @@ static NSString *sessionsFolderURLString = nil;
|
||||
|
||||
queries = [tc specialQueries];
|
||||
|
||||
sql = [NSString stringWithFormat: @"SELECT count(*) FROM %@", tableName];
|
||||
sql = [NSString stringWithFormat: @"SELECT 1 FROM %@ WHERE 1 = 2", tableName];
|
||||
if ([tc evaluateExpressionX: sql])
|
||||
{
|
||||
sql = [queries createSessionsFolderWithName: tableName];
|
||||
|
||||
Reference in New Issue
Block a user