Fossil SCM

Fix comment and error-message

jan.nijtmans 2015-01-23 14:31 trunk
Commit 9a07b24935c6c4bda2c5a63b00a466a60563b711
1 file changed +3 -2
+3 -2
--- src/report.c
+++ src/report.c
@@ -236,16 +236,17 @@
236236
const char *zTail;
237237
sqlite3_stmt *pStmt;
238238
int rc;
239239
240240
/* First make sure the SQL is a single query command by verifying that
241
- ** the first token is "SELECT" and that there are no unquoted semicolons.
241
+ ** the first token is "SELECT" or "WITH" and that there are no unquoted
242
+ ** semicolons.
242243
*/
243244
for(i=0; fossil_isspace(zSql[i]); i++){}
244245
if( fossil_strnicmp(&zSql[i], "select", 6)!=0
245246
&& fossil_strnicmp(&zSql[i], "with", 4)!=0 ){
246
- return mprintf("The SQL must be a SELECT statement");
247
+ return mprintf("The SQL must be a SELECT or WITH statement");
247248
}
248249
for(i=0; zSql[i]; i++){
249250
if( zSql[i]==';' ){
250251
int bad;
251252
int c = zSql[i+1];
252253
--- src/report.c
+++ src/report.c
@@ -236,16 +236,17 @@
236 const char *zTail;
237 sqlite3_stmt *pStmt;
238 int rc;
239
240 /* First make sure the SQL is a single query command by verifying that
241 ** the first token is "SELECT" and that there are no unquoted semicolons.
 
242 */
243 for(i=0; fossil_isspace(zSql[i]); i++){}
244 if( fossil_strnicmp(&zSql[i], "select", 6)!=0
245 && fossil_strnicmp(&zSql[i], "with", 4)!=0 ){
246 return mprintf("The SQL must be a SELECT statement");
247 }
248 for(i=0; zSql[i]; i++){
249 if( zSql[i]==';' ){
250 int bad;
251 int c = zSql[i+1];
252
--- src/report.c
+++ src/report.c
@@ -236,16 +236,17 @@
236 const char *zTail;
237 sqlite3_stmt *pStmt;
238 int rc;
239
240 /* First make sure the SQL is a single query command by verifying that
241 ** the first token is "SELECT" or "WITH" and that there are no unquoted
242 ** semicolons.
243 */
244 for(i=0; fossil_isspace(zSql[i]); i++){}
245 if( fossil_strnicmp(&zSql[i], "select", 6)!=0
246 && fossil_strnicmp(&zSql[i], "with", 4)!=0 ){
247 return mprintf("The SQL must be a SELECT or WITH statement");
248 }
249 for(i=0; zSql[i]; i++){
250 if( zSql[i]==';' ){
251 int bad;
252 int c = zSql[i+1];
253

Keyboard Shortcuts

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