Commit d3f84f2
committed
sqlite3: validate narg before creating functions/aggregates
CPython 3.14 added check_num_params() which raises ProgrammingError when
narg/n_arg/num_params is out of range (-1..=SQLITE_LIMIT_FUNCTION_ARG).
RustPython passed invalid values directly to SQLite, resulting in an
OperationalError instead.
Add check_num_params() helper and call it in create_function(),
create_aggregate(), and create_window_function().
Assisted-by: GitHub Copilot:claude-sonnet-4-61 parent 2274cef commit d3f84f2
2 files changed
Lines changed: 19 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
174 | 173 | | |
175 | 174 | | |
176 | 175 | | |
| |||
514 | 513 | | |
515 | 514 | | |
516 | 515 | | |
517 | | - | |
518 | 516 | | |
519 | 517 | | |
520 | 518 | | |
| |||
649 | 647 | | |
650 | 648 | | |
651 | 649 | | |
652 | | - | |
653 | 650 | | |
654 | 651 | | |
655 | 652 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1279 | 1279 | | |
1280 | 1280 | | |
1281 | 1281 | | |
| 1282 | + | |
1282 | 1283 | | |
1283 | 1284 | | |
1284 | 1285 | | |
| |||
1310 | 1311 | | |
1311 | 1312 | | |
1312 | 1313 | | |
| 1314 | + | |
1313 | 1315 | | |
1314 | 1316 | | |
1315 | 1317 | | |
| |||
1392 | 1394 | | |
1393 | 1395 | | |
1394 | 1396 | | |
| 1397 | + | |
1395 | 1398 | | |
1396 | 1399 | | |
1397 | 1400 | | |
| |||
3475 | 3478 | | |
3476 | 3479 | | |
3477 | 3480 | | |
| 3481 | + | |
| 3482 | + | |
| 3483 | + | |
| 3484 | + | |
| 3485 | + | |
| 3486 | + | |
| 3487 | + | |
| 3488 | + | |
| 3489 | + | |
| 3490 | + | |
| 3491 | + | |
| 3492 | + | |
| 3493 | + | |
| 3494 | + | |
| 3495 | + | |
| 3496 | + | |
3478 | 3497 | | |
3479 | 3498 | | |
3480 | 3499 | | |
| |||
0 commit comments