Commit ab1ead6b authored by Hiroshi Inoue's avatar Hiroshi Inoue

1) Fix a bug about reporting varchar info thanks to Aceto.

2) Introcuced 3 drivers.
3) The version is now 7.02.0001.
parent 31e17937
...@@ -520,7 +520,7 @@ pgtype_to_name(StatementClass *stmt, Int4 type) ...@@ -520,7 +520,7 @@ pgtype_to_name(StatementClass *stmt, Int4 type)
static Int2 static Int2
getNumericDecimalDigits(StatementClass *stmt, Int4 type, int col) getNumericDecimalDigits(StatementClass *stmt, Int4 type, int col)
{ {
Int4 atttypmod = -1; Int4 atttypmod = -1, default_decimal_digits = 6;
QResultClass *result; QResultClass *result;
ColumnInfoClass *flds; ColumnInfoClass *flds;
...@@ -545,30 +545,35 @@ getNumericDecimalDigits(StatementClass *stmt, Int4 type, int col) ...@@ -545,30 +545,35 @@ getNumericDecimalDigits(StatementClass *stmt, Int4 type, int col)
return flds->adtsize[col]; return flds->adtsize[col];
} }
if (atttypmod < 0) if (atttypmod < 0)
return PG_NUMERIC_MAX_SCALE; return default_decimal_digits;
} }
else else
atttypmod = QR_get_atttypmod(result, col); atttypmod = QR_get_atttypmod(result, col);
if (atttypmod > -1) if (atttypmod > -1)
return (atttypmod & 0xffff); return (atttypmod & 0xffff);
else else
return (QR_get_display_size(result, col) ? {
QR_get_display_size(result, col) : Int4 dsp_size = QR_get_display_size(result, col);
PG_NUMERIC_MAX_SCALE); if (dsp_size <= 0)
return default_decimal_digits;
if (dsp_size < 5)
dsp_size = 5;
return dsp_size;
}
} }
static Int4 static Int4
getNumericColumnSize(StatementClass *stmt, Int4 type, int col) getNumericColumnSize(StatementClass *stmt, Int4 type, int col)
{ {
Int4 atttypmod = -1; Int4 atttypmod = -1, max_column_size = PG_NUMERIC_MAX_PRECISION + PG_NUMERIC_MAX_SCALE, default_column_size = 28;
QResultClass *result; QResultClass *result;
ColumnInfoClass *flds; ColumnInfoClass *flds;
mylog("getNumericColumnSize: type=%d, col=%d\n", type, col); mylog("getNumericColumnSize: type=%d, col=%d\n", type, col);
if (col < 0) if (col < 0)
return PG_NUMERIC_MAX_PRECISION; return max_column_size;
result = SC_get_Curres(stmt); result = SC_get_Curres(stmt);
...@@ -583,19 +588,25 @@ getNumericColumnSize(StatementClass *stmt, Int4 type, int col) ...@@ -583,19 +588,25 @@ getNumericColumnSize(StatementClass *stmt, Int4 type, int col)
{ {
atttypmod = flds->atttypmod[col]; atttypmod = flds->atttypmod[col];
if (atttypmod < 0 && flds->adtsize[col] > 0) if (atttypmod < 0 && flds->adtsize[col] > 0)
return flds->adtsize[col]; return 2 * flds->adtsize[col];
} }
if (atttypmod < 0) if (atttypmod < 0)
return PG_NUMERIC_MAX_PRECISION; return default_column_size;
} }
else else
atttypmod = QR_get_atttypmod(result, col); atttypmod = QR_get_atttypmod(result, col);
if (atttypmod > -1) if (atttypmod > -1)
return (atttypmod >> 16) & 0xffff; return (atttypmod >> 16) & 0xffff;
else else
return (QR_get_display_size(result, col) > 0 ? {
QR_get_display_size(result, col) : Int4 dsp_size = QR_get_display_size(result, col);
PG_NUMERIC_MAX_PRECISION); if (dsp_size <= 0)
return default_column_size;
dsp_size *= 2;
if (dsp_size < 10)
dsp_size = 10;
return dsp_size;
}
} }
...@@ -665,7 +676,7 @@ getCharColumnSize(StatementClass *stmt, Int4 type, int col, int handle_unknown_s ...@@ -665,7 +676,7 @@ getCharColumnSize(StatementClass *stmt, Int4 type, int col, int handle_unknown_s
p = QR_get_display_size(result, col); /* longest */ p = QR_get_display_size(result, col); /* longest */
attlen = QR_get_atttypmod(result, col); attlen = QR_get_atttypmod(result, col);
/* Size is unknown -- handle according to parameter */ /* Size is unknown -- handle according to parameter */
if (attlen > p) /* maybe the length is known */ if (attlen >= p && attlen > 0) /* maybe the length is known */
return attlen; return attlen;
/* The type is really unknown */ /* The type is really unknown */
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* *
* Comments: See "notice.txt" for copyright and license information. * Comments: See "notice.txt" for copyright and license information.
* *
* $Id: psqlodbc.h,v 1.64 2002/04/10 08:18:53 inoue Exp $ * $Id: psqlodbc.h,v 1.65 2002/04/15 02:46:00 inoue Exp $
* *
*/ */
...@@ -87,7 +87,7 @@ typedef UInt4 Oid; ...@@ -87,7 +87,7 @@ typedef UInt4 Oid;
#define DBMS_NAME "PostgreSQL" #define DBMS_NAME "PostgreSQL"
#endif /* ODBCVER */ #endif /* ODBCVER */
#define POSTGRESDRIVERVERSION "07.01.0011" #define POSTGRESDRIVERVERSION "07.02.0001"
#ifdef WIN32 #ifdef WIN32
#if (ODBCVER >= 0x0300) #if (ODBCVER >= 0x0300)
......
...@@ -366,8 +366,8 @@ END ...@@ -366,8 +366,8 @@ END
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 7,1,0,11 FILEVERSION 7,2,0,01
PRODUCTVERSION 7,1,0,11 PRODUCTVERSION 7,2,0,01
FILEFLAGSMASK 0x3L FILEFLAGSMASK 0x3L
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
...@@ -389,14 +389,14 @@ BEGIN ...@@ -389,14 +389,14 @@ BEGIN
VALUE "CompanyName", "Insight Distribution Systems\0" VALUE "CompanyName", "Insight Distribution Systems\0"
#endif #endif
VALUE "FileDescription", "PostgreSQL Driver\0" VALUE "FileDescription", "PostgreSQL Driver\0"
VALUE "FileVersion", " 07.01.0011\0" VALUE "FileVersion", " 07.02.0001\0"
VALUE "InternalName", "psqlodbc\0" VALUE "InternalName", "psqlodbc\0"
VALUE "LegalCopyright", "\0" VALUE "LegalCopyright", "\0"
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" 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"
VALUE "OriginalFilename", "psqlodbc.dll\0" VALUE "OriginalFilename", "psqlodbc.dll\0"
VALUE "PrivateBuild", "\0" VALUE "PrivateBuild", "\0"
VALUE "ProductName", "Microsoft Open Database Connectivity\0" VALUE "ProductName", "Microsoft Open Database Connectivity\0"
VALUE "ProductVersion", " 07.01.0011\0" VALUE "ProductVersion", " 07.02.0001\0"
VALUE "SpecialBuild", "\0" VALUE "SpecialBuild", "\0"
END END
END END
......
...@@ -14,4 +14,3 @@ REGEDIT4 ...@@ -14,4 +14,3 @@ REGEDIT4
"Setup"="PSQLODBC.DLL" "Setup"="PSQLODBC.DLL"
"SQLLevel"="1" "SQLLevel"="1"
"UsageCount"=dword:00000001 "UsageCount"=dword:00000001
...@@ -3,9 +3,9 @@ REGEDIT4 ...@@ -3,9 +3,9 @@ REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI] [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI]
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers] [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers]
"PostgreSQL30"="Installed" "PostgreSQL+ (Beta)"="Installed"
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\PostgreSQL30] [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\PostgreSQL+ (Beta)]
"APILevel"="1" "APILevel"="1"
"ConnectFunctions"="YYN" "ConnectFunctions"="YYN"
"Driver"="PSQLODBC30.DLL" "Driver"="PSQLODBC30.DLL"
...@@ -14,4 +14,3 @@ REGEDIT4 ...@@ -14,4 +14,3 @@ REGEDIT4
"Setup"="PSQLODBC30.DLL" "Setup"="PSQLODBC30.DLL"
"SQLLevel"="1" "SQLLevel"="1"
"UsageCount"=dword:00000001 "UsageCount"=dword:00000001
...@@ -3,9 +3,9 @@ REGEDIT4 ...@@ -3,9 +3,9 @@ REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI] [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI]
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers] [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers]
"PostgreSQL30W"="Installed" "PostgreSQL+ Unicode (Beta)"="Installed"
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\PostgreSQL30W] [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\PostgreSQL+ Unicode (Beta)]
"APILevel"="1" "APILevel"="1"
"ConnectFunctions"="YYN" "ConnectFunctions"="YYN"
"Driver"="PSQLODBC30W.DLL" "Driver"="PSQLODBC30W.DLL"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment