pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feed[BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows.
6+ messages / 3 participants
[nested] [flat]
* [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows.
@ 2015-09-16 02:20 Naoya Anzai <nao-anzai@xc.jp.nec.com>
2015-09-22 07:55 ` Re: [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows. Heikki Linnakangas <hlinnaka@iki.fi>
0 siblings, 1 reply; 6+ messages in thread
From: Naoya Anzai @ 2015-09-16 02:20 UTC (permalink / raw)
To: pgsql-odbc; +Cc: Akio Iwaasa <aki-iwaasa@vt.jp.nec.com>
Hi,
I found a bug which psqlODBC returns a string without null-terminated when SQLFetch is executed on Windows.
IMHO, it seems to be caused by differences of snprintf function between Windows and Linux.
You have changed sprintf into snprintf at psqlodbc-09.03.0400 release.
But snprintf on Windows(_snprintf) doesn't include a terminating character(\0) when a copy buffer length is less than an original buffer length; besides this returns -1.
Their behavior are different from that of Linux but psqlODBC does not currently make allowances for their differences.
As you can confirm this bug, I attached a program(test.cpp) which reproduces a bug.
This result is following.
----
Please Enter key...
SQLAllocHandle() OK
SQLAllocHandle() ok
SQLConnect ok
data-length=24
length=-1 //invalid length
2015-09-15 17:48:44.7300フフフフフフフフフフフフフフフフ・ //unterminated string
no data
---
To fix this behavior, copy_and_convert_field function and stime2timestamp function need to repair at least.
I tried to fix it up and attached a patch on this mail.
Could you confirm this?
Best Regards
---
Naoya Anzai
Engineering Department
NEC Solution Inovetors, Ltd.
E-Mail: nao-anzai@xc.jp.nec.com
---
--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
Attachments:
convert.bugfix.patch (application/octet-stream, 3.0K) download
--- C:/Users/1134140140301/Documents/WorkingDir/work/API/psqlodbc-09.03.0400/convert.c Sun Oct 26 15:08:36 2014
+++ C:/Users/1134140140301/Documents/WorkingDir/work/psqlODBC/psqlodbc-09.03.0400/convert.c Tue Sep 15 17:30:23 2015
@@ -349,7 +349,9 @@
{
char precstr[16],
zonestr[16];
- int i;
+ int i,
+ len,
+ origlen;
precstr[0] = '\0';
if (st->infinity > 0)
@@ -402,10 +404,31 @@
snprintf(zonestr, sizeof(zonestr), "+%02d", -(int) zoneint / 3600);
}
#endif /* TIMEZONE_GLOBAL */
+#ifdef WIN32
+ origlen = 19 + strlen(precstr) + strlen(zonestr); // "YYYY-MM-DD HH:MM:SS" + precision + timezone
+#endif /* WIN32 */
if (st->y < 0)
- return snprintf(str, bufsize, "%.4d-%.2d-%.2d %.2d:%.2d:%.2d%s%s BC", -st->y, st->m, st->d, st->hh, st->mm, st->ss, precstr, zonestr);
+ {
+#ifdef WIN32
+ origlen += 3; //add length of " BC"
+#endif /* WIN32 */
+ len = snprintf(str, bufsize, "%.4d-%.2d-%.2d %.2d:%.2d:%.2d%s%s BC", -st->y, st->m, st->d, st->hh, st->mm, st->ss, precstr, zonestr);
+ }
else
- return snprintf(str, bufsize, "%.4d-%.2d-%.2d %.2d:%.2d:%.2d%s%s", st->y, st->m, st->d, st->hh, st->mm, st->ss, precstr, zonestr);
+ {
+ len = snprintf(str, bufsize, "%.4d-%.2d-%.2d %.2d:%.2d:%.2d%s%s", st->y, st->m, st->d, st->hh, st->mm, st->ss, precstr, zonestr);
+ }
+#ifdef WIN32
+ if(len < 0 || len == origlen){
+ /*
+ * In Windows, str may not include terminated string.
+ * so we need to add terminated string.
+ */
+ str[bufsize-1] = '\0';
+ len = origlen;
+ }
+#endif /* WIN32 */
+ return len;
}
#if (ODBCVER >= 0x0300)
@@ -1175,12 +1198,24 @@
{
case PG_TYPE_DATE:
len = snprintf(rgbValueBindRow, cbValueMax, "%.4d-%.2d-%.2d", std_time.y, std_time.m, std_time.d);
+#ifdef WIN32
+ if(len < 0 || len == 10){
+ rgbValueBindRow[cbValueMax-1]='\0';
+ len = 10;
+ }
+#endif /* WIN32 */
if (len + 1 > cbValueMax)
result = COPY_RESULT_TRUNCATED;
break;
case PG_TYPE_TIME:
len = snprintf(rgbValueBindRow, cbValueMax, "%.2d:%.2d:%.2d", std_time.hh, std_time.mm, std_time.ss);
+#ifdef WIN32
+ if(len < 0 || len == 8){
+ rgbValueBindRow[cbValueMax-1]='\0';
+ len = 8;
+ }
+#endif /* WIN32 */
if (len + 1 > cbValueMax)
result = COPY_RESULT_TRUNCATED;
break;
@@ -1192,13 +1227,19 @@
/* sprintf(rgbValueBindRow, "%.4d-%.2d-%.2d %.2d:%.2d:%.2d",
std_time.y, std_time.m, std_time.d, std_time.hh, std_time.mm, std_time.ss); */
len = stime2timestamp(&std_time, rgbValueBindRow, cbValueMax, FALSE,
- PG_VERSION_GE(conn, 7.2) ? (int) cbValueMax - len - 2 : 0);
+ PG_VERSION_GE(conn, 7.2) ? 6 : 0);
if (len + 1 > cbValueMax)
result = COPY_RESULT_TRUNCATED;
break;
case PG_TYPE_BOOL:
len = snprintf(rgbValueBindRow, cbValueMax, "%s", neut_str);
+#ifdef WIN32
+ if(len < 0 || len == strlen(neut_str)){
+ rgbValueBindRow[cbValueMax-1]='\0';
+ len = strlen(neut_str);
+ }
+#endif /* WIN32 */
if (len + 1 > cbValueMax)
result = COPY_RESULT_TRUNCATED;
mylog("PG_TYPE_BOOL: rgbValueBindRow = '%s'\n", rgbValueBindRow);
test.cpp (text/plain, 2.3K) download
#include <windows.h>
#include <stdio.h>
#include <odbcinst.h>
#include <sql.h>
#include <sqlext.h>
#include <windows.h>
#include <string>
#include <sqltypes.h>
#include <iostream>
SQLCHAR sqlstate[25];
SQLCHAR message[255];
SQLINTEGER native_error;
int main()
{
std::string s1;
SQLHENV henv = SQL_NULL_HENV;
SQLHDBC hdbc;
SQLHSTMT hstmt = SQL_NULL_HSTMT;
RETCODE rc = SQL_SUCCESS;
char szDr[64];
std::string strDriver="DSN=PostgreSQL35W";
strcpy_s(szDr,strDriver.c_str());
char szCnOut[512];
SWORD swStrLen;
printf("Please Enter key...\n");
getchar();
rc = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &henv);
if (rc != SQL_ERROR)
{
printf("SQLAllocHandle() OK\n");
if(!SQL_SUCCEEDED(SQLSetEnvAttr(henv,SQL_ATTR_ODBC_VERSION,(SQLPOINTER)SQL_OV_ODBC3,SQL_IS_INTEGER)))
printf("SQLSetEnvAttr/SQL_ATTR_ODBC_VERSION error\n");
rc = SQLAllocHandle (SQL_HANDLE_DBC, henv, &hdbc);
printf("SQLAllocHandle() ok\n");
rc = SQLDriverConnect(hdbc,NULL,(SQLTCHAR*)szDr,(SQLSMALLINT)strlen(szDr),(SQLTCHAR*)szCnOut,512,&swStrLen,SQL_DRIVER_NOPROMPT);
if (rc != SQL_SUCCESS){
printf("connect failed\n");
}
printf("SQLConnect ok\n");
SQLLEN length;
char data[24]; //data buffer
LPSTR sql = "SELECT now()::timestamp(3)";
SQLAllocHandle(SQL_HANDLE_STMT,hdbc,&hstmt);
rc = SQLPrepare(hstmt,(SQLCHAR *)sql,SQL_NTS);
rc = SQLBindCol(hstmt,1,SQL_C_CHAR,data,sizeof(data),&length);
rc = SQLExecute(hstmt);
if(rc == SQL_SUCCESS)
{
printf("data-length=%d\n",sizeof(data));
if(rc != SQL_SUCCESS)
{
printf("SQLBindCol() failed\n");
}
for(int i=0; ; i++)
{
rc = SQLFetch(hstmt);
if(rc == SQL_NO_DATA)
{
printf("no data\n");
break;
}
if(rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO)
{
printf("SQLFetch() failed\n");
break;
}
if(rc == SQL_SUCCESS_WITH_INFO)
{
SQLGetDiagRec(SQL_HANDLE_STMT, hstmt, 1, sqlstate, &native_error, message, 255, nullptr);
printf("SQLSTATE=%s MESSAGE=%s\n",sqlstate,message);
}
printf("length=%d\n",length);
printf("%s\n",data); //display data.
}
}
::SQLCloseCursor(hstmt);
rc = SQLDisconnect(hdbc);
SQLFreeHandle(SQL_HANDLE_DBC,hdbc);
SQLFreeHandle(SQL_HANDLE_ENV,henv);
}
return 0;
}
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows.
2015-09-16 02:20 [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows. Naoya Anzai <nao-anzai@xc.jp.nec.com>
@ 2015-09-22 07:55 ` Heikki Linnakangas <hlinnaka@iki.fi>
2015-09-24 01:02 ` Re: [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows. Naoya Anzai <nao-anzai@xc.jp.nec.com>
0 siblings, 1 reply; 6+ messages in thread
From: Heikki Linnakangas @ 2015-09-22 07:55 UTC (permalink / raw)
To: Naoya Anzai <nao-anzai@xc.jp.nec.com>; pgsql-odbc; +Cc: Akio Iwaasa <aki-iwaasa@vt.jp.nec.com>
On 09/16/2015 05:20 AM, Naoya Anzai wrote:
> Hi,
>
> I found a bug which psqlODBC returns a string without null-terminated when SQLFetch is executed on Windows.
> IMHO, it seems to be caused by differences of snprintf function between Windows and Linux.
> You have changed sprintf into snprintf at psqlodbc-09.03.0400 release.
> But snprintf on Windows(_snprintf) doesn't include a terminating character(\0) when a copy buffer length is less than an original buffer length; besides this returns -1.
> Their behavior are different from that of Linux but psqlODBC does not currently make allowances for their differences.
>
> As you can confirm this bug, I attached a program(test.cpp) which reproduces a bug.
Yep. This was already fixed in git master in January, in commit
532c0dad20087201feee3851652c114eb820311f.
We're long overdue for a release...
- Heikki
--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows.
2015-09-16 02:20 [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows. Naoya Anzai <nao-anzai@xc.jp.nec.com>
2015-09-22 07:55 ` Re: [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows. Heikki Linnakangas <hlinnaka@iki.fi>
@ 2015-09-24 01:02 ` Naoya Anzai <nao-anzai@xc.jp.nec.com>
2015-11-04 03:53 ` Re: [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows. Naoya Anzai <nao-anzai@xc.jp.nec.com>
0 siblings, 1 reply; 6+ messages in thread
From: Naoya Anzai @ 2015-09-24 01:02 UTC (permalink / raw)
To: Heikki Linnakangas <hlinnaka@iki.fi>; pgsql-odbc; +Cc: Akio Iwaasa <aki-iwaasa@vt.jp.nec.com>
> Yep. This was already fixed in git master in January, in commit
> 532c0dad20087201feee3851652c114eb820311f.
Thank you!
I confirmed psql-odbc master is already fixed this bug.
While you are at it, could you fix a precision argument passed to stime2timestamp?
inline patch 1: C:/work/psqlodbc-a2def3d/convert.c (+1/-2 lines) download inline-1.patch
--- C:/work/psqlodbc-a2def3d/convert.c.orig Wed Sep 23 16:14:10 2015
+++ C:/work/psqlodbc-a2def3d/convert.c Thu Sep 24 09:01:50 2015
@@ -1247,8 +1247,7 @@
case PG_TYPE_TIMESTAMP:
/* sprintf(rgbValueBindRow, "%.4d-%.2d-%.2d %.2d:%.2d:%.2d",
std_time.y, std_time.m, std_time.d, std_time.hh, std_time.mm, std_time.ss); */
- len = stime2timestamp(&std_time, rgbValueBindRow, cbValueMax, FALSE,
- (int) (cbValueMax - len - 2) );
+ len = stime2timestamp(&std_time, rgbValueBindRow, cbValueMax, FALSE, 6 );
if (len + 1 > cbValueMax)
result = COPY_RESULT_TRUNCATED;
break;
In PostgreSQL, I think max number of digits of precision is always 6.
I hope to be able to use next release as soon as possible.
Regards,
Naoya
---
Naoya Anzai
Engineering Department
NEC Solution Inovetors, Ltd.
E-Mail: nao-anzai@xc.jp.nec.com
---
--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows.
2015-09-16 02:20 [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows. Naoya Anzai <nao-anzai@xc.jp.nec.com>
2015-09-22 07:55 ` Re: [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows. Heikki Linnakangas <hlinnaka@iki.fi>
2015-09-24 01:02 ` Re: [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows. Naoya Anzai <nao-anzai@xc.jp.nec.com>
@ 2015-11-04 03:53 ` Naoya Anzai <nao-anzai@xc.jp.nec.com>
2015-11-04 14:09 ` Re: [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows. Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
0 siblings, 1 reply; 6+ messages in thread
From: Naoya Anzai @ 2015-11-04 03:53 UTC (permalink / raw)
To: Heikki Linnakangas <hlinnaka@iki.fi>; pgsql-odbc; +Cc: Hiroshi Yanagisawa <hir-yanagisawa@ut.jp.nec.com>
Hi, psqlodbc commiters.
> --- C:/work/psqlodbc-a2def3d/convert.c.orig Wed Sep 23 16:14:10 2015
> +++ C:/work/psqlodbc-a2def3d/convert.c Thu Sep 24 09:01:50 2015
> @@ -1247,8 +1247,7 @@
> case PG_TYPE_TIMESTAMP:
> /* sprintf(rgbValueBindRow, "%.4d-%.2d-%.2d %.2d:%.2d:%.2d",
> std_time.y, std_time.m, std_time.d, std_time.hh, std_time.mm, std_time.ss);
> */
> - len = stime2timestamp(&std_time, rgbValueBindRow, cbValueMax, FALSE,
> - (int) (cbValueMax - len - 2) );
> + len = stime2timestamp(&std_time, rgbValueBindRow, cbValueMax, FALSE, 6 );
> if (len + 1 > cbValueMax)
> result = COPY_RESULT_TRUNCATED;
> break;
>
> In PostgreSQL, I think max number of digits of precision is always 6.
Could someone confirm this?
I think this is a tiny bug..
Best Regards,
---
Naoya Anzai
Engineering Department
NEC Solution Inovetors, Ltd.
E-Mail: nao-anzai@xc.jp.nec.com
---
--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows.
2015-09-16 02:20 [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows. Naoya Anzai <nao-anzai@xc.jp.nec.com>
2015-09-22 07:55 ` Re: [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows. Heikki Linnakangas <hlinnaka@iki.fi>
2015-09-24 01:02 ` Re: [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows. Naoya Anzai <nao-anzai@xc.jp.nec.com>
2015-11-04 03:53 ` Re: [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows. Naoya Anzai <nao-anzai@xc.jp.nec.com>
@ 2015-11-04 14:09 ` Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
2015-11-11 03:49 ` Re: [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows. Naoya Anzai <nao-anzai@xc.jp.nec.com>
0 siblings, 1 reply; 6+ messages in thread
From: Inoue, Hiroshi @ 2015-11-04 14:09 UTC (permalink / raw)
To: Naoya Anzai <nao-anzai@xc.jp.nec.com>; +Cc: Heikki Linnakangas <hlinnaka@iki.fi>; pgsql-odbc; Hiroshi Yanagisawa <hir-yanagisawa@ut.jp.nec.com>
Hi,
Oops it was my mistake.
I would take care of it.
BTW why is the last parameter 6?
regards,
Hiroshi Inoue
On 2015/11/04 12:53, Naoya Anzai wrote
> Hi, psqlodbc commiters.
>
>> --- C:/work/psqlodbc-a2def3d/convert.c.orig Wed Sep 23 16:14:10 2015
>> +++ C:/work/psqlodbc-a2def3d/convert.c Thu Sep 24 09:01:50 2015
>> @@ -1247,8 +1247,7 @@
>> case PG_TYPE_TIMESTAMP:
>> /* sprintf(rgbValueBindRow, "%.4d-%.2d-%.2d %.2d:%.2d:%.2d",
>> std_time.y, std_time.m, std_time.d, std_time.hh, std_time.mm, std_time.ss);
>> */
>> - len = stime2timestamp(&std_time, rgbValueBindRow, cbValueMax, FALSE,
>> - (int) (cbValueMax - len - 2) );
>> + len = stime2timestamp(&std_time, rgbValueBindRow, cbValueMax, FALSE, 6 );
>> if (len + 1 > cbValueMax)
>> result = COPY_RESULT_TRUNCATED;
>> break;
>>
>> In PostgreSQL, I think max number of digits of precision is always 6.
> Could someone confirm this?
> I think this is a tiny bug..
>
> Best Regards,
>
> ---
> Naoya Anzai
> Engineering Department
> NEC Solution Inovetors, Ltd.
> E-Mail: nao-anzai@xc.jp.nec.com
--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows.
2015-09-16 02:20 [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows. Naoya Anzai <nao-anzai@xc.jp.nec.com>
2015-09-22 07:55 ` Re: [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows. Heikki Linnakangas <hlinnaka@iki.fi>
2015-09-24 01:02 ` Re: [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows. Naoya Anzai <nao-anzai@xc.jp.nec.com>
2015-11-04 03:53 ` Re: [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows. Naoya Anzai <nao-anzai@xc.jp.nec.com>
2015-11-04 14:09 ` Re: [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows. Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
@ 2015-11-11 03:49 ` Naoya Anzai <nao-anzai@xc.jp.nec.com>
0 siblings, 0 replies; 6+ messages in thread
From: Naoya Anzai @ 2015-11-11 03:49 UTC (permalink / raw)
To: Inoue, Hiroshi <h-inoue@dream.email.ne.jp>; +Cc: pgsql-odbc; Hiroshi Yanagisawa <hir-yanagisawa@ut.jp.nec.com>
Inoue-san
> Oops it was my mistake.
> I would take care of it.
> BTW why is the last parameter 6?
MAX_TIMESTAMP_PRECISION(a macro in timestamp.h(PostgreSQL)) is always 6.
--- src/include/utils/timestamp.h
#define MAX_TIMESTAMP_PRECISION 6
---
I have confirmed that this specification is not changed from PostgreSQL7.3.
MAX_TIME_PRECISION can be changed 6 to 10 with --disable-integer-datetimes,
but this precision is used by TIME data type only.
---
[naoya@nesitcspg03 ~]$ psql
psql (9.5beta1)
Type "help" for help.
[local] 32289 naoya=# select '2015-11-11 11:11:11.123456789'::time(10);
time
--------------------
11:11:11.123456789
(1 row)
[local] 32289 naoya=# select '2015-11-11 11:11:11.123456789'::time(10) with time zone;
timetz
-----------------------
11:11:11.123456789+09
(1 row)
[local] 32289 naoya=# select '2015-11-11 11:11:11.123456789'::timestamp(10);
WARNING: TIMESTAMP(10) precision reduced to maximum allowed, 6 at character 41
WARNING: TIMESTAMP(10) precision reduced to maximum allowed, 6
LINE 1: select '2015-11-11 11:11:11.123456789'::timestamp(10);
^
timestamp
----------------------------
2015-11-11 11:11:11.123457
(1 row)
[local] 32289 naoya=# select '2015-11-11 11:11:11.123456789'::timestamp(10) with time zone;
WARNING: TIMESTAMP(10) WITH TIME ZONE precision reduced to maximum allowed, 6 at character 41
WARNING: TIMESTAMP(10) WITH TIME ZONE precision reduced to maximum allowed, 6
LINE 1: select '2015-11-11 11:11:11.123456789'::timestamp(10) with t...
^
timestamptz
-------------------------------
2015-11-11 11:11:11.123457+09
(1 row)
[local] 32289 naoya=# select '11.123456789'::interval(10);
WARNING: INTERVAL(10) precision reduced to maximum allowed, 6 at character 24
WARNING: INTERVAL(10) precision reduced to maximum allowed, 6
LINE 1: select '11.123456789'::interval(10);
^
interval
-----------------
00:00:11.123457
(1 row)
---
> >> --- C:/work/psqlodbc-a2def3d/convert.c.orig Wed Sep 23 16:14:10 2015
> >> +++ C:/work/psqlodbc-a2def3d/convert.c Thu Sep 24 09:01:50 2015
> >> @@ -1247,8 +1247,7 @@
> >> case PG_TYPE_TIMESTAMP:
> >> /* sprintf(rgbValueBindRow, "%.4d-%.2d-%.2d %.2d:%.2d:%.2d",
> >> std_time.y, std_time.m, std_time.d, std_time.hh, std_time.mm, std_time.ss);
> >> */
> >> - len = stime2timestamp(&std_time, rgbValueBindRow, cbValueMax, FALSE,
> >> - (int) (cbValueMax - len - 2) );
> >> + len = stime2timestamp(&std_time, rgbValueBindRow, cbValueMax, FALSE, 6 );
> >> if (len + 1 > cbValueMax)
> >> result = COPY_RESULT_TRUNCATED;
> >> break;
Regards,
Naoya
---
Naoya Anzai
Engineering Department
NEC Solution Inovetors, Ltd.
E-Mail: nao-anzai@xc.jp.nec.com
---
--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2015-11-11 03:49 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-09-16 02:20 [BUGS] There is a case in which psqlodbc-09.03.0400 returns unterminated strings on Windows. Naoya Anzai <nao-anzai@xc.jp.nec.com>
2015-09-22 07:55 ` Heikki Linnakangas <hlinnaka@iki.fi>
2015-09-24 01:02 ` Naoya Anzai <nao-anzai@xc.jp.nec.com>
2015-11-04 03:53 ` Naoya Anzai <nao-anzai@xc.jp.nec.com>
2015-11-04 14:09 ` Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
2015-11-11 03:49 ` Naoya Anzai <nao-anzai@xc.jp.nec.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox