SQLite

Check-in [4d77037be3]
Login

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

Overview
Comment:Report an error when attempting to open a directory as a database. Ticket #687. (CVS 1832)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 4d77037be34b357d24d18d1e13b5f0df580b83ff
User & Date: drh 2004-07-20 01:14:14.000
Context
2004-07-20
01:45
Handle quotes on the table name in TABLE.* terms in SELECT statements. Ticket #680. (CVS 1833) (check-in: 826b6797a9 user: drh tags: trunk)
01:14
Report an error when attempting to open a directory as a database. Ticket #687. (CVS 1832) (check-in: 4d77037be3 user: drh tags: trunk)
00:52
Add test for creating indices with quoted names. Ticket #695. (CVS 1831) (check-in: 7e72c5b7b5 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/os_unix.c.
429
430
431
432
433
434
435





436
437
438
439
440
441
442
  int *pReadonly
){
  int rc;
  assert( !id->isOpen );
  id->dirfd = -1;
  id->h = open(zFilename, O_RDWR|O_CREAT|O_LARGEFILE|O_BINARY, 0644);
  if( id->h<0 ){





    id->h = open(zFilename, O_RDONLY|O_LARGEFILE|O_BINARY);
    if( id->h<0 ){
      return SQLITE_CANTOPEN; 
    }
    *pReadonly = 1;
  }else{
    *pReadonly = 0;







>
>
>
>
>







429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
  int *pReadonly
){
  int rc;
  assert( !id->isOpen );
  id->dirfd = -1;
  id->h = open(zFilename, O_RDWR|O_CREAT|O_LARGEFILE|O_BINARY, 0644);
  if( id->h<0 ){
#ifdef EISDIR
    if( errno==EISDIR ){
      return SQLITE_CANTOPEN;
    }
#endif
    id->h = open(zFilename, O_RDONLY|O_LARGEFILE|O_BINARY);
    if( id->h<0 ){
      return SQLITE_CANTOPEN; 
    }
    *pReadonly = 1;
  }else{
    *pReadonly = 0;