aboutsummaryrefslogtreecommitdiff
path: root/src/vdbeblob.c
diff options
context:
space:
mode:
authordanielk1977 <danielk1977@noemail.net>2008-04-24 09:49:55 +0000
committerdanielk1977 <danielk1977@noemail.net>2008-04-24 09:49:55 +0000
commit36961ed23f377f3f2a13b9350c66490391af8f19 (patch)
tree3f243a762712bc7fecbaab510ff583ff1cd05383 /src/vdbeblob.c
parent9eca081c1307f94961875a4e51f777b0987b48e6 (diff)
downloadsqlite-36961ed23f377f3f2a13b9350c66490391af8f19.tar.gz
sqlite-36961ed23f377f3f2a13b9350c66490391af8f19.zip
Ensure that it is not possible to open either virtual table or view columns using the blob API. Ticket #3078. (CVS 5041)
FossilOrigin-Name: 6039328fe05aaf9380d545e84dfabccb32a4d8ea
Diffstat (limited to 'src/vdbeblob.c')
-rw-r--r--src/vdbeblob.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/vdbeblob.c b/src/vdbeblob.c
index 1d456ad31..6b5a19dd7 100644
--- a/src/vdbeblob.c
+++ b/src/vdbeblob.c
@@ -12,7 +12,7 @@
**
** This file contains code used to implement incremental BLOB I/O.
**
-** $Id: vdbeblob.c,v 1.21 2008/03/25 09:47:35 danielk1977 Exp $
+** $Id: vdbeblob.c,v 1.22 2008/04/24 09:49:55 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -104,6 +104,16 @@ int sqlite3_blob_open(
sqlite3BtreeEnterAll(db);
pTab = sqlite3LocateTable(&sParse, 0, zTable, zDb);
+ if( pTab && IsVirtual(pTab) ){
+ pTab = 0;
+ sqlite3ErrorMsg(&sParse, "cannot open virtual table: %s", zTable);
+ }
+#ifndef SQLITE_OMIT_VIEW
+ if( pTab && pTab->pSelect ){
+ pTab = 0;
+ sqlite3ErrorMsg(&sParse, "cannot open view: %s", zTable);
+ }
+#endif
if( !pTab ){
if( sParse.zErrMsg ){
sqlite3_snprintf(sizeof(zErr), zErr, "%s", sParse.zErrMsg);