Commit c2f5d08c authored by Hiroshi Inoue's avatar Hiroshi Inoue

Fix a lot of compile errors on unix.

Fix '\\' handling for bytea type.
parent 18529514
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# GNUMakefile for psqlodbc (Postgres ODBC driver) # GNUMakefile for psqlodbc (Postgres ODBC driver)
# #
# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile,v 1.16 2001/05/11 01:46:33 momjian Exp $ # $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile,v 1.17 2001/08/21 05:21:09 inoue Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -21,7 +21,7 @@ override CPPFLAGS := -I$(srcdir) $(CPPFLAGS) -DHAVE_CONFIG_H -DODBCINSTDIR='"$(o ...@@ -21,7 +21,7 @@ override CPPFLAGS := -I$(srcdir) $(CPPFLAGS) -DHAVE_CONFIG_H -DODBCINSTDIR='"$(o
OBJS = info.o bind.o columninfo.o connection.o convert.o drvconn.o \ OBJS = info.o bind.o columninfo.o connection.o convert.o drvconn.o \
environ.o execute.o lobj.o misc.o options.o \ environ.o execute.o lobj.o misc.o options.o \
pgtypes.o psqlodbc.o qresult.o results.o socket.o parse.o statement.o \ pgtypes.o psqlodbc.o qresult.o results.o socket.o parse.o statement.o \
gpps.o tuple.o tuplelist.o dlg_specific.o $(OBJX) gpps.o tuple.o tuplelist.o dlg_specific.o odbcapi.o $(OBJX)
ifdef MULTIBYTE ifdef MULTIBYTE
OBJS += multibyte.o OBJS += multibyte.o
......
...@@ -1968,10 +1968,18 @@ convert_from_pgbinary(unsigned char *value, unsigned char *rgbValue, int cbValue ...@@ -1968,10 +1968,18 @@ convert_from_pgbinary(unsigned char *value, unsigned char *rgbValue, int cbValue
for (i = 0; i < ilen;) for (i = 0; i < ilen;)
{ {
if (value[i] == '\\') if (value[i] == '\\')
{
if (value[i + 1] == '\\')
{
rgbValue[o] = value[i];
i += 2;
}
else
{ {
rgbValue[o] = conv_from_octal(&value[i]); rgbValue[o] = conv_from_octal(&value[i]);
i += 4; i += 4;
} }
}
else else
rgbValue[o] = value[i++]; rgbValue[o] = value[i++];
mylog("convert_from_pgbinary: i=%d, rgbValue[%d] = %d, %c\n", i, o, rgbValue[o], rgbValue[o]); mylog("convert_from_pgbinary: i=%d, rgbValue[%d] = %d, %c\n", i, o, rgbValue[o], rgbValue[o]);
......
...@@ -682,7 +682,6 @@ PGAPI_GetInfo( ...@@ -682,7 +682,6 @@ PGAPI_GetInfo(
break; break;
default: default:
return PGAPI_GetInfo30(hdbc, fInfoType, rgbInfoValue, cbInfoValueMax,pcbInfoValue);
/* unrecognized key */ /* unrecognized key */
conn->errormsg = "Unrecognized key passed to PGAPI_GetInfo."; conn->errormsg = "Unrecognized key passed to PGAPI_GetInfo.";
conn->errornumber = CONN_NOT_IMPLEMENTED_ERROR; conn->errornumber = CONN_NOT_IMPLEMENTED_ERROR;
......
...@@ -26,7 +26,7 @@ typedef signed short RETCODE; ...@@ -26,7 +26,7 @@ typedef signed short RETCODE;
#define SQL_API EXPORT CALLBACK #define SQL_API EXPORT CALLBACK
#endif #endif
#define ODBCVER 0x0250 /*#define ODBCVER 0x0250 */
#define SQL_MAX_MESSAGE_LENGTH 512 #define SQL_MAX_MESSAGE_LENGTH 512
#define SQL_MAX_DSN_LENGTH 32 #define SQL_MAX_DSN_LENGTH 32
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -697,6 +697,9 @@ pgtype_length(StatementClass *stmt, Int4 type, int col, int handle_unknown_size_ ...@@ -697,6 +697,9 @@ pgtype_length(StatementClass *stmt, Int4 type, int col, int handle_unknown_size_
return 16; return 16;
/* Character types (and NUMERIC) use the default precision */ /* Character types (and NUMERIC) use the default precision */
case PG_TYPE_VARCHAR:
case PG_TYPE_BPCHAR:
return 2 * pgtype_precision(stmt, type, col, handle_unknown_size_as);
default: default:
return pgtype_precision(stmt, type, col, handle_unknown_size_as); return pgtype_precision(stmt, type, col, handle_unknown_size_as);
} }
......
...@@ -714,13 +714,15 @@ SC_fetch(StatementClass *self) ...@@ -714,13 +714,15 @@ SC_fetch(StatementClass *self)
static char *func = "SC_fetch"; static char *func = "SC_fetch";
QResultClass *res = self->result; QResultClass *res = self->result;
int retval, int retval,
result, updret; result;
#ifdef DRIVER_CURSOR_IMPLEMENT
int updret;
#endif /* DRIVER_CURSOR_IMPLEMENT */
Int2 num_cols, Int2 num_cols,
lf; lf;
Oid type; Oid type;
char *value; char *value;
ColumnInfoClass *ci; ColumnInfoClass *ci;
extern WORD addrow;
/* TupleField *tupleField; */ /* TupleField *tupleField; */
self->last_fetch_count = 0; self->last_fetch_count = 0;
......
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