Skip to content

Commit

Permalink
fixed issue with affectedRow during build
Browse files Browse the repository at this point in the history
  • Loading branch information
Prince Ugwuh committed Feb 24, 2016
1 parent 7d3ff07 commit 6d22037
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Sources/MySQL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,14 @@ class MSQLResult {
}

public func affectedRow() -> [[String: String]]? {
let data = [[String: String]]()
while var rowP = mysql_fetch_row(result) {
let data = [[String: String]]()
var rowP: COpaquePointer?
repeat {
rowP = mysql_fetch_row(result)
for columnField in columns {
data[columnField.name] = rowP[columnField.index]
data[columnField.name] = rowP![columnField.index]
}
}
} while rowP != nil
defer { mysql_free_result(result) }
return data
}
Expand Down

0 comments on commit 6d22037

Please sign in to comment.