Commit f4a9753
committed
fix(executor): fall back to full scan when sparse range scan finds no results
Collections without a secondary index on the queried field return empty
from the sparse range scan. Previously the handler returned that empty
result to the client. Now it falls back to a full collection scan,
applies the same sort used by the document sort handler, truncates to
the requested limit, and encodes the result — matching the behavior the
control plane expects when no index exists.
Also fix doc_format's MessagePack detection: zerompk can spuriously
succeed on raw JSON bytes by interpreting the leading '{' byte (0x7B)
as a fixint. Guard the branch to only accept Object values, so JSON
payloads stored in document collections are not misidentified as
MessagePack and garbled on read.
Widen sort_rows visibility from pub(super) to pub(in crate::data::executor)
so the snapshot handler can reuse it without duplication.1 parent 1334bce commit f4a9753
3 files changed
Lines changed: 61 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
84 | 86 | | |
85 | 87 | | |
86 | 88 | | |
87 | | - | |
88 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 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 | + | |
89 | 135 | | |
90 | | - | |
91 | | - | |
| 136 | + | |
92 | 137 | | |
93 | 138 | | |
94 | 139 | | |
95 | 140 | | |
96 | | - | |
| 141 | + | |
97 | 142 | | |
98 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
99 | 148 | | |
100 | | - | |
| 149 | + | |
101 | 150 | | |
102 | 151 | | |
103 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| |||
0 commit comments