]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
fix ColumnSize argument in SQLBindParameter #12324 12331/head
authorAndrey <113546041+v1shnya@users.noreply.github.com>
Wed, 14 Dec 2022 20:45:12 +0000 (20:45 +0000)
committerAndrey <113546041+v1shnya@users.noreply.github.com>
Wed, 14 Dec 2022 20:45:12 +0000 (20:45 +0000)
modules/godbcbackend/sodbc.cc

index 3db686fccaa139813bf7ed71478840e72f826813..1857952fbbc08a666d962ab99caace4871291a5a 100644 (file)
@@ -93,13 +93,14 @@ public:
   {
     prepareStatement();
     d_req_bind.push_back(p);
+    SQLLEN ColumnSize = (p.ParameterType == SQL_VARCHAR) ? *(p.LenPtr) : 0;
     SQLRETURN result = SQLBindParameter(
       d_statement, // StatementHandle,
       d_paridx + 1, // ParameterNumber,
       SQL_PARAM_INPUT, // InputOutputType,
       p.ValueType, // ValueType,
       p.ParameterType, // ParameterType,
-      0, // ColumnSize,
+      ColumnSize, // ColumnSize,
       0, // DecimalDigits,
       p.ParameterValuePtr, // ParameterValuePtr,
       0, // BufferLength,