1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Size optimization in the authorizer error message generation logic.

FossilOrigin-Name: 0367a4d58682a64d7ed4c5a4b4377899e22432851587c649d419efb6d7bac250
This commit is contained in:
drh
2017-08-17 18:54:27 +00:00
parent efaffb64fd
commit 6f7fbcf0bb
3 changed files with 10 additions and 12 deletions

View File

@@ -118,11 +118,9 @@ int sqlite3AuthReadCol(
#endif
);
if( rc==SQLITE_DENY ){
if( db->nDb>2 || iDb!=0 ){
sqlite3ErrorMsg(pParse, "access to %s.%s.%s is prohibited",zDb,zTab,zCol);
}else{
sqlite3ErrorMsg(pParse, "access to %s.%s is prohibited", zTab, zCol);
}
char *z = sqlite3_mprintf("%s.%s", zTab, zCol);
if( db->nDb>2 || iDb!=0 ) z = sqlite3_mprintf("%s.%z", zDb, z);
sqlite3ErrorMsg(pParse, "access to %z is prohibited", z);
pParse->rc = SQLITE_AUTH;
}else if( rc!=SQLITE_IGNORE && rc!=SQLITE_OK ){
sqliteAuthBadReturnCode(pParse);