1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Have the dbstat module dequote any argument passed to the CREATE VIRTUAL TABLE statement before attempting to match it against the names of attached databases.

FossilOrigin-Name: e60461e984b8df09256bb0d733dbfae52568a145
This commit is contained in:
dan
2016-01-22 15:44:07 +00:00
parent d7d305a25a
commit b5c557b87e
4 changed files with 80 additions and 10 deletions

View File

@@ -149,7 +149,11 @@ static int statConnect(
int iDb;
if( argc>=4 ){
iDb = sqlite3FindDbName(db, argv[3]);
char *zDb = sqlite3DbStrDup(db, argv[3]);
if( zDb==0 ) return SQLITE_NOMEM;
sqlite3Dequote(zDb);
iDb = sqlite3FindDbName(db, zDb);
sqlite3DbFree(db, zDb);
if( iDb<0 ){
*pzErr = sqlite3_mprintf("no such database: %s", argv[3]);
return SQLITE_ERROR;