/ Check-in [df70a1f3]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Allow any arbitrary expression as the filename in an ATTACH statement, including functions and subqueries.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: df70a1f30393b34146d6b8bf1df5a76aaf362efe
User & Date: drh 2013-12-20 14:48:12
Context
2013-12-20
15:59
Combine adjacent single-register OP_Copy instructions into a single multi-register OP_Copy, where possible. Fix the Synopsis comment for multi-register OP_Copy instructions to show the correct register ranges. check-in: 2ae22dc0 user: drh tags: trunk
14:48
Allow any arbitrary expression as the filename in an ATTACH statement, including functions and subqueries. check-in: df70a1f3 user: drh tags: trunk
13:11
Simplify the accumulator reset for aggregate query processing so that it uses a single multi-register OP_Null rather than a separate OP_Null for each register. check-in: 2c7fd9b0 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/attach.c.

34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
*/
static int resolveAttachExpr(NameContext *pName, Expr *pExpr)
{
  int rc = SQLITE_OK;
  if( pExpr ){
    if( pExpr->op!=TK_ID ){
      rc = sqlite3ResolveExprNames(pName, pExpr);
      if( rc==SQLITE_OK && !sqlite3ExprIsConstant(pExpr) ){
        sqlite3ErrorMsg(pName->pParse, "invalid name: \"%s\"", pExpr->u.zToken);
        return SQLITE_ERROR;
      }
    }else{
      pExpr->op = TK_STRING;
    }
  }
  return rc;
}








<
<
<
<







34
35
36
37
38
39
40




41
42
43
44
45
46
47
*/
static int resolveAttachExpr(NameContext *pName, Expr *pExpr)
{
  int rc = SQLITE_OK;
  if( pExpr ){
    if( pExpr->op!=TK_ID ){
      rc = sqlite3ResolveExprNames(pName, pExpr);




    }else{
      pExpr->op = TK_STRING;
    }
  }
  return rc;
}