From f3a435616a0d991ff2e4593fc7ed663c901a530d Mon Sep 17 00:00:00 2001 From: vms Date: Fri, 3 Sep 2021 12:07:15 +0300 Subject: [PATCH 1/3] use hardcoded free instead of xDel --- src/vdbeapi.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/vdbeapi.c b/src/vdbeapi.c index 61939c5..aca9890 100644 --- a/src/vdbeapi.c +++ b/src/vdbeapi.c @@ -1447,7 +1447,12 @@ int sqlite3_bind_blob( #ifdef SQLITE_ENABLE_API_ARMOR if( nData<0 ) return SQLITE_MISUSE_BKPT; #endif +#ifndef __sqlite_unmodified_upstream return bindText(pStmt, i, zData, nData, xDel, 0); +#else + // xDel is a custom deallocator, due to our IT architecture it can't be provided from other modules. + return bindText(pStmt, i, zData, nData, free, 0); +#endif } int sqlite3_bind_blob64( sqlite3_stmt *pStmt, @@ -1521,7 +1526,12 @@ int sqlite3_bind_text( int nData, void (*xDel)(void*) ){ +#ifndef __sqlite_unmodified_upstream return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF8); +#else + // xDel is a custom deallocator, due to our IT architecture it can't be provided from other modules. + return bindText(pStmt, i, zData, nData, free, SQLITE_UTF8); +#endif } int sqlite3_bind_text64( sqlite3_stmt *pStmt, From 71080d772d59352d5357a4e1cd74bb0f5429c7bf Mon Sep 17 00:00:00 2001 From: vms Date: Fri, 3 Sep 2021 13:43:58 +0300 Subject: [PATCH 2/3] fix --- src/vdbeapi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/vdbeapi.c b/src/vdbeapi.c index aca9890..0ad2f90 100644 --- a/src/vdbeapi.c +++ b/src/vdbeapi.c @@ -1447,11 +1447,12 @@ int sqlite3_bind_blob( #ifdef SQLITE_ENABLE_API_ARMOR if( nData<0 ) return SQLITE_MISUSE_BKPT; #endif -#ifndef __sqlite_unmodified_upstream - return bindText(pStmt, i, zData, nData, xDel, 0); -#else + +#ifdef __sqlite_unmodified_upstream // xDel is a custom deallocator, due to our IT architecture it can't be provided from other modules. return bindText(pStmt, i, zData, nData, free, 0); +#else + return bindText(pStmt, i, zData, nData, xDel, 0); #endif } int sqlite3_bind_blob64( @@ -1526,7 +1527,7 @@ int sqlite3_bind_text( int nData, void (*xDel)(void*) ){ -#ifndef __sqlite_unmodified_upstream +#ifdef __sqlite_unmodified_upstream return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF8); #else // xDel is a custom deallocator, due to our IT architecture it can't be provided from other modules. From 807d6ff47db8272320a4822ae596a8bdc05eb349 Mon Sep 17 00:00:00 2001 From: vms Date: Fri, 3 Sep 2021 13:50:33 +0300 Subject: [PATCH 3/3] fix of fix --- src/vdbeapi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vdbeapi.c b/src/vdbeapi.c index 0ad2f90..ff6a0a3 100644 --- a/src/vdbeapi.c +++ b/src/vdbeapi.c @@ -1449,10 +1449,10 @@ int sqlite3_bind_blob( #endif #ifdef __sqlite_unmodified_upstream + return bindText(pStmt, i, zData, nData, xDel, 0); +#else // xDel is a custom deallocator, due to our IT architecture it can't be provided from other modules. return bindText(pStmt, i, zData, nData, free, 0); -#else - return bindText(pStmt, i, zData, nData, xDel, 0); #endif } int sqlite3_bind_blob64(