Skip to content

Commit

Permalink
Iterator fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jas88 committed Aug 16, 2024
1 parent b174f06 commit d3ce436
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 2 additions & 3 deletions FAnsiSql/Implementations/PostgreSql/PostgreSqlTableHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ private static IEnumerable<string> ListPrimaryKeys(IManagedConnection con, Disco
AND indisprimary
""";

var toReturn = new List<string>();

using var cmd = table.GetCommand(query, con.Connection);
cmd.Transaction = con.Transaction;

Expand All @@ -100,7 +98,8 @@ AND indisprimary
cmd.Parameters.Add(p);

using var r = cmd.ExecuteReader();
yield return (string)r["attname"];
while(r.Read())
yield return (string)r["attname"];

r.Close();
}
Expand Down
1 change: 0 additions & 1 deletion Tests/FAnsiTests/CrossPlatformTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,6 @@ public void AddColumnTest(DatabaseType type,bool useTransaction)

Assert.Multiple(() =>
{

//table should exist
Assert.That(tbl.Exists());

Expand Down

0 comments on commit d3ce436

Please sign in to comment.