Commit ba8baae
authored
custom_type_parser: fix parsing frozen types (#1567)
Fixes: #1566
Frozen types were not handled correctly in the custom type parser. When
a type was wrapped in `FrozenType(...)`, the parser did not set the
`frozen` flag on the inner type. Even worse: `FrozenType` was not
recognized at all, leading to parse errors.
This commit introduces a `frozen_context` field in the parser state,
which tracks whether we are currently parsing a frozen type. When
`FrozenType(...)` is encountered, this field is set to true for the
duration of parsing the inner type, and then set back to false.
This commit also adds unit test cases for parsing frozen collections
inside vectors, as well as extends the integration tests for vectors
with a test case for vectors of frozen collections.
## Pre-review checklist
<!--
Make sure you took care of the issues on the list.
Put 'x' into those boxes which apply.
You can also create the PR now and click on all relevant checkboxes.
See CONTRIBUTING.md for more details.
-->
- [x] I have split my patch into logically separate commits.
- [x] All commit messages clearly explain what they change and why.
- [x] I added relevant tests for new features and bug fixes.
- [x] All commits compile, pass static checks and pass test.
- [x] PR description sums up the changes and reasons why they should be
introduced.
- ~~[ ] I have provided docstrings for the public items that I want to
introduce.~~
- ~~[ ] I have adjusted the documentation in `./docs/source/`.~~
- [x] I added appropriate `Fixes:` annotations to PR description.File tree
3 files changed
+103
-14
lines changed- scylla-cql/src
- deserialize
- frame/response
- scylla/tests/integration/types
3 files changed
+103
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
107 | 160 | | |
108 | 161 | | |
109 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
31 | 36 | | |
32 | 37 | | |
33 | 38 | | |
34 | 39 | | |
35 | 40 | | |
36 | 41 | | |
| 42 | + | |
37 | 43 | | |
38 | 44 | | |
39 | 45 | | |
| |||
241 | 247 | | |
242 | 248 | | |
243 | 249 | | |
| 250 | + | |
244 | 251 | | |
245 | 252 | | |
246 | 253 | | |
| |||
270 | 277 | | |
271 | 278 | | |
272 | 279 | | |
273 | | - | |
| 280 | + | |
274 | 281 | | |
275 | 282 | | |
276 | 283 | | |
277 | 284 | | |
278 | 285 | | |
279 | 286 | | |
280 | 287 | | |
281 | | - | |
| 288 | + | |
282 | 289 | | |
283 | 290 | | |
284 | 291 | | |
| |||
287 | 294 | | |
288 | 295 | | |
289 | 296 | | |
290 | | - | |
| 297 | + | |
291 | 298 | | |
292 | 299 | | |
293 | 300 | | |
| |||
313 | 320 | | |
314 | 321 | | |
315 | 322 | | |
316 | | - | |
| 323 | + | |
317 | 324 | | |
318 | 325 | | |
319 | 326 | | |
320 | 327 | | |
321 | 328 | | |
322 | 329 | | |
323 | 330 | | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
324 | 351 | | |
325 | 352 | | |
326 | 353 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
387 | 387 | | |
388 | 388 | | |
389 | 389 | | |
| 390 | + | |
390 | 391 | | |
391 | 392 | | |
392 | 393 | | |
393 | | - | |
| 394 | + | |
394 | 395 | | |
395 | 396 | | |
396 | 397 | | |
397 | 398 | | |
398 | 399 | | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
399 | 405 | | |
400 | 406 | | |
401 | | - | |
402 | | - | |
| 407 | + | |
| 408 | + | |
403 | 409 | | |
404 | 410 | | |
405 | 411 | | |
406 | 412 | | |
407 | 413 | | |
408 | 414 | | |
409 | | - | |
410 | | - | |
| 415 | + | |
| 416 | + | |
411 | 417 | | |
412 | 418 | | |
413 | 419 | | |
414 | 420 | | |
415 | 421 | | |
416 | | - | |
| 422 | + | |
417 | 423 | | |
418 | 424 | | |
419 | 425 | | |
420 | | - | |
| 426 | + | |
| 427 | + | |
421 | 428 | | |
422 | 429 | | |
423 | | - | |
| 430 | + | |
424 | 431 | | |
425 | 432 | | |
426 | 433 | | |
| |||
429 | 436 | | |
430 | 437 | | |
431 | 438 | | |
432 | | - | |
| 439 | + | |
| 440 | + | |
433 | 441 | | |
434 | 442 | | |
435 | 443 | | |
436 | 444 | | |
437 | 445 | | |
438 | 446 | | |
439 | 447 | | |
440 | | - | |
| 448 | + | |
| 449 | + | |
441 | 450 | | |
442 | 451 | | |
443 | 452 | | |
| |||
0 commit comments