/ Check-in [df70a1f3]
Login

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 Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/attach.c.

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