From fdeaea1f043dcf56be33344b55a931605c75e301 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Tue, 24 Nov 2015 15:40:15 +0200 Subject: [PATCH] Consume variable length data in parts --- modules/godbcbackend/sodbc.cc | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/modules/godbcbackend/sodbc.cc b/modules/godbcbackend/sodbc.cc index 4c68533a7..562d4dda3 100644 --- a/modules/godbcbackend/sodbc.cc +++ b/modules/godbcbackend/sodbc.cc @@ -267,24 +267,25 @@ SSqlStatement* SODBCStatement::nextRow(row_t& row) { // cerr<<"got row"<(coldata), len)); + } else { + SQLCHAR coldata[4096]; + result = SQLGetData( d_statement, i + 1, SQL_C_CHAR, (SQLPOINTER) coldata, 4096, &len ); + std::string strres = std::string(reinterpret_cast(coldata), std::min(4095,len)); + while(result == SQL_SUCCESS_WITH_INFO && len > 0) { // all data is consumed if len < 1 + result = SQLGetData( d_statement, i + 1, SQL_C_CHAR, (SQLPOINTER) coldata, 4096, &len ); + strres = strres + std::string(reinterpret_cast(coldata), std::min(4095,len)); + cerr<<"len="<