mirror of
https://github.com/isar/rusqlite.git
synced 2025-01-19 19:20:50 +08:00
Fix CSVTab::next method.
This commit is contained in:
parent
ed5637f513
commit
3fbeccdf55
@ -69,7 +69,7 @@ impl VTab<CSVTabCursor> for CSVTab {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let mut offset_first_row = 0;
|
let mut offset_first_row = 0;
|
||||||
if reader.has_headers {
|
if reader.has_headers {
|
||||||
let headers = try!(reader.headers());
|
let headers = try!(reader.headers());
|
||||||
offset_first_row = reader.byte_offset();
|
offset_first_row = reader.byte_offset();
|
||||||
// headers ignored if cols is not empty
|
// headers ignored if cols is not empty
|
||||||
@ -146,12 +146,19 @@ impl VTabCursor<CSVTab> for CSVTabCursor {
|
|||||||
self.next()
|
self.next()
|
||||||
}
|
}
|
||||||
fn next(&mut self) -> Result<()> {
|
fn next(&mut self) -> Result<()> {
|
||||||
let vtab = self.vtab();
|
{
|
||||||
if vtab.reader.done() {
|
let vtab = self.vtab();
|
||||||
return Err(Error::ModuleError(format!("eof")));
|
if vtab.reader.done() {
|
||||||
|
return Err(Error::ModuleError(format!("eof")));
|
||||||
|
}
|
||||||
|
|
||||||
|
vtab.cols.clear();
|
||||||
|
while let Some(col) = vtab.reader.next_str().into_iter_result() {
|
||||||
|
vtab.cols.push(String::from(try!(col)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
unimplemented!();
|
|
||||||
// self.row_number = self.row_number + 1;
|
self.row_number = self.row_number + 1;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
fn eof(&self) -> bool {
|
fn eof(&self) -> bool {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user