Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id D18721337BBB for ; Fri, 25 Mar 2011 10:35:08 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 33440-03 for ; Fri, 25 Mar 2011 13:35:08 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by mail.postgresql.org (Postfix) with ESMTP id 3262B1337B6E for ; Fri, 25 Mar 2011 10:35:07 -0300 (ADT) Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by wwwmaster.postgresql.org (8.14.3/8.14.3) with ESMTP id p2PDZ84f051759 for ; Fri, 25 Mar 2011 13:35:08 GMT (envelope-from www@wwwmaster.postgresql.org) Received: (from www@localhost) by wwwmaster.postgresql.org (8.14.3/8.14.3/Submit) id p2PDZ8iR051758; Fri, 25 Mar 2011 13:35:08 GMT (envelope-from www) Date: Fri, 25 Mar 2011 13:35:08 GMT Message-Id: <201103251335.p2PDZ8iR051758@wwwmaster.postgresql.org> To: pgsql-bugs@postgresql.org Subject: BUG #5949: ODBC driver. Binding Arrays of Parameters From: "Mihail Popov" Content-Type: text/plain; charset=utf-8 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 201103/328 X-Sequence-Number: 29838 The following bug has been logged online: Bug reference: 5949 Logged by: Mihail Popov Email address: mi1919@tut.by PostgreSQL version: 9.3 Operating system: windows 7 Description: ODBC driver. Binding Arrays of Parameters Details: Using ODBC, I encountered an error. I used the ODBC API to insert an array of records. Example: unsigned long r = 5; SQLSetStmtAttr(stmt, SQL_ATTR_PARAM_BIND_TYPE, SQL_PARAM_BIND_BY_COLUMN, 0); SQLSetStmtAttr(stmt, SQL_ATTR_PARAMSET_SIZE, &r, 0); …. // Bind the parameters in column-wise fashion. SQLBindParameter(…) … When you run the error occurred. SQLExecDirect(hstmt, Statement, SQL_NTS); Errors are detected in the implementation of SQLSetStmtAttr in the ODBC driver. Coming PGAPI_SetStmtAttr (HSTMT StatementHandle, SQLINTEGER Attribute, PTR Value, SQLINTEGER StringLength) in pgapi30.c For SQL_ATTR_PARAMSET_SIZE transformation SC_get_APDF (stmt) -> paramset_size = CAST_UPTR2 (SQLUINTEGER SQLINTEGER, Value); led to the fact that paramset_size not equal to 5 and the number of memory address that contains the variable r.