Fix CSVTab::next method.

This commit is contained in:
gwenn 2016-02-10 20:48:30 +01:00
parent ed5637f513
commit 3fbeccdf55

View File

@ -146,12 +146,19 @@ impl VTabCursor<CSVTab> for CSVTabCursor {
self.next()
}
fn next(&mut self) -> Result<()> {
{
let vtab = self.vtab();
if vtab.reader.done() {
return Err(Error::ModuleError(format!("eof")));
}
unimplemented!();
// self.row_number = self.row_number + 1;
vtab.cols.clear();
while let Some(col) = vtab.reader.next_str().into_iter_result() {
vtab.cols.push(String::from(try!(col)));
}
}
self.row_number = self.row_number + 1;
Ok(())
}
fn eof(&self) -> bool {