Fossil SCM

Allow "with" as well as "select" to be used in ticket report queries, as suggested by Sean Woods on the ML.

jan.nijtmans 2015-01-22 19:16 trunk
Commit ae72a652a7882d8b5ca3b77e75bbffc21e2f878b
1 file changed +2 -1
+2 -1
--- src/report.c
+++ src/report.c
@@ -243,11 +243,12 @@
243243
244244
/* First make sure the SQL is a single query command by verifying that
245245
** the first token is "SELECT" and that there are no unquoted semicolons.
246246
*/
247247
for(i=0; fossil_isspace(zSql[i]); i++){}
248
- if( fossil_strnicmp(&zSql[i],"select",6)!=0 ){
248
+ if( fossil_strnicmp(&zSql[i], "select", 6)!=0
249
+ && fossil_strnicmp(&zSql[i], "with", 4)!=0 ){
249250
return mprintf("The SQL must be a SELECT statement");
250251
}
251252
for(i=0; zSql[i]; i++){
252253
if( zSql[i]==';' ){
253254
int bad;
254255
--- src/report.c
+++ src/report.c
@@ -243,11 +243,12 @@
243
244 /* First make sure the SQL is a single query command by verifying that
245 ** the first token is "SELECT" and that there are no unquoted semicolons.
246 */
247 for(i=0; fossil_isspace(zSql[i]); i++){}
248 if( fossil_strnicmp(&zSql[i],"select",6)!=0 ){
 
249 return mprintf("The SQL must be a SELECT statement");
250 }
251 for(i=0; zSql[i]; i++){
252 if( zSql[i]==';' ){
253 int bad;
254
--- src/report.c
+++ src/report.c
@@ -243,11 +243,12 @@
243
244 /* First make sure the SQL is a single query command by verifying that
245 ** the first token is "SELECT" and that there are no unquoted semicolons.
246 */
247 for(i=0; fossil_isspace(zSql[i]); i++){}
248 if( fossil_strnicmp(&zSql[i], "select", 6)!=0
249 && fossil_strnicmp(&zSql[i], "with", 4)!=0 ){
250 return mprintf("The SQL must be a SELECT statement");
251 }
252 for(i=0; zSql[i]; i++){
253 if( zSql[i]==';' ){
254 int bad;
255

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button