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

Commitab1ead6

Browse files
author
Hiroshi Inoue
committed
1) Fix a bug about reporting varchar info thanks to Aceto.
2) Introcuced 3 drivers.3) The version is now 7.02.0001.
1 parent31e1793 commitab1ead6

File tree

6 files changed

+34
-25
lines changed

6 files changed

+34
-25
lines changed

‎src/interfaces/odbc/pgtypes.c

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ pgtype_to_name(StatementClass *stmt, Int4 type)
520520
staticInt2
521521
getNumericDecimalDigits(StatementClass*stmt,Int4type,intcol)
522522
{
523-
Int4atttypmod=-1;
523+
Int4atttypmod=-1,default_decimal_digits=6;
524524
QResultClass*result;
525525
ColumnInfoClass*flds;
526526

@@ -545,30 +545,35 @@ getNumericDecimalDigits(StatementClass *stmt, Int4 type, int col)
545545
returnflds->adtsize[col];
546546
}
547547
if (atttypmod<0)
548-
returnPG_NUMERIC_MAX_SCALE;
548+
returndefault_decimal_digits;
549549
}
550550
else
551551
atttypmod=QR_get_atttypmod(result,col);
552552
if (atttypmod>-1)
553553
return (atttypmod&0xffff);
554554
else
555-
return (QR_get_display_size(result,col) ?
556-
QR_get_display_size(result,col) :
557-
PG_NUMERIC_MAX_SCALE);
555+
{
556+
Int4dsp_size=QR_get_display_size(result,col);
557+
if (dsp_size <=0)
558+
returndefault_decimal_digits;
559+
if (dsp_size<5)
560+
dsp_size=5;
561+
returndsp_size;
562+
}
558563
}
559564

560565

561566
staticInt4
562567
getNumericColumnSize(StatementClass*stmt,Int4type,intcol)
563568
{
564-
Int4atttypmod=-1;
569+
Int4atttypmod=-1,max_column_size=PG_NUMERIC_MAX_PRECISION+PG_NUMERIC_MAX_SCALE,default_column_size=28;
565570
QResultClass*result;
566571
ColumnInfoClass*flds;
567572

568573
mylog("getNumericColumnSize: type=%d, col=%d\n",type,col);
569574

570575
if (col<0)
571-
returnPG_NUMERIC_MAX_PRECISION;
576+
returnmax_column_size;
572577

573578
result=SC_get_Curres(stmt);
574579

@@ -583,19 +588,25 @@ getNumericColumnSize(StatementClass *stmt, Int4 type, int col)
583588
{
584589
atttypmod=flds->atttypmod[col];
585590
if (atttypmod<0&&flds->adtsize[col]>0)
586-
returnflds->adtsize[col];
591+
return2*flds->adtsize[col];
587592
}
588593
if (atttypmod<0)
589-
returnPG_NUMERIC_MAX_PRECISION;
594+
returndefault_column_size;
590595
}
591596
else
592597
atttypmod=QR_get_atttypmod(result,col);
593598
if (atttypmod>-1)
594599
return (atttypmod >>16)&0xffff;
595600
else
596-
return (QR_get_display_size(result,col)>0 ?
597-
QR_get_display_size(result,col) :
598-
PG_NUMERIC_MAX_PRECISION);
601+
{
602+
Int4dsp_size=QR_get_display_size(result,col);
603+
if (dsp_size <=0)
604+
returndefault_column_size;
605+
dsp_size *=2;
606+
if (dsp_size<10)
607+
dsp_size=10;
608+
returndsp_size;
609+
}
599610
}
600611

601612

@@ -665,7 +676,7 @@ getCharColumnSize(StatementClass *stmt, Int4 type, int col, int handle_unknown_s
665676
p=QR_get_display_size(result,col);/* longest */
666677
attlen=QR_get_atttypmod(result,col);
667678
/* Size is unknown -- handle according to parameter */
668-
if (attlen>p)/* maybe the length is known */
679+
if (attlen >=p&&attlen>0)/* maybe the length is known */
669680
returnattlen;
670681

671682
/* The type is really unknown */

‎src/interfaces/odbc/psqlodbc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Comments:See "notice.txt" for copyright and license information.
77
*
8-
* $Id: psqlodbc.h,v 1.64 2002/04/10 08:18:53 inoue Exp $
8+
* $Id: psqlodbc.h,v 1.65 2002/04/15 02:46:00 inoue Exp $
99
*
1010
*/
1111

@@ -87,7 +87,7 @@ typedef UInt4 Oid;
8787
#defineDBMS_NAME"PostgreSQL"
8888
#endif/* ODBCVER */
8989

90-
#definePOSTGRESDRIVERVERSION"07.01.0011"
90+
#definePOSTGRESDRIVERVERSION"07.02.0001"
9191

9292
#ifdefWIN32
9393
#if (ODBCVER >=0x0300)

‎src/interfaces/odbc/psqlodbc.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,8 @@ END
366366
//
367367

368368
VS_VERSION_INFO VERSIONINFO
369-
FILEVERSION 7,1,0,11
370-
PRODUCTVERSION 7,1,0,11
369+
FILEVERSION 7,2,0,01
370+
PRODUCTVERSION 7,2,0,01
371371
FILEFLAGSMASK 0x3L
372372
#ifdef _DEBUG
373373
FILEFLAGS 0x1L
@@ -389,14 +389,14 @@ BEGIN
389389
VALUE "CompanyName", "Insight Distribution Systems\0"
390390
#endif
391391
VALUE "FileDescription", "PostgreSQL Driver\0"
392-
VALUE "FileVersion", " 07.01.0011\0"
392+
VALUE "FileVersion", " 07.02.0001\0"
393393
VALUE "InternalName", "psqlodbc\0"
394394
VALUE "LegalCopyright", "\0"
395395
VALUE "LegalTrademarks", "ODBC(TM) is a trademark of Microsoft Corporation. Microsoft� is a registered trademark of Microsoft Corporation. Windows(TM) is a trademark of Microsoft Corporation.\0"
396396
VALUE "OriginalFilename", "psqlodbc.dll\0"
397397
VALUE "PrivateBuild", "\0"
398398
VALUE "ProductName", "Microsoft Open Database Connectivity\0"
399-
VALUE "ProductVersion", " 07.01.0011\0"
399+
VALUE "ProductVersion", " 07.02.0001\0"
400400
VALUE "SpecialBuild", "\0"
401401
END
402402
END

‎src/interfaces/odbc/psqlodbc.reg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,3 @@ REGEDIT4
1414
"Setup"="PSQLODBC.DLL"
1515
"SQLLevel"="1"
1616
"UsageCount"=dword:00000001
17-

‎src/interfaces/odbc/psqlodbc30.reg

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ REGEDIT4
33
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI]
44

55
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers]
6-
"PostgreSQL30"="Installed"
6+
"PostgreSQL+ (Beta)"="Installed"
77

8-
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\PostgreSQL30]
8+
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\PostgreSQL+ (Beta)]
99
"APILevel"="1"
1010
"ConnectFunctions"="YYN"
1111
"Driver"="PSQLODBC30.DLL"
@@ -14,4 +14,3 @@ REGEDIT4
1414
"Setup"="PSQLODBC30.DLL"
1515
"SQLLevel"="1"
1616
"UsageCount"=dword:00000001
17-

‎src/interfaces/odbc/psqlodbc30w.reg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ REGEDIT4
33
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI]
44

55
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers]
6-
"PostgreSQL30W"="Installed"
6+
"PostgreSQL+ Unicode (Beta)"="Installed"
77

8-
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\PostgreSQL30W]
8+
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\PostgreSQL+ Unicode (Beta)]
99
"APILevel"="1"
1010
"ConnectFunctions"="YYN"
1111
"Driver"="PSQLODBC30W.DLL"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp