Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion YapDatabase.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "YapDatabase"
s.version = "2.9.3"
s.version = "2.9.4"
s.summary = "A key/value store built atop sqlite for iOS & Mac."
s.homepage = "https://github.com/yapstudios/YapDatabase"
s.license = 'MIT'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,7 @@ - (NSMutableArray *)findChangesMatchingName:(NSString *)name
{
if ((edge->state & YDB_EdgeState_HasSourceRowid) && srcRowid)
{
if (edge->sourceRowid != srcRowid.unsignedLongLongValue)
if (edge->sourceRowid != srcRowid.longLongValue)
{
continue;
}
Expand Down Expand Up @@ -1228,7 +1228,7 @@ - (NSMutableArray *)findChangesMatchingName:(NSString *)name
// Shortcut:
// We already know the sourceRowid. It was given to us as a parameter.

edge->sourceRowid = srcRowid.unsignedLongLongValue;
edge->sourceRowid = srcRowid.longLongValue;
edge->flags |= YDB_EdgeState_HasSourceRowid;
}
else
Expand Down Expand Up @@ -1286,7 +1286,7 @@ - (NSMutableArray *)findChangesMatchingName:(NSString *)name
}
else if ((edge->state & YDB_EdgeState_HasDestinationRowid) && dstRowid)
{
if (edge->destinationRowid != dstRowid.unsignedLongLongValue)
if (edge->destinationRowid != dstRowid.longLongValue)
{
continue;
}
Expand Down Expand Up @@ -1319,7 +1319,7 @@ - (NSMutableArray *)findChangesMatchingName:(NSString *)name
}
else if ((edge->state & YDB_EdgeState_HasDestinationRowid) && dstRowid)
{
if (edge->destinationRowid != dstRowid.unsignedLongLongValue)
if (edge->destinationRowid != dstRowid.longLongValue)
{
continue;
}
Expand Down Expand Up @@ -1376,7 +1376,7 @@ - (NSMutableArray *)findChangesMatchingName:(NSString *)name
// Shortcut:
// We already know the sourceRowid. It was given to us as a parameter.

edge->destinationRowid = dstRowid.unsignedLongLongValue;
edge->destinationRowid = dstRowid.longLongValue;
edge->state |= YDB_EdgeState_HasDestinationRowid;
}
else
Expand Down Expand Up @@ -1534,7 +1534,7 @@ - (NSMutableArray *)findChangesMatchingName:(NSString *)name
}
else if ((edge->state & YDB_EdgeState_HasDestinationRowid) && dstRowid)
{
if (edge->destinationRowid != dstRowid.unsignedLongLongValue)
if (edge->destinationRowid != dstRowid.longLongValue)
{
continue;
}
Expand Down Expand Up @@ -1562,7 +1562,7 @@ - (NSMutableArray *)findChangesMatchingName:(NSString *)name
{
if ((edge->state & YDB_EdgeState_HasSourceRowid) && srcRowid)
{
if (edge->sourceRowid != srcRowid.unsignedLongLongValue)
if (edge->sourceRowid != srcRowid.longLongValue)
{
continue;
}
Expand All @@ -1582,7 +1582,7 @@ - (NSMutableArray *)findChangesMatchingName:(NSString *)name
}
else if ((edge->state & YDB_EdgeState_HasDestinationRowid) && dstRowid)
{
if (edge->destinationRowid != dstRowid.unsignedLongLongValue)
if (edge->destinationRowid != dstRowid.longLongValue)
{
continue;
}
Expand Down Expand Up @@ -1634,7 +1634,7 @@ - (NSMutableArray *)findChangesMatchingName:(NSString *)name
// Shortcut:
// We already know the sourceRowid. It was given to us as a parameter.

edge->sourceRowid = srcRowid.unsignedLongLongValue;
edge->sourceRowid = srcRowid.longLongValue;
edge->state |= YDB_EdgeState_HasSourceRowid;
}
else
Expand All @@ -1650,7 +1650,7 @@ - (NSMutableArray *)findChangesMatchingName:(NSString *)name
// Shortcut:
// We already know the destinationRowid. It was given to us as a parameter.

edge->destinationRowid = dstRowid.unsignedLongLongValue;
edge->destinationRowid = dstRowid.longLongValue;
edge->state |= YDB_EdgeState_HasDestinationRowid;
}
else
Expand Down Expand Up @@ -1722,7 +1722,7 @@ - (NSMutableArray *)findChangesMatchingName:(NSString *)name
{
if ((edge->state & YDB_EdgeState_HasSourceRowid) && srcRowid)
{
if (edge->sourceRowid != srcRowid.unsignedLongLongValue)
if (edge->sourceRowid != srcRowid.longLongValue)
{
continue;
}
Expand Down Expand Up @@ -1779,7 +1779,7 @@ - (NSMutableArray *)findChangesMatchingName:(NSString *)name
// Shortcut:
// We already know the sourceRowid. It was given to us as a parameter.

edge->sourceRowid = srcRowid.unsignedLongLongValue;
edge->sourceRowid = srcRowid.longLongValue;
edge->state |= YDB_EdgeState_HasSourceRowid;
}
else
Expand Down Expand Up @@ -2091,10 +2091,10 @@ - (int64_t)edgeCountWithDestinationFileURL:(NSURL *)dstFileURL
// AKA: typeof(dst) IS BLOB

int const column_idx_rowid = SQLITE_COLUMN_START + 0;
int const column_idx_src = SQLITE_COLUMN_START + 2;
int const column_idx_dst = SQLITE_COLUMN_START + 3;
int const column_idx_rules = SQLITE_COLUMN_START + 4;
int const column_idx_manual = SQLITE_COLUMN_START + 5;
int const column_idx_src = SQLITE_COLUMN_START + 1;
int const column_idx_dst = SQLITE_COLUMN_START + 2;
int const column_idx_rules = SQLITE_COLUMN_START + 3;
int const column_idx_manual = SQLITE_COLUMN_START + 4;

int const bind_idx_src = SQLITE_BIND_START + 0;
int const bind_idx_name = SQLITE_BIND_START + 1;
Expand Down Expand Up @@ -2204,7 +2204,7 @@ - (YapDatabaseRelationshipEdge *)findExistingManualEdgeMatching:(YapDatabaseRela
sqlite3_stmt *statement = [parentConnection findManualEdgeWithDstFileURLStatement];
if (statement == NULL) return nil;

// SELECT "rowid", "rules" FROM "tableName"
// SELECT "rowid", "dst", "rules" FROM "tableName"
// WHERE "src" = ? AND "name" = ? AND "dst" > INT64_MAX AND "manual" = 1;
//
// AKA: typeof(dst) IS BLOB
Expand Down Expand Up @@ -2625,17 +2625,29 @@ - (void)preprocessManualEdges:(NSMutableArray *)manualEdges
edge->action = YDB_EdgeAction_Delete;
edge->flags |= YDB_EdgeFlags_SourceDeleted;
edge->flags |= YDB_EdgeFlags_BadSource;
if (!(edge->state & YDB_EdgeState_HasEdgeRowid))
{
edge->flags |= YDB_EdgeFlags_EdgeNotInDatabase;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throughout this file, it looks like the additions are indented with spaces, but the existing code uses tabs.

}
else if (srcDeleted)
{
edge->action = YDB_EdgeAction_Delete;
edge->flags |= YDB_EdgeFlags_SourceDeleted;
if (!(edge->state & YDB_EdgeState_HasEdgeRowid))
{
edge->flags |= YDB_EdgeFlags_EdgeNotInDatabase;
}
}
}
else if ([parentConnection->deletedInfo ydb_containsKey:@(edge->sourceRowid)])
{
edge->action = YDB_EdgeAction_Delete;
edge->flags |= YDB_EdgeFlags_SourceDeleted;
if (!(edge->state & YDB_EdgeState_HasEdgeRowid))
{
edge->flags |= YDB_EdgeFlags_EdgeNotInDatabase;
}
}


Expand All @@ -2659,17 +2671,29 @@ - (void)preprocessManualEdges:(NSMutableArray *)manualEdges
edge->action = YDB_EdgeAction_Delete;
edge->flags |= YDB_EdgeFlags_DestinationDeleted;
edge->flags |= YDB_EdgeFlags_BadDestination;
if (!(edge->state & YDB_EdgeState_HasEdgeRowid))
{
edge->flags |= YDB_EdgeFlags_EdgeNotInDatabase;
}
}
else if (dstDeleted)
{
edge->action = YDB_EdgeAction_Delete;
edge->flags |= YDB_EdgeFlags_DestinationDeleted;
if (!(edge->state & YDB_EdgeState_HasEdgeRowid))
{
edge->flags |= YDB_EdgeFlags_EdgeNotInDatabase;
}
}
}
else if ([parentConnection->deletedInfo ydb_containsKey:@(edge->destinationRowid)])
{
edge->action = YDB_EdgeAction_Delete;
edge->flags |= YDB_EdgeFlags_DestinationDeleted;
if (!(edge->state & YDB_EdgeState_HasEdgeRowid))
{
edge->flags |= YDB_EdgeFlags_EdgeNotInDatabase;
}
}
}
}
Expand Down Expand Up @@ -5491,6 +5515,7 @@ - (void)_enumerateEdgesWithName:(NSString *)name

int64_t edgeRowid = sqlite3_column_int64(statement, column_idx_rowid);

edge = [parentConnection->edgeCache objectForKey:@(edgeRowid)];
if (edge)
{
edge->sourceRowid = srcRowid;
Expand Down Expand Up @@ -6795,6 +6820,10 @@ - (void)removeEdge:(YapDatabaseRelationshipEdge *)edge withProcessing:(YDB_Notif
edge->edgeRowid = pendingEdge->edgeRowid;
edge->state |= YDB_EdgeState_HasEdgeRowid;
}
else
{
edge->flags |= YDB_EdgeFlags_EdgeNotInDatabase;
}

[edges replaceObjectAtIndex:i withObject:edge];
return;
Expand Down