diff options
author | dan <Dan Kennedy> | 2021-07-08 18:29:25 +0000 |
---|---|---|
committer | dan <Dan Kennedy> | 2021-07-08 18:29:25 +0000 |
commit | bd24e8faa37592c02fc4e7c1fded2e6bd924e8a4 (patch) | |
tree | 4c5e9179e535a7c3f0eda0f337734f403cc356a8 /src | |
parent | 77ea22300b5bcc0961be5c2578a262d91917cf1f (diff) | |
download | sqlite-bd24e8faa37592c02fc4e7c1fded2e6bd924e8a4.tar.gz sqlite-bd24e8faa37592c02fc4e7c1fded2e6bd924e8a4.zip |
Preserve and return to the user any error message returned by a failed xConnect() call on an eponymous virtual table that prevents a query from being compiled.
FossilOrigin-Name: bbbbeb59a6a14b94dcbaf218cbcfbd39feba4a1df5b37c0e1a955391393eeec4
Diffstat (limited to 'src')
-rw-r--r-- | src/build.c | 1 | ||||
-rw-r--r-- | src/vtab.c | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/build.c b/src/build.c index 5bf5680d4..00fa44795 100644 --- a/src/build.c +++ b/src/build.c @@ -453,6 +453,7 @@ Table *sqlite3LocateTable( pMod = sqlite3PragmaVtabRegister(db, zName); } if( pMod && sqlite3VtabEponymousTableInit(pParse, pMod) ){ + testcase( pMod->pEpoTab==0 ); return pMod->pEpoTab; } } diff --git a/src/vtab.c b/src/vtab.c index c9dcadae4..1a9457c24 100644 --- a/src/vtab.c +++ b/src/vtab.c @@ -1190,8 +1190,9 @@ void sqlite3VtabMakeWritable(Parse *pParse, Table *pTab){ /* ** Check to see if virtual table module pMod can be have an eponymous ** virtual table instance. If it can, create one if one does not already -** exist. Return non-zero if the eponymous virtual table instance exists -** when this routine returns, and return zero if it does not exist. +** exist. Return non-zero if either the eponymous virtual table instance +** exists when this routine returns or if an attempt to create it failed +** and an error message was left in pParse. ** ** An eponymous virtual table instance is one that is named after its ** module, and more importantly, does not require a CREATE VIRTUAL TABLE @@ -1230,7 +1231,6 @@ int sqlite3VtabEponymousTableInit(Parse *pParse, Module *pMod){ sqlite3ErrorMsg(pParse, "%s", zErr); sqlite3DbFree(db, zErr); sqlite3VtabEponymousTableClear(db, pMod); - return 0; } return 1; } |