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

Fix a problem with the incremental blob API. sqlite3_blob_open() was always reading the data for the leftmost column of the row that the opened blob was stored in. If this column happened to contain a (the) large blob, sqlite would make a large memory allocation to read the data into. Which defeats the purpose of using incremental blobs. (CVS 5222)

FossilOrigin-Name: 1b9478da2f421c1270e76297324fff8037d2f231
This commit is contained in:
danielk1977
2008-06-16 14:19:57 +00:00
parent fce96308b1
commit 99e925da51
5 changed files with 38 additions and 13 deletions

View File

@@ -12,7 +12,7 @@
**
** This file contains code used to implement incremental BLOB I/O.
**
** $Id: vdbeblob.c,v 1.22 2008/04/24 09:49:55 danielk1977 Exp $
** $Id: vdbeblob.c,v 1.23 2008/06/16 14:19:58 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -191,6 +191,7 @@ int sqlite3_blob_open(
** and offset cache without causing any IO.
*/
sqlite3VdbeChangeP2(v, flags ? 4 : 2, pTab->nCol+1);
sqlite3VdbeChangeP2(v, 8, pTab->nCol);
if( !db->mallocFailed ){
sqlite3VdbeMakeReady(v, 1, 1, 1, 0);
}