Re: [ODBC] New bug or regression between 9.6 releases 0410 and 0310 - Mailing list pgsql-odbc

From Inoue, Hiroshi
Subject Re: [ODBC] New bug or regression between 9.6 releases 0410 and 0310
Date
Msg-id 376580d7-d54d-0e2b-51cb-bd25a60d5c5e@dream.email.ne.jp
Whole thread Raw
In response to [ODBC] New bug or regression between 9.6 releases 0410 and 0310  (Matej Mihelič <Matej.Mihelic@neosys.si>)
Responses Re: [ODBC] New bug or regression between 9.6 releases 0410 and 0310  ("Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>)
List pgsql-odbc
Hi Matej,

Thanks for the report.
Please give me some time.

regards,
Hiroshi Inoue

On 2017/08/03 21:55, Matej Mihelič wrote:
> * New bug or regression between 9.6 releases 0410 and 0310
>
> Win64/Win32 ODBC: With the 0410 release we are seeing a ODBC manager error "[Microsoft][ODBC Driver Manager] Invalid
stringor buffer length" on a particular row when fetching a BYTEA field. This was a single field SELECT. We can read
thevalue from all preceding rows so it to do something with this field value. 
>
> The error disappears when we revert back to the 0310 ODBC release.
>
> I can send you the exact value of the BLOB in a private email if necessary. I've double check the following:
>
> a) LENGTH(contents) from the database does return the expected length: 25560.
>
> b) I took the hex- encoded value from the log file and compared it with the value in the database. The value is the
same.
> ( select LENGTH(contents)=length(test) LenIsEqual, contents=test as ContentIsEqual, * from ( select contents,
CAST(E'\\xff0a0054465...) 
>
>
>
> Excerpt from the log:
>
>
> [6976-45.657]ColAttSet in
> [6976-45.657]updatable=1 tab=1 fields=1[6976-45.657]->1
> [6976-45.657]PARSE: searchColInfo by attnum=5
> [6976-45.657]PARSE: fieldtype=17, col_name='contents', column_size=-4
> [6976-45.658]describeCol: col 0 fieldname = 'contents'
> [6976-45.658]describeCol: col 0 fieldtype = 17
> [6976-45.658]describeCol: col 0 column_size = -4
> [6976-45.658]describeCol: col 0 *pfSqlType = -4
> [6976-45.658]describeCol: col 0  *pcbColDef = 0
> [6976-45.658]describeCol: col 0  *pibScale = 0
> [6976-45.658]describeCol: col 0  *pfNullable = 1
> [6976-45.659]DiscardStatementSvp:in_progress=0 previous=0
> [6976-45.659][SQLBindCol][6976-45.659]PGAPI_BindCol: entering...
> [6976-45.659]**** PGAPI_BindCol: stmt = 044D2F00, icol = 1
> [6976-45.659]**** : fCType=-2 rgb=00000000 valusMax=0 pcb=03623A84
> [6976-45.659]extend_getdata_info: entering ... self=044D3088, gdata_allocated=0, num_columns=1
> [6976-45.660]exit extend_gdata_info=044D79C8
> [6976-45.660][SQLNumResultCols][6976-45.660]PGAPI_NumResultCols: entering...
> [6976-45.660]SC_describe: status = 3
> [6976-45.660]PGAPI_NumResultCols: result = 04473E90, status = 3, numcols = 1
> [6976-45.661][[SQLGetDiagField]] Handle=(3,044D2F00) Rec=1 Id=12 info=(06C1FD2C,-6)
> [6976-45.661]PGAPI_GetDiagField entering rec=1[6976-45.661]PGAPI_GetDiagField exiting -1
> [6976-45.661][SQLDescribeCol][6976-45.661]PGAPI_DescribeCol: entering.1..
> [6976-45.661]PARSE: fieldtype=17, col_name='contents', column_size=-4
> [6976-45.661]describeCol: col 0 fieldname = 'contents'
> [6976-45.662]describeCol: col 0 fieldtype = 17
> [6976-45.662]describeCol: col 0 column_size = -4
> [6976-45.662]describeCol: col 0 *pfSqlType = -4
> [6976-45.662]describeCol: col 0  *pcbColDef = 0
> [6976-45.662]describeCol: col 0  *pibScale = 0
> [6976-45.662]describeCol: col 0  *pfNullable = 1
> [6976-45.663][SQLFreeStmt][6976-45.663]PGAPI_FreeStmt: entering...hstmt=044D2F00, fOption=2
> [6976-45.663]reset_a_column_binding: entering ... self=044D2F90, bindings_allocated=1, icol=1
> [6976-45.663][SQLRowCount][6976-45.663]PGAPI_RowCount: entering...
> [6976-45.663]RowCount=-1
> [6976-45.663][SQLBindCol][6976-45.664]PGAPI_BindCol: entering...
> [6976-45.664]**** PGAPI_BindCol: stmt = 044D2F00, icol = 1
> [6976-45.664]**** : fCType=-2 rgb=00000000 valusMax=0 pcb=03623A84
> [6976-45.664][[SQLFetch]][6976-45.664]PGAPI_ExtendedFetch: stmt=044D2F00 rowsetSize=1
> [6976-45.664]SQL_FETCH_NEXT: num_tuples=2147483647, currtuple=-1, rowst=-1
> [6976-45.665]PGAPI_ExtendedFetch: new currTuple = -1
> [6976-45.665]fetch_cursor=1, 04473E90->total_read=100
> [6976-45.665]QR_next_tuple: fetch_number < fcount: returning tuple 0, fcount = 100
> [6976-45.665]fetch: cols=1, lf=0, opts = 044D2F90, opts->bindings = 044D79A8, buffer[] = 00000000
> [6976-45.665][SQLGetData][6976-45.665]PGAPI_GetData: enter, stmt=044D2F00 icol=1
> [6976-45.666]  socket: value =
'\xff0a005446524d4142435f534b4c455049003010b825000054504630f10e5466726d4142435f736b6c6570690d66726d4142435f736b6c657069044c65667403b20203546f7003ea000743617074696f6e062d536b72626e696b20696e20646174756d206f6264656c616e65676120
> ...
> 20546f70203d203136320d0a2020656e640d0a656e640d0a'
> [6976-45.817]**** PGAPI_GetData: icol = 0, target_type = -2, field_type = 17, value =
'\xff0a005446524d4142435f534b4c455049003010b825000054504630f10e5466726d4142435f736b6c6570690d66726d4142435f736b6c657069044c65667403b20203546f7003ea000743617074696f6e062d536b72626e696b20696e20646174756d206f6264656c616e65676120
> ...
> 20546f70203d203136320d0a2020656e640d0a656e640d0a'
> [6976-45.968]copy_and_convert: field_type = 17, fctype = -2, value =
'\xff0a005446524d4142435f534b4c455049003010b825000054504630f10e5466726d4142435f736b6c6570690d66726d4142435f736b6c657069044c65667403b20203546f7003ea000743617074696f6e062d536b72626e696b20696e20646174756d206f6264656c616e65676120
> ...
> 20546f70203d203136320d0a2020656e640d0a656e640d0a', cbValueMax=32752
> [6976-46.123]convert_text_field_to_sql_c:field_type=17 type=-2
> [6976-46.123]convert_from_pgbinary: in=51120, out = 25560
> [6976-46.123]convert_from_pgbinary: in=51120, out = 25560
> [6976-46.124]DEFAULT: len = 25560, ptr = '��[6976-46.124]    SQL_C_BINARY, default: len = 25560, cbValueMax = 32752,
rgbValueBindRow= '��[6976-46.124]STATEMENT WARNING: func=PGAPI_GetData, desc='', errnum=-2, errmsg='The buffer was too
smallfor the GetData.' 
> [6976-46.125][SQLCancel][6976-46.125]PGAPI_Cancel: entering...
> [6736-54.703][SQLFreeStmt][6736-54.703]PGAPI_FreeStmt: entering...hstmt=044D2F00, fOption=0
> [6736-54.703]SC_recycle_statement: self= 044D2F00
> [6736-54.703]!!!refcnt 044DA020:1 -> 0
> [6736-54.703]SC_set_Result(44d2f00, 0)[6736-54.704]QResult: enter DESTRUCTOR
>
> -- Regards, Matej.



pgsql-odbc by date:

Previous
From: Mateusz Loskot
Date:
Subject: Re: [ODBC] New bug or regression between 9.6 releases 0410 and 0310
Next
From: "Inoue, Hiroshi"
Date:
Subject: Re: [ODBC] ODBC application works while libpq fails