mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
1) Fix a bug about reporting varchar info thanks to Aceto.
2) Introcuced 3 drivers. 3) The version is now 7.02.0001.
This commit is contained in:
@ -520,7 +520,7 @@ pgtype_to_name(StatementClass *stmt, Int4 type)
|
||||
static Int2
|
||||
getNumericDecimalDigits(StatementClass *stmt, Int4 type, int col)
|
||||
{
|
||||
Int4 atttypmod = -1;
|
||||
Int4 atttypmod = -1, default_decimal_digits = 6;
|
||||
QResultClass *result;
|
||||
ColumnInfoClass *flds;
|
||||
|
||||
@ -545,30 +545,35 @@ getNumericDecimalDigits(StatementClass *stmt, Int4 type, int col)
|
||||
return flds->adtsize[col];
|
||||
}
|
||||
if (atttypmod < 0)
|
||||
return PG_NUMERIC_MAX_SCALE;
|
||||
return default_decimal_digits;
|
||||
}
|
||||
else
|
||||
atttypmod = QR_get_atttypmod(result, col);
|
||||
if (atttypmod > -1)
|
||||
return (atttypmod & 0xffff);
|
||||
else
|
||||
return (QR_get_display_size(result, col) ?
|
||||
QR_get_display_size(result, col) :
|
||||
PG_NUMERIC_MAX_SCALE);
|
||||
{
|
||||
Int4 dsp_size = QR_get_display_size(result, col);
|
||||
if (dsp_size <= 0)
|
||||
return default_decimal_digits;
|
||||
if (dsp_size < 5)
|
||||
dsp_size = 5;
|
||||
return dsp_size;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static Int4
|
||||
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;
|
||||
ColumnInfoClass *flds;
|
||||
|
||||
mylog("getNumericColumnSize: type=%d, col=%d\n", type, col);
|
||||
|
||||
if (col < 0)
|
||||
return PG_NUMERIC_MAX_PRECISION;
|
||||
return max_column_size;
|
||||
|
||||
result = SC_get_Curres(stmt);
|
||||
|
||||
@ -583,19 +588,25 @@ getNumericColumnSize(StatementClass *stmt, Int4 type, int col)
|
||||
{
|
||||
atttypmod = flds->atttypmod[col];
|
||||
if (atttypmod < 0 && flds->adtsize[col] > 0)
|
||||
return flds->adtsize[col];
|
||||
return 2 * flds->adtsize[col];
|
||||
}
|
||||
if (atttypmod < 0)
|
||||
return PG_NUMERIC_MAX_PRECISION;
|
||||
return default_column_size;
|
||||
}
|
||||
else
|
||||
atttypmod = QR_get_atttypmod(result, col);
|
||||
if (atttypmod > -1)
|
||||
return (atttypmod >> 16) & 0xffff;
|
||||
else
|
||||
return (QR_get_display_size(result, col) > 0 ?
|
||||
QR_get_display_size(result, col) :
|
||||
PG_NUMERIC_MAX_PRECISION);
|
||||
{
|
||||
Int4 dsp_size = QR_get_display_size(result, col);
|
||||
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
|
||||
p = QR_get_display_size(result, col); /* longest */
|
||||
attlen = QR_get_atttypmod(result, col);
|
||||
/* 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;
|
||||
|
||||
/* The type is really unknown */
|
||||
|
@ -5,7 +5,7 @@
|
||||
*
|
||||
* 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;
|
||||
#define DBMS_NAME "PostgreSQL"
|
||||
#endif /* ODBCVER */
|
||||
|
||||
#define POSTGRESDRIVERVERSION "07.01.0011"
|
||||
#define POSTGRESDRIVERVERSION "07.02.0001"
|
||||
|
||||
#ifdef WIN32
|
||||
#if (ODBCVER >= 0x0300)
|
||||
|
@ -366,8 +366,8 @@ END
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 7,1,0,11
|
||||
PRODUCTVERSION 7,1,0,11
|
||||
FILEVERSION 7,2,0,01
|
||||
PRODUCTVERSION 7,2,0,01
|
||||
FILEFLAGSMASK 0x3L
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@ -389,14 +389,14 @@ BEGIN
|
||||
VALUE "CompanyName", "Insight Distribution Systems\0"
|
||||
#endif
|
||||
VALUE "FileDescription", "PostgreSQL Driver\0"
|
||||
VALUE "FileVersion", " 07.01.0011\0"
|
||||
VALUE "FileVersion", " 07.02.0001\0"
|
||||
VALUE "InternalName", "psqlodbc\0"
|
||||
VALUE "LegalCopyright", "\0"
|
||||
VALUE "LegalTrademarks", "ODBC(TM) is a trademark of Microsoft Corporation. Microsoft<66> is a registered trademark of Microsoft Corporation. Windows(TM) is a trademark of Microsoft Corporation.\0"
|
||||
VALUE "OriginalFilename", "psqlodbc.dll\0"
|
||||
VALUE "PrivateBuild", "\0"
|
||||
VALUE "ProductName", "Microsoft Open Database Connectivity\0"
|
||||
VALUE "ProductVersion", " 07.01.0011\0"
|
||||
VALUE "ProductVersion", " 07.02.0001\0"
|
||||
VALUE "SpecialBuild", "\0"
|
||||
END
|
||||
END
|
||||
|
@ -14,4 +14,3 @@ REGEDIT4
|
||||
"Setup"="PSQLODBC.DLL"
|
||||
"SQLLevel"="1"
|
||||
"UsageCount"=dword:00000001
|
||||
|
||||
|
@ -3,9 +3,9 @@ REGEDIT4
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI]
|
||||
|
||||
[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"
|
||||
"ConnectFunctions"="YYN"
|
||||
"Driver"="PSQLODBC30.DLL"
|
||||
@ -14,4 +14,3 @@ REGEDIT4
|
||||
"Setup"="PSQLODBC30.DLL"
|
||||
"SQLLevel"="1"
|
||||
"UsageCount"=dword:00000001
|
||||
|
||||
|
@ -3,9 +3,9 @@ REGEDIT4
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI]
|
||||
|
||||
[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"
|
||||
"ConnectFunctions"="YYN"
|
||||
"Driver"="PSQLODBC30W.DLL"
|
||||
|
Reference in New Issue
Block a user