Commit 770041c
fix: drop unreachable drain loop from query_sql
The C dqlite server rejects multi-statement SELECT with a FailureResponse
(SQLITE_ERROR, "nonempty statement tail") rather than emitting additional
RowsResponse frames: handle_query_work_cb checks is_statement_empty on
the tail and, if non-empty, routes to handle_query_sql_done_cb which
emits a failure. The "drain extra result sets" loop added by #054 was
therefore unreachable dead code built on a misreading of the server.
Remove the loop. Update the docstring to note the real behaviour.
Replace the test that simulated the dead-code path with one asserting
the client leaves stray bytes in the buffer instead of silently
consuming them.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 56a2a2e commit 770041c
2 files changed
Lines changed: 16 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
174 | 176 | | |
175 | 177 | | |
176 | 178 | | |
| |||
184 | 186 | | |
185 | 187 | | |
186 | 188 | | |
187 | | - | |
188 | 189 | | |
189 | 190 | | |
190 | 191 | | |
| |||
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | 201 | | |
207 | 202 | | |
208 | 203 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
165 | 171 | | |
166 | 172 | | |
167 | 173 | | |
168 | | - | |
169 | 174 | | |
170 | 175 | | |
171 | 176 | | |
172 | 177 | | |
173 | 178 | | |
174 | 179 | | |
175 | | - | |
| 180 | + | |
176 | 181 | | |
177 | 182 | | |
178 | 183 | | |
179 | 184 | | |
180 | 185 | | |
181 | | - | |
| 186 | + | |
182 | 187 | | |
183 | | - | |
| 188 | + | |
184 | 189 | | |
185 | | - | |
186 | 190 | | |
187 | 191 | | |
188 | | - | |
189 | | - | |
190 | | - | |
| 192 | + | |
| 193 | + | |
191 | 194 | | |
192 | 195 | | |
193 | 196 | | |
| |||
0 commit comments