cursorMoveFlow covers MOVE n advancing the position without returning rows.
(t *testing.T, db *sql.DB)
| 130 | |
| 131 | // cursorMoveFlow covers MOVE n advancing the position without returning rows. |
| 132 | func cursorMoveFlow(t *testing.T, db *sql.DB) { |
| 133 | tx := beginCursorTx(t, db) |
| 134 | |
| 135 | mustExecTx(t, tx, "DECLARE cur_move CURSOR FOR SELECT id, name FROM users ORDER BY id") |
| 136 | |
| 137 | moved := fetchCursorRows(t, tx, "MOVE 4 FROM cur_move") |
| 138 | if len(moved) != 0 { |
| 139 | t.Errorf("MOVE 4 returned %d rows %v, want none", len(moved), moved) |
| 140 | } |
| 141 | assertCursorRows(t, "FETCH ALL after MOVE", fetchCursorRows(t, tx, "FETCH ALL FROM cur_move"), cursorUsers(5, 10)) |
| 142 | |
| 143 | mustExecTx(t, tx, "CLOSE cur_move") |
| 144 | } |
| 145 | |
| 146 | // cursorBackwardFlow covers the forward-only restriction: backward fetch |
| 147 | // fails with a clean error. NO SCROLL pins real PostgreSQL to the same |
no test coverage detected