aboutsummaryrefslogtreecommitdiff
path: root/src/func.c
diff options
context:
space:
mode:
authordrh <>2021-10-03 00:12:43 +0000
committerdrh <>2021-10-03 00:12:43 +0000
commit5bf4715e0184cceca87c372af609959c6df75b43 (patch)
tree751bc0d7f1b1d84d7acc6dc1704cecbaeaad4618 /src/func.c
parentad1188b21c6fc7a08a6639c7c09beb5295c15a09 (diff)
downloadsqlite-5bf4715e0184cceca87c372af609959c6df75b43.tar.gz
sqlite-5bf4715e0184cceca87c372af609959c6df75b43.zip
Add the sqlite3ResultStrAccum() internal interface to simplify the
the implementation of functions that return strings. FossilOrigin-Name: e548e9299d3fd6ce5b647cf0dd93ff8e917a5eda43076c6a02389c52640e2e50
Diffstat (limited to 'src/func.c')
-rw-r--r--src/func.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/func.c b/src/func.c
index 900ea94c6..754ffc50e 100644
--- a/src/func.c
+++ b/src/func.c
@@ -1853,16 +1853,7 @@ static void groupConcatFinalize(sqlite3_context *context){
GroupConcatCtx *pGCC
= (GroupConcatCtx*)sqlite3_aggregate_context(context, 0);
if( pGCC ){
- StrAccum *pAccum = &pGCC->str;
- if( pAccum->accError==SQLITE_TOOBIG ){
- sqlite3_result_error_toobig(context);
- }else if( pAccum->accError==SQLITE_NOMEM ){
- sqlite3_result_error_nomem(context);
- }else{
- int n = pAccum->nChar;
- sqlite3_result_text(context, sqlite3StrAccumFinish(pAccum), n,
- sqlite3_free);
- }
+ sqlite3ResultStrAccum(context, &pGCC->str);
#ifndef SQLITE_OMIT_WINDOWFUNC
sqlite3_free(pGCC->pnSepLengths);
#endif