Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id AD62863FA02 for ; Thu, 10 Nov 2011 09:36:15 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 55408-01-9 for ; Thu, 10 Nov 2011 13:36:09 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34]) by mail.postgresql.org (Postfix) with SMTP id 4325563FA04 for ; Thu, 10 Nov 2011 09:36:05 -0400 (AST) Received: (qmail 17487 invoked by uid 512); 10 Nov 2011 13:36:03 -0000 X-Authentication: inoue was authenticated by sd.tpf.co.jp at 10 Nov 2011 13:36:03 -0000 Received: from unknown (HELO ?192.168.24.54?) (183.76.20.202) by sd.tpf.co.jp with SMTP; 10 Nov 2011 13:36:03 -0000 Message-ID: <4EBBD33E.8070205@tpf.co.jp> Date: Thu, 10 Nov 2011 22:35:58 +0900 From: Hiroshi Inoue User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; ja; rv:1.9.2.24) Gecko/20111103 Thunderbird/3.1.16 MIME-Version: 1.0 To: lehmann@cnm.de CC: pgsql-odbc@postgresql.org Subject: Re: SQLDescribeParam / SUPPORT_DESCRIBE_PARAM References: <4EB9DA9C.7040800@cnm.de> <4EB9F81C.6000108@tpf.co.jp> <875195352e9274e2c0078113d3762051@cnm.de> In-Reply-To: <875195352e9274e2c0078113d3762051@cnm.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-3.101 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-1.201 X-Spam-Level: X-Archive-Number: 201111/28 X-Sequence-Number: 10746 Hi, (2011/11/10 11:07), lehmann@cnm.de wrote: > Hello, > >> Please check the *Server side prepare* option of your datasource or >> add UseServerSidePrepare=1 to your connection string. > > I tried, but it doesn't work completely. Actually, when I just use > UseServerSidePrepare = 1 in odbc.ini, I get some error like this: > > Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to > allocate 3086129905 bytes) The above message comes from the PostgreSQL server. Could you examine which query causes the error using the server log? > in testbase.php on line 64 > > Then when I add Parse = 1 it works fine on the command line, ie. when I > call the php-cgi instance with the testscript. > > But is soon as I start the script through Apache und mod_php with the > same ldd-dependencies, I again get exhausted memory errors. > > I traced the query - it's as simple as "select count(*) from sessions > where cust_id = ?" - and I found these lines: > > [ODBC][3429][1320890058.574677][SQLNumResultCols.c][248] > Exit:[SQL_SUCCESS] > Count = 0xb7f2a80c -> 1 > [ODBC][3429][1320890058.574872][SQLColAttributes.c][280] > Entry: > Statement = 0x9c3cff0 > Column Number = 1 > Field Identifier = SQL_COLUMN_NAME > Character Attr = 0xb7f2a82c > Buffer Length = 32 > String Length = 0xbff54e3a > Numeric Attribute = (nil) > [ODBC][3429][1320890058.576863][SQLColAttributes.c][597] > Exit:[SQL_SUCCESS] > > So SQLNumResultCols = 1 seems to be correct. But String Length = > 0xbff54e3a seems to be very absurd! That's 3220524602 bytes which means > around 3 GB! But the correct result is an integer of 5. Any idea how > this problem arises? Does psqlodbc through mod_php not set the > Parse-option? What is the actual problem? I didn't have such problems > with the DBD::Pg driver. > > Kind regards > Marten