diff -cr psqlodbc-orig/info.c psqlodbc/info.c
*** psqlodbc-orig/info.c	Wed Jan 24 17:10:55 2001
--- psqlodbc/info.c	Wed Jan 24 22:29:13 2001
***************
*** 350,356 ****
      case SQL_MAX_STATEMENT_LEN: /* ODBC 2.0 */
          /* maybe this should be 0? */
  		len = 4;
!         value = MAX_QUERY_SIZE;
          break;
  
      case SQL_MAX_TABLE_NAME_LEN: /* ODBC 1.0 */
--- 350,356 ----
      case SQL_MAX_STATEMENT_LEN: /* ODBC 2.0 */
          /* maybe this should be 0? */
  		len = 4;
!         value = MAX_STATEMENT_LEN;
          break;
  
      case SQL_MAX_TABLE_NAME_LEN: /* ODBC 1.0 */
***************
*** 916,922 ****
  HSTMT htbl_stmt;
  RETCODE result;
  char *tableType;
! char tables_query[MAX_STATEMENT_LEN];
  char table_name[MAX_INFO_STRING], table_owner[MAX_INFO_STRING], relhasrules[MAX_INFO_STRING];
  ConnInfo *ci;
  char *prefix[32], prefixes[MEDIUM_REGISTRY_LEN];
--- 916,922 ----
  HSTMT htbl_stmt;
  RETCODE result;
  char *tableType;
! char tables_query[STD_STATEMENT_LEN];
  char table_name[MAX_INFO_STRING], table_owner[MAX_INFO_STRING], relhasrules[MAX_INFO_STRING];
  ConnInfo *ci;
  char *prefix[32], prefixes[MEDIUM_REGISTRY_LEN];
***************
*** 1186,1192 ****
  TupleNode *row;
  HSTMT hcol_stmt;
  StatementClass *col_stmt;
! char columns_query[MAX_STATEMENT_LEN];
  RETCODE result;
  char table_owner[MAX_INFO_STRING], table_name[MAX_INFO_STRING], field_name[MAX_INFO_STRING], field_type_name[MAX_INFO_STRING];
  Int2 field_number, result_cols, scale;
--- 1186,1192 ----
  TupleNode *row;
  HSTMT hcol_stmt;
  StatementClass *col_stmt;
! char columns_query[STD_STATEMENT_LEN];
  RETCODE result;
  char table_owner[MAX_INFO_STRING], table_name[MAX_INFO_STRING], field_name[MAX_INFO_STRING], field_type_name[MAX_INFO_STRING];
  Int2 field_number, result_cols, scale;
***************
*** 1583,1589 ****
  ConnInfo *ci;
  HSTMT hcol_stmt;
  StatementClass *col_stmt;
! char columns_query[MAX_STATEMENT_LEN];
  RETCODE result;
  char relhasrules[MAX_INFO_STRING];
  
--- 1583,1589 ----
  ConnInfo *ci;
  HSTMT hcol_stmt;
  StatementClass *col_stmt;
! char columns_query[STD_STATEMENT_LEN];
  RETCODE result;
  char relhasrules[MAX_INFO_STRING];
  
***************
*** 1719,1725 ****
  {
  static char *func="SQLStatistics";
  StatementClass *stmt = (StatementClass *) hstmt;
! char index_query[MAX_STATEMENT_LEN];
  HSTMT hindx_stmt;
  RETCODE result;
  char *table_name;
--- 1719,1725 ----
  {
  static char *func="SQLStatistics";
  StatementClass *stmt = (StatementClass *) hstmt;
! char index_query[STD_STATEMENT_LEN];
  HSTMT hindx_stmt;
  RETCODE result;
  char *table_name;
***************
*** 2095,2101 ****
  int seq = 0;
  HSTMT htbl_stmt;
  StatementClass *tbl_stmt;
! char tables_query[MAX_STATEMENT_LEN];
  char attname[MAX_INFO_STRING];
  SDWORD attname_len;
  char pktab[MAX_TABLE_LEN + 1];
--- 2095,2101 ----
  int seq = 0;
  HSTMT htbl_stmt;
  StatementClass *tbl_stmt;
! char tables_query[STD_STATEMENT_LEN];
  char attname[MAX_INFO_STRING];
  SDWORD attname_len;
  char pktab[MAX_TABLE_LEN + 1];
***************
*** 2262,2268 ****
  HSTMT htbl_stmt, hpkey_stmt;
  StatementClass *tbl_stmt;
  RETCODE result, keyresult;
! char tables_query[MAX_STATEMENT_LEN];
  char trig_deferrable[2];
  char trig_initdeferred[2];
  char trig_args[1024];
--- 2262,2268 ----
  HSTMT htbl_stmt, hpkey_stmt;
  StatementClass *tbl_stmt;
  RETCODE result, keyresult;
! char tables_query[STD_STATEMENT_LEN];
  char trig_deferrable[2];
  char trig_initdeferred[2];
  char trig_args[1024];
diff -cr psqlodbc-orig/psqlodbc.h psqlodbc/psqlodbc.h
*** psqlodbc-orig/psqlodbc.h	Wed Jan 24 09:30:01 2001
--- psqlodbc/psqlodbc.h	Wed Jan 24 22:30:45 2001
***************
*** 54,62 ****
  #define BLCKSZ                      4096
  #endif
  
! #define MAX_ROW_SIZE				0 /* Unlimited rowsize with the Tuple Toaster */
! #define MAX_QUERY_SIZE				0 /* Unlimited query length from v7.0(?) */
! #define MAX_MESSAGE_LEN				(2*BLCKSZ)
  #define MAX_CONNECT_STRING			4096
  #define ERROR_MSG_LENGTH			4096
  #define FETCH_MAX					100		/* default number of rows to cache for declare/fetch */
--- 54,61 ----
  #define BLCKSZ                      4096
  #endif
  
! #define MAX_MESSAGE_LEN				65536   /* This puts a limit on query size but I don't */
! 											/* see an easy way round this - DJP 24-1-2001 */
  #define MAX_CONNECT_STRING			4096
  #define ERROR_MSG_LENGTH			4096
  #define FETCH_MAX					100		/* default number of rows to cache for declare/fetch */
***************
*** 85,92 ****
  #define MAX_INFO_STRING		128
  #define MAX_KEYPARTS		20
  #define MAX_KEYLEN			512			/*	max key of the form "date+outlet+invoice" */
! #define MAX_STATEMENT_LEN	MAX_MESSAGE_LEN
  
  
  #define PG62	"6.2"		/* "Protocol" key setting to force Postgres 6.2 */
  #define PG63	"6.3"		/* "Protocol" key setting to force postgres 6.3 */
--- 84,95 ----
  #define MAX_INFO_STRING		128
  #define MAX_KEYPARTS		20
  #define MAX_KEYLEN			512			/*	max key of the form "date+outlet+invoice" */
! #define MAX_ROW_SIZE		0 /* Unlimited rowsize with the Tuple Toaster */
! #define MAX_STATEMENT_LEN	0 /* Unlimited statement size with 7.0
  
+ /* Previously, numerous query strings were defined of length MAX_STATEMENT_LEN */
+ /* Now that's 0, lets use this instead. DJP 24-1-2001 */
+ #define STD_STATEMENT_LEN	MAX_MESSAGE_LEN
  
  #define PG62	"6.2"		/* "Protocol" key setting to force Postgres 6.2 */
  #define PG63	"6.3"		/* "Protocol" key setting to force postgres 6.3 */
diff -cr psqlodbc-orig/statement.h psqlodbc/statement.h
*** psqlodbc-orig/statement.h	Wed Jan 24 09:30:05 2001
--- psqlodbc/statement.h	Wed Jan 24 22:31:00 2001
***************
*** 184,190 ****
  
  	char cursor_name[MAX_CURSOR_LEN+1];
  
! 	char stmt_with_params[65536 /* MAX_STATEMENT_LEN */];		/* statement after parameter substitution */
  
  };
  
--- 184,190 ----
  
  	char cursor_name[MAX_CURSOR_LEN+1];
  
! 	char stmt_with_params[STD_STATEMENT_LEN];		/* statement after parameter substitution */
  
  };
  
