Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/1.0.4] Release branch #60

Merged
merged 3 commits into from Aug 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,9 @@
## 1.0.3 version

- Authentication improvements
- Fixed background crash
- Log file improvements

## 1.0.2 version

- add support for local users with @ inside their username
Expand Down
4 changes: 2 additions & 2 deletions ownCloudSDK/Vaults/Database/OCDatabase.m
Expand Up @@ -117,13 +117,13 @@ - (void)openWithCompletionHandler:(OCDatabaseCompletionHandler)completionHandler
if (error == nil)
{
[self.sqlDB applyTableSchemasWithCompletionHandler:^(OCSQLiteDB *db, NSError *error) {
[self.sqlDB executeQueryString:@"PRAGMA journal_mode"];

if (completionHandler!=nil)
{
completionHandler(self, error);
}

[self.sqlDB executeQueryString:@"PRAGMA journal_mode"];

openQueueCompletionHandler();
}];
}
Expand Down
26 changes: 19 additions & 7 deletions ownCloudSDK/Vaults/Database/SQLite/OCSQLiteDB.m
Expand Up @@ -253,11 +253,6 @@ - (void)openWithFlags:(OCSQLiteOpenFlags)flags completionHandler:(OCSQLiteDBComp
{
if ((error = [self _executeSimpleSQLQuery:[@"PRAGMA journal_mode=" stringByAppendingString:self->_journalMode]]) != nil)
{
if ((error.code == SQLITE_ROW) || (error.code != SQLITE_OK))
{
error = nil;
}

if (error != nil)
{
OCLogDebug(@"Attempt to switch journal_mode to %@ resulted in error=%@", self->_journalMode, error);
Expand Down Expand Up @@ -502,15 +497,28 @@ - (NSError *)_executeSimpleSQLQuery:(NSString *)sqlQuery
{
if (error == nil)
{
int sqErr;
int sqErr = SQLITE_ROW;

sqErr = sqlite3_step(statement.sqlStatement);
do {
sqErr = sqlite3_step(statement.sqlStatement);

#if OCSQLITE_RAWLOG_ENABLED
if (sqErr == SQLITE_ROW)
{
OCTLogDebug(@[@"SQLLog"], @"%@ (stepping)", sqlQuery);
}
#endif /* OCSQLITE_RAWLOG_ENABLED */
} while (sqErr == SQLITE_ROW);

if ((sqErr != SQLITE_OK) && (sqErr != SQLITE_DONE))
{
error = OCSQLiteLastDBError(_db);
}
}

#if OCSQLITE_RAWLOG_ENABLED
OCTLogDebug(@[@"SQLLog"], @"%@ (error=%@)", sqlQuery, error);
#endif /* OCSQLITE_RAWLOG_ENABLED */
}

return (error);
Expand Down Expand Up @@ -553,6 +561,10 @@ - (NSError *)_executeQuery:(OCSQLiteQuery *)query inTransaction:(OCSQLiteTransac
}
}

#if OCSQLITE_RAWLOG_ENABLED
OCTLogDebug(@[@"SQLLog"], @"%@ [%@] (error=%@)", query.sqlQuery, query.parameters, error);
#endif /* OCSQLITE_RAWLOG_ENABLED */

if (query.resultHandler != nil)
{
query.resultHandler(self, error, transaction, ((error==nil) ? (hasRows ? [[OCSQLiteResultSet alloc] initWithStatement:statement] : nil) : nil));
Expand Down