Fossil

Check-in [ae72a652a7]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Allow "with" as well as "select" to be used in ticket report queries, as suggested by Sean Woods on the ML.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ae72a652a7882d8b5ca3b77e75bbffc21e2f878b
User & Date: jan.nijtmans 2015-01-22 19:16:59.502
Context
2015-01-22
19:49
Allow recursive queries in user input. ... (check-in: beaf897cb1 user: jan.nijtmans tags: trunk)
19:16
Allow "with" as well as "select" to be used in ticket report queries, as suggested by Sean Woods on the ML. ... (check-in: ae72a652a7 user: jan.nijtmans tags: trunk)
15:47
Add Étienne Deparis's GitHub-like skin to the set of built-ins. ... (check-in: 51935f265a user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/report.c.
241
242
243
244
245
246
247
248

249
250
251
252
253
254
255
  sqlite3_stmt *pStmt;
  int rc;

  /* First make sure the SQL is a single query command by verifying that
  ** the first token is "SELECT" and that there are no unquoted semicolons.
  */
  for(i=0; fossil_isspace(zSql[i]); i++){}
  if( fossil_strnicmp(&zSql[i],"select",6)!=0 ){

    return mprintf("The SQL must be a SELECT statement");
  }
  for(i=0; zSql[i]; i++){
    if( zSql[i]==';' ){
      int bad;
      int c = zSql[i+1];
      zSql[i+1] = 0;







|
>







241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
  sqlite3_stmt *pStmt;
  int rc;

  /* First make sure the SQL is a single query command by verifying that
  ** the first token is "SELECT" and that there are no unquoted semicolons.
  */
  for(i=0; fossil_isspace(zSql[i]); i++){}
  if( fossil_strnicmp(&zSql[i], "select", 6)!=0
      && fossil_strnicmp(&zSql[i], "with", 4)!=0 ){
    return mprintf("The SQL must be a SELECT statement");
  }
  for(i=0; zSql[i]; i++){
    if( zSql[i]==';' ){
      int bad;
      int c = zSql[i+1];
      zSql[i+1] = 0;