In SQLite 3.5.9 it used to be possible to write

sqlite> ATTACH '/some/unix/file/name.db' AS mydb;


In SQLite 3.6.22 this results in the error message

Error: unable to resolve operation

whereas

sqlite> ATTACH /some/unix/file/name.db AS mydb;

is a syntax error at '/'


The problem seems to be the indicated line in the function resolveAttachExpr
(located in attach.c). If the expression ALREADY IS a string, then it makes no
sense to call sqlite3ResolveExprNames() which CANNOT HANDLE a string.


    static int resolveAttachExpr(NameContext *pName, Expr *pExpr)
    {
      int rc = SQLITE_OK;
      if( pExpr ){
>>>>    if( (pExpr->op!=TK_ID) && (pExpr->op!=TK_STRING) ){
          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;
    }

Regards
Gunter Hick

________________________________
Gunter Hick
Software Engineer
Scientific Games International GmbH
Klitschgasse 2 - 4, A - 1130 Vienna, Austria
FN 157284 a, HG Wien
Tel: +43 1 80100 0
E-Mail: h...@scigames.at

This e-mail is confidential and may well also be legally privileged. If you 
have received it in error, you are on notice as to its status and accordingly 
please notify us immediately by reply e-mail and then delete this message from 
your system. Please do not copy it or use it for any purposes, or disclose its 
contents to any person as to do so could be a breach of confidence. Thank you 
for your cooperation.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to