/ Check-in [0367a4d5]
Login

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

Overview
Comment:Size optimization in the authorizer error message generation logic.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 0367a4d58682a64d7ed4c5a4b4377899e22432851587c649d419efb6d7bac250
User & Date: drh 2017-08-17 18:54:27
Context
2017-08-17
19:23
Small optimization in the Expr tree walker. check-in: 264a5e1b user: drh tags: trunk
18:54
Size optimization in the authorizer error message generation logic. check-in: 0367a4d5 user: drh tags: trunk
18:23
In sqlite3ViewGetColumnNames(), return the number of errors, not an error code. check-in: f13682ea user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/auth.c.

   114    114     if( db->init.busy ) return SQLITE_OK;
   115    115     rc = db->xAuth(db->pAuthArg, SQLITE_READ, zTab,zCol,zDb,pParse->zAuthContext
   116    116   #ifdef SQLITE_USER_AUTHENTICATION
   117    117                    ,db->auth.zAuthUser
   118    118   #endif
   119    119                   );
   120    120     if( rc==SQLITE_DENY ){
   121         -    if( db->nDb>2 || iDb!=0 ){
   122         -      sqlite3ErrorMsg(pParse, "access to %s.%s.%s is prohibited",zDb,zTab,zCol);
   123         -    }else{
   124         -      sqlite3ErrorMsg(pParse, "access to %s.%s is prohibited", zTab, zCol);
   125         -    }
          121  +    char *z = sqlite3_mprintf("%s.%s", zTab, zCol);
          122  +    if( db->nDb>2 || iDb!=0 ) z = sqlite3_mprintf("%s.%z", zDb, z);
          123  +    sqlite3ErrorMsg(pParse, "access to %z is prohibited", z);
   126    124       pParse->rc = SQLITE_AUTH;
   127    125     }else if( rc!=SQLITE_IGNORE && rc!=SQLITE_OK ){
   128    126       sqliteAuthBadReturnCode(pParse);
   129    127     }
   130    128     return rc;
   131    129   }
   132    130