X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id B62009DCC94 for ; Fri, 16 Dec 2005 13:35:40 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 76273-08 for ; Fri, 16 Dec 2005 13:35:39 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from smtp.pzkagis.cz (gis6.netbox.cz [83.240.30.214]) by postgresql.org (Postfix) with ESMTP id 473FE9DCD3F for ; Fri, 16 Dec 2005 13:35:38 -0400 (AST) Received: (from luf@localhost) by smtp.pzkagis.cz (8.11.6/8.11.6) id jBGHZYt22843; Fri, 16 Dec 2005 18:35:34 +0100 Date: Fri, 16 Dec 2005 18:35:34 +0100 From: Ludek Finstrle To: Andrus Cc: pgsql-odbc@postgresql.org Subject: Re: Access violation C5 error on Visual FoxPro SQLEXEC() call after error Message-ID: <20051216173534.GC22756@soptik.pzkagis.cz> References: <20051216133743.GD20814@soptik.pzkagis.cz> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="8GpibOaaTibBMecb" Content-Disposition: inline In-Reply-To: <20051216133743.GD20814@soptik.pzkagis.cz> User-Agent: Mutt/1.4i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.016 required=5 tests=[AWL=0.016] X-Spam-Score: 0.016 X-Spam-Level: X-Archive-Number: 200512/214 X-Sequence-Number: 6693 --8GpibOaaTibBMecb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > > Can we find a way to implement this in pgodbc also ? > > I have one solution in my mind and Hiroshi Inoue point me that the code > is close ready. I'll try it over weekend. I think I found the solution. I remove Dave's patch and this solution works with first Andrus repro app. So I hope it's good enough. I sent it in another thread. I don't know if Hiroshi is monitoring all posts. Please review and comment attached patch. Thanks to Hiroshi for kicking me Luf --8GpibOaaTibBMecb Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="psqlodbc-limit_bind_param.diff" diff -c psqlodbc.orig\execute.c psqlodbc\execute.c *** psqlodbc.orig\execute.c Tue Dec 06 21:53:30 2005 --- psqlodbc\execute.c Fri Dec 16 18:11:16 2005 *************** *** 542,547 **** --- 542,548 ---- UInt4 offset = apdopts->param_offset_ptr ? *apdopts->param_offset_ptr : 0; Int4 bind_size = apdopts->param_bind_type; Int4 current_row = stmt->exec_current_row < 0 ? 0 : stmt->exec_current_row; + SWORD param_count; /* * Increment the number of currently processed rows *************** *** 549,555 **** if (ipdopts->param_processed_ptr) (*ipdopts->param_processed_ptr)++; stmt->data_at_exec = -1; ! for (i = 0; i < apdopts->allocated; i++) { Int4 *pcVal = apdopts->parameters[i].used; --- 550,559 ---- if (ipdopts->param_processed_ptr) (*ipdopts->param_processed_ptr)++; stmt->data_at_exec = -1; ! /* Check bind parameters count */ ! if (SQL_SUCCESS != PGAPI_NumParams(stmt, ¶m_count)) ! return SQL_ERROR; ! for (i = 0; i < param_count; i++) { Int4 *pcVal = apdopts->parameters[i].used; *************** *** 740,750 **** } /* In the middle of SQLParamData/SQLPutData, so cancel that. */ - - /* Free all previous data-at-exec buffers */ - mylog("%s: Clearing parameters et al.\n", func); - - SC_free_params(stmt, STMT_FREE_PARAMS_ALL); stmt->data_at_exec = -1; stmt->current_exec_param = -1; stmt->put_data = FALSE; --- 744,749 ---- --8GpibOaaTibBMecb--