SQLite

Check-in [b0ff183b8f]
Login

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

Overview
Comment:Take care not to try to generate code for the ATTACH and DETACH commands if there were syntax errors during parsing. Fix for ticket [2f1b168ab4d4844]
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b0ff183b8ffdbebece06cfea1c6781fc0e8e8547
User & Date: drh 2016-11-11 03:37:24.086
Context
2016-11-23
19:40
Take care not to try to generate code for the ATTACH and DETACH commands if there were syntax errors during parsing. Fix for ticket [2f1b168ab4d4844] (check-in: f8cf7ff156 user: drh tags: branch-3.15)
2016-11-11
04:37
Add the --raw option to the ".read" dot-command of the command-line shell, to cause the named file to be read and sent directly into sqlite3_exec() without any interpretation. (check-in: 09233770b2 user: drh tags: trunk)
03:37
Take care not to try to generate code for the ATTACH and DETACH commands if there were syntax errors during parsing. Fix for ticket [2f1b168ab4d4844] (check-in: b0ff183b8f user: drh tags: trunk)
2016-11-09
01:46
Fix typo in the CSV extension. (check-in: b488958824 user: mistachkin tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/attach.c.
321
322
323
324
325
326
327

328
329
330
331
332
333
334
){
  int rc;
  NameContext sName;
  Vdbe *v;
  sqlite3* db = pParse->db;
  int regArgs;


  memset(&sName, 0, sizeof(NameContext));
  sName.pParse = pParse;

  if( 
      SQLITE_OK!=(rc = resolveAttachExpr(&sName, pFilename)) ||
      SQLITE_OK!=(rc = resolveAttachExpr(&sName, pDbname)) ||
      SQLITE_OK!=(rc = resolveAttachExpr(&sName, pKey))







>







321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
){
  int rc;
  NameContext sName;
  Vdbe *v;
  sqlite3* db = pParse->db;
  int regArgs;

  if( pParse->nErr ) goto attach_end;
  memset(&sName, 0, sizeof(NameContext));
  sName.pParse = pParse;

  if( 
      SQLITE_OK!=(rc = resolveAttachExpr(&sName, pFilename)) ||
      SQLITE_OK!=(rc = resolveAttachExpr(&sName, pDbname)) ||
      SQLITE_OK!=(rc = resolveAttachExpr(&sName, pKey))
Changes to test/fuzz-oss1.test.
1993
1994
1995
1996
1997
1998
1999




2000
2001
"nao:Property14"."ID" AND "9_u" IS NOT NULL AND "10_u" IS NOT
NULL AND ("9_u" COLLATE NOCASE = ? COLLATE NOCASE))) FROM (SELECT
"nco:PersonContact1"."ID" AS "1_u" FROM "nco:PersonContact" AS
"nco:PersonContact1") ORDER BY "1_u";
  }
} {/.* Goto .*/}






finish_test







>
>
>
>


1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
"nao:Property14"."ID" AND "9_u" IS NOT NULL AND "10_u" IS NOT
NULL AND ("9_u" COLLATE NOCASE = ? COLLATE NOCASE))) FROM (SELECT
"nco:PersonContact1"."ID" AS "1_u" FROM "nco:PersonContact" AS
"nco:PersonContact1") ORDER BY "1_u";
  }
} {/.* Goto .*/}

# Crash reported by OSS-FUZZ on 2016-11-10
do_catchsql_test fuzz-oss1-detach {
  DETACH x IS #1;
} {1 {near "#1": syntax error}}

finish_test