Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc0b27c4

Browse files
author
Hiroshi Inoue
committed
1) Fix a few bugs about SQLGetData()
reported by Mika Mantyla.2) Timestamp precision.3) Separate ODBC3.0 files.
1 parent0f450da commitc0b27c4

File tree

13 files changed

+428
-120
lines changed

13 files changed

+428
-120
lines changed

‎src/interfaces/odbc/bind.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,8 @@ create_empty_bindings(int num_columns)
424424
new_bindings[i].buffer=NULL;
425425
new_bindings[i].used=NULL;
426426
new_bindings[i].data_left=-1;
427+
new_bindings[i].ttlbuf=NULL;
428+
new_bindings[i].ttlbuflen=0;
427429
}
428430

429431
returnnew_bindings;

‎src/interfaces/odbc/bind.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ struct BindInfoClass_
2222
char*buffer;/* pointer to the buffer */
2323
Int4*used;/* used space in the buffer (for strings
2424
* not counting the '\0') */
25+
char*ttlbuf;/* to save the large result */
26+
Int4ttlbuflen;/* the buffer length */
2527
Int2returntype;/* kind of conversion to be applied when
2628
* returning (SQL_C_DEFAULT,
2729
* SQL_C_CHAR...) */

‎src/interfaces/odbc/columninfo.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*-------
1313
*/
1414

15+
#include"pgtypes.h"
1516
#include"columninfo.h"
1617

1718
#include"connection.h"
@@ -95,7 +96,16 @@ CI_read_fields(ColumnInfoClass *self, ConnectionClass *conn)
9596
new_atttypmod= (Int4)SOCK_get_int(sock,4);
9697

9798
/* Subtract the header length */
98-
new_atttypmod-=4;
99+
switch (new_adtid)
100+
{
101+
casePG_TYPE_DATETIME:
102+
casePG_TYPE_TIMESTAMP_NO_TMZONE:
103+
casePG_TYPE_TIME:
104+
casePG_TYPE_TIME_WITH_TMZONE:
105+
break;
106+
default:
107+
new_atttypmod-=4;
108+
}
99109
if (new_atttypmod<0)
100110
new_atttypmod=-1;
101111

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp