X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7C7BF8BA078 for ; Fri, 11 Feb 2005 17:28:55 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 11652-04 for ; Fri, 11 Feb 2005 17:28:34 +0000 (GMT) Received: from mail21.nhs.uk (mail21.nhs.uk [62.6.139.215]) by svr1.postgresql.org (Postfix) with ESMTP id 651248BA12E for ; Fri, 11 Feb 2005 17:28:30 +0000 (GMT) Received: from [10.191.254.3] (helo=relayint2.nhs.uk) by mail21.nhs.uk with esmtp (MTC MTA) id 1Czeaj-0000fj-Is for pgsql-odbc@postgresql.org; Fri, 11 Feb 2005 17:28:29 +0000 Received: from relay.nhs.uk (194.62.42.141) by relayint2.nhs.uk (Syntegra-I2 7.0.008) id 41C955B300DB42D0 for pgsql-odbc@postgresql.org; Fri, 11 Feb 2005 17:28:29 +0000 Received: from smtp1.tayside.scot.nhs.uk (10.252.0.22) by relay.nhs.uk (Syntegra-1 7.0.008) (authenticated as smtp1_tayside_scot_nhs_uk@es2002.nhs.uk) id 420CE33B00004667 for pgsql-odbc@postgresql.org; Fri, 11 Feb 2005 17:28:29 +0000 Received: from smtp1.tayside.scot.nhs.uk (localhost [127.0.0.1]) by localhost.tayside.scot.nhs.uk (Postfix) with ESMTP id CE8B71B39 for ; Fri, 11 Feb 2005 17:28:28 +0000 (GMT) Received: from gonzalo.tuht.scot.nhs.uk (gonzalo.tuht.scot.nhs.uk [10.252.32.96]) by smtp1.tayside.scot.nhs.uk (Postfix) with ESMTP id A70841B38 for ; Fri, 11 Feb 2005 17:28:28 +0000 (GMT) Received: from [192.168.1.46] (localhost [127.0.0.1]) by gonzalo.tuht.scot.nhs.uk (iPlanet Messaging Server 5.2 HotFix 1.25 (built Mar 3 2004)) with ESMTP id <0IBR004X5CJGKQ@gonzalo.tuht.scot.nhs.uk> for pgsql-odbc@postgresql.org; Fri, 11 Feb 2005 17:28:28 +0000 (GMT) Date: Fri, 11 Feb 2005 17:28:28 +0000 From: Paul Cochrane Subject: Bug in convert.c copy_and_convert_field To: pgsql-odbc@postgresql.org Message-id: <420CEB3C.4050003@tuht.scot.nhs.uk> Organization: TORT Centre MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) Content-Transfer-Encoding: Quoted-Printable X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.28 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE X-Spam-Level: X-Archive-Number: 200502/62 X-Sequence-Number: 4952 Hi again list. I think I've encountered a bug in the file convert.c - =20 copy_and_convert_field procedure. Unfortunately my C is a little out of=20 practise not having done it for 10 years or so. Can anyone help? I think=20 I've traced the error to the default part of the switch around line 850=20 (that where the dodgy lines are being placed in the mylog file so it's=20 somewhere before that). Below is a snippet of the mylog showing the=20 problem. The lines where it is saying DEFAULT: & the ptr part of the=20 string. In some cases this is correct but in others there are lots of=20 extra / strange characters. The len field always seems to be correct=20 however. The log file ends with a single ' which may explain the error I get on=20 the server (1) could not receive data from client: Connection reset by=20 peer and (2) unexpected EOF on client connection ]**** SC_fetch: manual_result [2052]fetch: cols=3D13, lf=3D0, opts =3D 137569848, opts->bindings =3D=20 137610576, buffer[] =3D 35483564 [2052]type =3D 1043 [2052]manual_result [2052]value =3D '' [2052]copy_and_convert: field_type =3D 1043, fctype =3D 1, value =3D '',=20 cbValueMax=3D129 [2052]DEFAULT: len =3D 0, ptr =3D '8=C33=08ts' [2052] SQL_C_CHAR, default: len =3D 0, cbValueMax =3D 129,=20 rgbValueBindRow =3D '' [2052]copy_and_convert: retval =3D 0 [2052]fetch: cols=3D13, lf=3D1, opts =3D 137569848, opts->bindings =3D=20 137610576, buffer[] =3D 35483695 [2052]type =3D 1043 [2052]manual_result [2052]value =3D 'public' [2052]copy_and_convert: field_type =3D 1043, fctype =3D 1, value =3D 'pub= lic',=20 cbValueMax=3D129 [2052]DEFAULT: len =3D 6, ptr =3D 'public' [2052] SQL_C_CHAR, default: len =3D 6, cbValueMax =3D 129,=20 rgbValueBindRow =3D 'public' [2052]copy_and_convert: retval =3D 0 [2052]fetch: cols=3D13, lf=3D2, opts =3D 137569848, opts->bindings =3D=20 137610576, buffer[] =3D 35483826 [2052]type =3D 1043 [2052]manual_result [2052]value =3D 'LOGIN' [2052]copy_and_convert: field_type =3D 1043, fctype =3D 1, value =3D 'LOG= IN',=20 cbValueMax=3D129 [2052]DEFAULT: len =3D 5, ptr =3D 'LOGINc' [2052] SQL_C_CHAR, default: len =3D 5, cbValueMax =3D 129,=20 rgbValueBindRow =3D 'LOGIN' [2052]copy_and_convert: retval =3D 0 [2052]fetch: cols=3D13, lf=3D3, opts =3D 137569848, opts->bindings =3D=20 137610576, buffer[] =3D 35483957 [2052]type =3D 21 [2052]manual_result [2052]value =3D '0' [2052]copy_and_convert: field_type =3D 21, fctype =3D 5, value =3D '0',=20 cbValueMax=3D2 [2052]copy_and_convert: retval =3D 0 [2052]fetch: cols=3D13, lf=3D4, opts =3D 137569848, opts->bindings =3D=20 137610576, buffer[] =3D 35483961 [2052]type =3D 1043 [2052]manual_result [2052]value =3D '' [2052]copy_and_convert: field_type =3D 1043, fctype =3D 1, value =3D '',=20 cbValueMax=3D129 [2052]DEFAULT: len =3D 0, ptr =3D '8=C33=08 To' [2052] SQL_C_CHAR, default: len =3D 0, cbValueMax =3D 129,=20 rgbValueBindRow =3D '' [2052]copy_and_convert: retval =3D 0 [2052]fetch: cols=3D13, lf=3D5, opts =3D 137569848, opts->bindings =3D=20 137610576, buffer[] =3D 35484092 [2052]type =3D 1043 [2052]manual_result [2052]value =3D 'LOGIN_pkey' [2052]copy_and_convert: field_type =3D 1043, fctype =3D 1, value =3D=20 'LOGIN_pkey', cbValueMax=3D129 [2052]DEFAULT: len =3D 10, ptr =3D 'LOGIN_pkey' [2052] SQL_C_CHAR, default: len =3D 10, cbValueMax =3D 129,=20 rgbValueBindRow =3D 'LOGIN_pkey' [2052]copy_and_convert: retval =3D 0 [2052]fetch: cols=3D13, lf=3D6, opts =3D 137569848, opts->bindings =3D=20 137610576, buffer[] =3D 35484223 [2052]type =3D 21 [2052]manual_result [2052]value =3D '3' [2052]copy_and_convert: field_type =3D 21, fctype =3D 5, value =3D '3',=20 cbValueMax=3D2 [2052]copy_and_convert: retval =3D 0 [2052]fetch: cols=3D13, lf=3D7, opts =3D 137569848, opts->bindings =3D=20 137610576, buffer[] =3D 35484227 [2052]type =3D 21 [2052]manual_result [2052]value =3D '1' [2052]copy_and_convert: field_type =3D 21, fctype =3D 5, value =3D '1',=20 cbValueMax=3D2 [2052]copy_and_convert: retval =3D 0 [2052]fetch: cols=3D13, lf=3D8, opts =3D 137569848, opts->bindings =3D=20 137610576, buffer[] =3D 35484231 [2052]type =3D 1043 [2052]manual_result [2052]value =3D 'Login' [2052]copy_and_convert: field_type =3D 1043, fctype =3D 1, value =3D 'Log= in',=20 cbValueMax=3D129 [2052]DEFAULT: len =3D 5, ptr =3D 'LoginTo' [2052] SQL_C_CHAR, default: len =3D 5, cbValueMax =3D 129,=20 rgbValueBindRow =3D 'Login' [2052]copy_and_convert: retval =3D 0 [2052]fetch: cols=3D13, lf=3D9, opts =3D 137569848, opts->bindings =3D=20 137610576, buffer[] =3D 35484362 [2052]type =3D 18 [2052]manual_result [2052]value =3D 'A' [2052]copy_and_convert: field_type =3D 18, fctype =3D 1, value =3D 'A',=20 cbValueMax=3D2 [2052]DEFAULT: len =3D 1, ptr =3D 'A=C33=08Nc' [2052] SQL_C_CHAR, default: len =3D 1, cbValueMax =3D 2, rgbValueBindR= ow=20 =3D 'A' [2052]copy_and_convert: retval =3D 0 [2052]fetch: cols=3D13, lf=3D10, opts =3D 137569848, opts->bindings =3D=20 137610576, buffer[] =3D 35484366 [2052]type =3D 23 [2052]manual_result [2052]value =3D '' [2052]copy_and_convert: field_type =3D 23, fctype =3D 4, value =3D '',=20 cbValueMax=3D4 [2052]copy_and_convert: retval =3D 0 [2052]fetch: cols=3D13, lf=3D11, opts =3D 137569848, opts->bindings =3D=20 137610576, buffer[] =3D 35484372 [2052]type =3D 23 [2052]manual_result [2052]value =3D '' [2052]copy_and_convert: field_type =3D 23, fctype =3D 4, value =3D '',=20 cbValueMax=3D4 [2052]copy_and_convert: retval =3D 0 [2052]fetch: cols=3D13, lf=3D12, opts =3D 137569848, opts->bindings =3D=20 137610576, buffer[] =3D 35484378 [2052]type =3D 1043 [2052]manual_result [2052]value =3D '' [2052]copy_and_convert: field_type =3D 1043, fctype =3D 1, value =3D '',=20 cbValueMax=3D129 [2052]copy_and_convert: retval =3D 0 [2052][[SQLFetch]][2052]PGAPI_ExtendedFetch: stmt=3D137569712 [2052]SQL_FETCH_NEXT: num_tuples=3D7, currtuple=3D0 [2052]PGAPI_ExtendedFetch: new currTuple =3D 0 [2052]manual_result =3D 1, use_declarefetch =3D 1 [2052]**** SC_fetch: manual_result [2052]fetch: cols=3D13, lf=3D0, opts =3D 137569848, opts->bindings =3D=20 137610576, buffer[] =3D 35483564 [2052]type =3D 1043 [2052]manual_result [2052]value =3D '' [2052]copy_and_convert: field_type =3D 1043, fctype =3D 1, value =3D '',=20 cbValueMax=3D129 [2052]DEFAULT: len =3D 0, ptr =3D '8=C33=08nTo' [2052] SQL_C_CHAR, default: len =3D 0, cbValueMax =3D 129,=20 rgbValueBindRow =3D '' [2052]copy_and_convert: retval =3D 0 ; This is how the mylog ends [2052]copy_and_convert: field_type =3D 1043, fctype =3D 1, value =3D=20 'Classification', cbValueMax=3D129 [2052]DEFAULT: len =3D 14, ptr =3D ' --=20 Paul Cochrane (paul.m.cochrane@tuht.scot.nhs.uk) +-------------------------------------------------------- | Tayside Orthopaedic & Rehabilitation Technology Centre | Ninewells Hospital & Medical School | Dundee, Scotland, UK.=09 | DD1 9SY | Phone: Internal: 36284 | External: +44 (1382) 496284 | Fax: +44 (1382) 496322 +--------------------------------------------------------=09