251
252
253
254
255
256
257
258
259
260
261
262
263
264
|
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
|
+
+
+
+
+
+
+
+
+
+
+
+
+
|
*(char**)pError = mprintf("only SELECT statements are allowed");
rc = SQLITE_DENY;
break;
}
}
return rc;
}
/*
** Make sure the reportfmt table is up-to-date. It should contain
** the "jx" column (as of version 2.21). If it does not, add it.
**
** The "jx" column is intended to hold a JSON object containing optional
** key-value pairs.
*/
void report_update_reportfmt_table(void){
if( db_table_has_column("repository","reportfmt","jx")==0 ){
db_multi_exec("ALTER TABLE repository.reportfmt ADD COLUMN jx TEXT;");
}
}
/*
** Activate the ticket report query authorizer. Must be followed by an
** eventual call to report_unrestrict_sql().
*/
void report_restrict_sql(char **pzErr){
db_set_authorizer(report_query_authorizer,(void*)pzErr,"Ticket-Report");
|