1 | /* |
2 | * This Source Code Form is subject to the terms of the Mozilla Public |
3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
5 | * |
6 | * Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V. |
7 | */ |
8 | |
9 | /* (c) M.L. Kersten |
10 | * The SQL session parameters can be pre-tested |
11 | */ |
12 | #include "monetdb_config.h" |
13 | #include "mal_client.h" |
14 | #include "mal_instruction.h" |
15 | #include "clients.h" |
16 | #include "opt_pipes.h" |
17 | #include "sql_scenario.h" |
18 | #include "sql_session.h" |
19 | |
20 | str |
21 | SQLsetoptimizer(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci) |
22 | { |
23 | str opt; |
24 | |
25 | if( pci->argc == 3){ |
26 | opt = *getArgReference_str(stk,pci,2); |
27 | } else { |
28 | opt = *getArgReference_str(stk,pci,1); |
29 | } |
30 | if( ! isOptimizerPipe(opt)) |
31 | throw(SQL, "sqloptimizer" , "Valid optimizer pipe expected" ); |
32 | |
33 | return CLTsetoptimizer(cntxt, mb, stk, pci); |
34 | } |
35 | |
36 | str |
37 | SQLsetworkerlimit(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci) |
38 | { |
39 | // We might restrict this based on DBA limitations set |
40 | return CLTsetworkerlimit(cntxt, mb, stk, pci); |
41 | } |
42 | |
43 | str |
44 | SQLsetmemorylimit(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci) |
45 | { |
46 | // We might restrict this based on DBA limitations set |
47 | return CLTsetmemorylimit(cntxt, mb, stk, pci); |
48 | } |
49 | |
50 | str |
51 | SQLqueryTimeout(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci) |
52 | { |
53 | // We might restrict this based on DBA limitations set |
54 | return CLTqueryTimeout(cntxt, mb, stk, pci); |
55 | } |
56 | |
57 | str |
58 | SQLsessionTimeout(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci) |
59 | { |
60 | // We might restrict this based on DBA limitations set |
61 | return CLTsessionTimeout(cntxt, mb, stk, pci); |
62 | } |
63 | |