File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -1126,7 +1126,6 @@ def test_fetchmany(self):
11261126 res = self .cu .fetchmany (100 )
11271127 self .assertEqual (res , [])
11281128
1129- @unittest .expectedFailure # TODO: RUSTPYTHON fetchmany size validation not implemented
11301129 def test_invalid_fetchmany (self ):
11311130 UINT32_MAX = (1 << 32 ) - 1
11321131 fetchmany = self .cu .fetchmany
Original file line number Diff line number Diff line change @@ -1883,9 +1883,16 @@ mod _sqlite3 {
18831883 args : FetchManyArgs ,
18841884 vm : & VirtualMachine ,
18851885 ) -> PyResult < Vec < PyObjectRef > > {
1886- let max_rows = args
1887- . size
1888- . unwrap_or_else ( || zelf. arraysize . load ( Ordering :: Relaxed ) ) ;
1886+ let max_rows = match args. size {
1887+ Some ( size) => {
1888+ if size < 0 {
1889+ return Err ( vm. new_value_error ( "fetchmany many not be negative" ) ) ;
1890+ }
1891+
1892+ size
1893+ }
1894+ None => zelf. arraysize . load ( Ordering :: Relaxed ) ,
1895+ } ;
18891896
18901897 let mut list = vec ! [ ] ;
18911898 while let PyIterReturn :: Return ( row) = Cursor :: next ( zelf, vm) ? {
You can’t perform that action at this time.
0 commit comments