]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Use 128k fetch buffer
authorAki Tuomi <cmouse@cmouse.fi>
Tue, 24 Nov 2015 13:49:45 +0000 (15:49 +0200)
committerAki Tuomi <cmouse@cmouse.fi>
Wed, 25 Nov 2015 06:34:20 +0000 (08:34 +0200)
modules/godbcbackend/sodbc.cc

index 562d4dda332f5b014bf9ba7df3771243d91ceb8c..10c1b274d04b9a66d539e44ea5247c7c4e559afa 100644 (file)
@@ -275,12 +275,12 @@ SSqlStatement* SODBCStatement::nextRow(row_t& row)
         // Column is NULL, so we can skip the converting part.
         row.push_back( "" );
       } else {
-        SQLCHAR coldata[4096];
-        result = SQLGetData( d_statement, i + 1, SQL_C_CHAR, (SQLPOINTER) coldata, 4096, &len );
-        std::string strres = std::string(reinterpret_cast<const char*>(coldata), std::min<SQLLEN>(4095,len));
+        SQLCHAR coldata[128*1024];
+        result = SQLGetData( d_statement, i + 1, SQL_C_CHAR, (SQLPOINTER) coldata, 131702, &len );
+        std::string strres = std::string(reinterpret_cast<const char*>(coldata), std::min<SQLLEN>(131701,len)); // do not use nil byte
         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<const char*>(coldata), std::min<SQLLEN>(4095,len));
+           result = SQLGetData( d_statement, i + 1, SQL_C_CHAR, (SQLPOINTER) coldata, 131702, &len );
+           strres = strres + std::string(reinterpret_cast<const char*>(coldata), std::min<SQLLEN>(131701,len));
            cerr<<"len="<<len<<endl;
         }
         // cerr<<"len="<<len<<endl;