Skip to content

Commit d48af91

Browse files
committed
Fix a off by one error in the mysql row implementation
1 parent 9d60ee0 commit d48af91

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

diesel/src/mysql/connection/stmt/iterator.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,7 @@ impl<'a> Row<Mysql> for MysqlRow<'a> {
7777
.stmt
7878
.metadata()
7979
.expect("Failed to get result metadata from the mysql backend");
80-
let field = if self.col_idx == 0 {
81-
metadata.fields()[0]
82-
} else {
83-
metadata.fields()[self.col_idx - 1]
84-
};
80+
let field = metadata.fields()[self.col_idx];
8581
unsafe {
8682
Some(CStr::from_ptr(field.name).to_str().expect(
8783
"Diesel assumes that your mysql database uses the \

0 commit comments

Comments
 (0)