Fossil SCM
Allow "with" as well as "select" to be used in ticket report queries, as suggested by Sean Woods on the ML.
Commit
ae72a652a7882d8b5ca3b77e75bbffc21e2f878b
Parent
51935f265afe0af…
1 file changed
+2
-1
+2
-1
| --- src/report.c | ||
| +++ src/report.c | ||
| @@ -243,11 +243,12 @@ | ||
| 243 | 243 | |
| 244 | 244 | /* First make sure the SQL is a single query command by verifying that |
| 245 | 245 | ** the first token is "SELECT" and that there are no unquoted semicolons. |
| 246 | 246 | */ |
| 247 | 247 | 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 ){ | |
| 249 | 250 | return mprintf("The SQL must be a SELECT statement"); |
| 250 | 251 | } |
| 251 | 252 | for(i=0; zSql[i]; i++){ |
| 252 | 253 | if( zSql[i]==';' ){ |
| 253 | 254 | int bad; |
| 254 | 255 |
| --- 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 |