- Notifications
You must be signed in to change notification settings - Fork28
Commitd8cc161
committed
Minor additional improvements for ecpglib/prepare.c.
Avoid allocating never-used entries in stmtCacheEntries[], other than theintentionally-unused zero'th entry. Tie the array size directly to thebucket count and size, rather than having undocumented dependencies betweenthree magic constants. Fix the hash calculation to be platform-independent--- notably, it was sensitive to the signed'ness of "char" before, not tomention having an unnecessary hard-wired dependency on the existence andsize of type "long long". (The lack of complaints says it's been a longtime since anybody tried to build PG on a compiler without "long long",and certainly with the requirement for C99 this isn't a live bug anymore.But it's still not per project coding style.) Fix ecpg_auto_prepare'snew-cache-entry path so that it increments the exec count for the newcache entry not the dummy zero'th entry.The last of those is an actual bug, though one of little consequence;the rest is mostly future-proofing and neatnik-ism. Doesn't seemnecessary to back-patch.1 parente7eb07f commitd8cc161
File tree
2 files changed
+27
-16
lines changed- src/interfaces/ecpg
- ecpglib
- test/expected
2 files changed
+27
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
17 | 27 | | |
18 | 28 | | |
19 | 29 | | |
| |||
25 | 35 | | |
26 | 36 | | |
27 | 37 | | |
28 | | - | |
29 | | - | |
30 | 38 | | |
31 | 39 | | |
32 | 40 | | |
| |||
330 | 338 | | |
331 | 339 | | |
332 | 340 | | |
333 | | - | |
| 341 | + | |
334 | 342 | | |
335 | 343 | | |
336 | 344 | | |
| |||
341 | 349 | | |
342 | 350 | | |
343 | 351 | | |
344 | | - | |
| 352 | + | |
| 353 | + | |
345 | 354 | | |
346 | | - | |
347 | | - | |
| 355 | + | |
| 356 | + | |
348 | 357 | | |
349 | 358 | | |
350 | 359 | | |
351 | | - | |
352 | 360 | | |
353 | | - | |
| 361 | + | |
| 362 | + | |
354 | 363 | | |
355 | 364 | | |
356 | 365 | | |
| |||
451 | 460 | | |
452 | 461 | | |
453 | 462 | | |
454 | | - | |
| 463 | + | |
455 | 464 | | |
456 | 465 | | |
457 | 466 | | |
| |||
534 | 543 | | |
535 | 544 | | |
536 | 545 | | |
537 | | - | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
538 | 549 | | |
539 | 550 | | |
540 | 551 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
| 181 | + | |
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
| 193 | + | |
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | | - | |
| 211 | + | |
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| |||
0 commit comments
Comments
(0)