Commits

Tuukka Norri  committed e26314f

Added a check for incompatibility in schema version

  • Participants
  • Parent commits 8779c90
  • Branches PGTS-NG

Comments (0)

Files changed (1)

File Sources/BXPGTransactionHandler.m

 	NSError* localError = nil;
 	BXPGDatabaseDescription* db = (id) [mConnection databaseDescription];
 	
-	if ([db checkBaseTenSchema: &localError] && [db checkSchemaVersions: &localError])
+	if (! [db checkBaseTenSchema: &localError])
+		goto error;
+	
+	if (! [db checkSchemaVersions: &localError])
+		goto error;
+	
+	if (! [mInterface checkSchemaCompatibility: &localError])
+		goto error;
+	
+	mConnectionSucceeded = YES;
+	if (mAsync)
 	{
-		mConnectionSucceeded = YES;
-		if (mAsync)
-		{
-			[mInterface connectionSucceeded];
-		}
-		BXLogDebug (@"mConnection: %p", mConnection);
+		[mInterface connectionSucceeded];
 	}
-	else
+	BXLogDebug (@"mConnection: %p", mConnection);
+	return;
+	
+error:
 	{
 		if (mAsync)
 			*mSyncErrorPtr = localError;