Commit 1db7fe0
committed
[155] encodedsession: Support ResultSet with a huge header
The ResultSet consists of a header (labels for each returned column)
plus some number of rows. The maximum size of a single "fetch"
operation is 100,000 bytes. If the header happens to exceed that size
then the fetch operation will always raise an EndOfStream exception.
The protocol for result sets is a little fragile: we send back a row of
data followed by an optional integer. If the integer is 1 then there is
another row to be read in this same fetch result message. If the
integer is 0 then there are no more rows to fetch (the ResultSet is
complete). If the integer is missing completely then there are more
rows to fetch by sending another request to the server.
In the driver we were always assuming there would be the headers plus at
least one row before we ran out of room in the message, but if the
header was large enough (> 100,000 bytes for labels) that might not be
true.
Add a new encodedsession._hasBytes() method that allows us to check
whether there is data left in the message. Use this to rewrite the
fetch_result_set() and fetch_result_set_next() methods to simplify the
logic and avoid the error above.1 parent 6b7b59e commit 1db7fe0
1 file changed
Lines changed: 27 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
438 | 438 | | |
439 | 439 | | |
440 | 440 | | |
441 | | - | |
442 | | - | |
| 441 | + | |
| 442 | + | |
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
446 | 446 | | |
447 | | - | |
448 | 447 | | |
449 | | - | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
450 | 456 | | |
451 | | - | |
| 457 | + | |
452 | 458 | | |
453 | 459 | | |
454 | 460 | | |
455 | 461 | | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | 462 | | |
466 | 463 | | |
467 | 464 | | |
| |||
471 | 468 | | |
472 | 469 | | |
473 | 470 | | |
474 | | - | |
475 | | - | |
476 | 471 | | |
477 | 472 | | |
478 | | - | |
479 | | - | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
480 | 478 | | |
481 | | - | |
| 479 | + | |
482 | 480 | | |
483 | 481 | | |
484 | 482 | | |
485 | 483 | | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | 484 | | |
495 | 485 | | |
496 | 486 | | |
| |||
1102 | 1092 | | |
1103 | 1093 | | |
1104 | 1094 | | |
1105 | | - | |
1106 | 1095 | | |
1107 | 1096 | | |
1108 | 1097 | | |
| |||
1131 | 1120 | | |
1132 | 1121 | | |
1133 | 1122 | | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
1134 | 1126 | | |
1135 | 1127 | | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
1136 | 1131 | | |
1137 | 1132 | | |
1138 | 1133 | | |
1139 | 1134 | | |
1140 | | - | |
| 1135 | + | |
1141 | 1136 | | |
1142 | 1137 | | |
1143 | 1138 | | |
| |||
1151 | 1146 | | |
1152 | 1147 | | |
1153 | 1148 | | |
1154 | | - | |
1155 | | - | |
| 1149 | + | |
| 1150 | + | |
1156 | 1151 | | |
1157 | 1152 | | |
1158 | 1153 | | |
| |||
0 commit comments