Skip to content

Commit 4480262

Browse files
authored
Merge pull request github#11244 from github/python/support-grouped-exceptions
Python: support grouped exceptions
2 parents 690dd47 + f5e33ac commit 4480262

25 files changed

+4810
-37
lines changed

python/downgrades/47e552c4357a04c5735355fad818630daee4a5ac/old.dbscheme

Lines changed: 1106 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// First we need to wrap some database types
2+
class Stmt_ extends @py_stmt {
3+
string toString() { result = "Stmt" }
4+
}
5+
6+
class StmtList_ extends @py_stmt_list {
7+
string toString() { result = "StmtList" }
8+
}
9+
10+
/**
11+
* New kinds have been inserted such that
12+
* `@py_Exec` which used to have index 7 now has index 8.
13+
* Entries with lower indices are unchanged.
14+
*/
15+
bindingset[new_index]
16+
int old_index(int new_index) {
17+
not new_index = 7 and
18+
if new_index < 7 then result = new_index else result + (8 - 7) = new_index
19+
}
20+
21+
// The schema for py_stmts is:
22+
//
23+
// py_stmts(unique int id : @py_stmt,
24+
// int kind: int ref,
25+
// int parent : @py_stmt_list ref,
26+
// int idx : int ref);
27+
from Stmt_ expr, int new_kind, StmtList_ parent, int idx, int old_kind
28+
where
29+
py_stmts(expr, new_kind, parent, idx) and
30+
old_kind = old_index(new_kind)
31+
select expr, old_kind, parent, idx

0 commit comments

Comments
 (0)