SQLite

Check-in [9a1da91850]
Login

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

Overview
Comment:Disable the "filename" pragma implemented by os_unix.c except when compiled with SQLITE_TEST.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | file-control-pragma
Files: files | file ages | folders
SHA1: 9a1da91850b6074e5f9d18382f517eb868cad63c
User & Date: drh 2012-02-22 19:03:19.757
Context
2012-02-22
19:56
If the SQLITE_FCNTL_PRAGMA file-control returns anything other than SQLTIE_NOTFOUND and SQLITE_OK, then treat the result as an error. (check-in: 5643618108 user: drh tags: file-control-pragma)
19:03
Disable the "filename" pragma implemented by os_unix.c except when compiled with SQLITE_TEST. (check-in: 9a1da91850 user: drh tags: file-control-pragma)
18:21
Make benign any malloc failures inside the sqlite3_file_control() call within PRAGMA parsing. Add a couple simple tests for SQLITE_FCNTL_PRAGMA. (check-in: a1f29fa653 user: drh tags: file-control-pragma)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/os_unix.c.
3585
3586
3587
3588
3589
3590
3591

3592
3593
3594
3595

3596
3597
3598
3599
3600
3601
3602
    }
    case SQLITE_FCNTL_VFSNAME: {
      *(char**)pArg = sqlite3_mprintf("%s", pFile->pVfs->zName);
      return SQLITE_OK;
    }
    case SQLITE_FCNTL_PRAGMA: {
      char **azArg = (char**)pArg;

      if( sqlite3_stricmp(azArg[1], "filename")==0 ){
        azArg[0] = sqlite3_mprintf("%s", pFile->zPath);
        return SQLITE_OK;
      }

      break;
    }
#ifndef NDEBUG
    /* The pager calls this method to signal that it has done
    ** a rollback and that the database is therefore unchanged and
    ** it hence it is OK for the transaction change counter to be
    ** unchanged.







>




>







3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
    }
    case SQLITE_FCNTL_VFSNAME: {
      *(char**)pArg = sqlite3_mprintf("%s", pFile->pVfs->zName);
      return SQLITE_OK;
    }
    case SQLITE_FCNTL_PRAGMA: {
      char **azArg = (char**)pArg;
#ifdef SQLITE_TEST
      if( sqlite3_stricmp(azArg[1], "filename")==0 ){
        azArg[0] = sqlite3_mprintf("%s", pFile->zPath);
        return SQLITE_OK;
      }
#endif
      break;
    }
#ifndef NDEBUG
    /* The pager calls this method to signal that it has done
    ** a rollback and that the database is therefore unchanged and
    ** it hence it is OK for the transaction change counter to be
    ** unchanged.