1) Decrease the size of some buffers.
authorHiroshi Inoue
Thu, 17 May 2001 02:56:37 +0000 (02:56 +0000)
committerHiroshi Inoue
Thu, 17 May 2001 02:56:37 +0000 (02:56 +0000)
2) Repair broken SQLStatistics().

src/interfaces/odbc/info.c
src/interfaces/odbc/psqlodbc.h

index e393c5b069caeb4bf9f66b5cd9a16d45cba13f42..5e3e980d9f0149c878377cee2cf166be852c7f3c 100644 (file)
@@ -1104,7 +1104,7 @@ SQLTables(
    HSTMT       htbl_stmt;
    RETCODE     result;
    char       *tableType;
-   char        tables_query[STD_STATEMENT_LEN];
+   char        tables_query[INFO_INQUIRY_LEN];
    char        table_name[MAX_INFO_STRING],
                table_owner[MAX_INFO_STRING],
                relkind_or_hasrules[MAX_INFO_STRING];
@@ -1422,7 +1422,7 @@ SQLColumns(
    TupleNode  *row;
    HSTMT       hcol_stmt;
    StatementClass *col_stmt;
-   char        columns_query[STD_STATEMENT_LEN];
+   char        columns_query[INFO_INQUIRY_LEN];
    RETCODE     result;
    char        table_owner[MAX_INFO_STRING],
                table_name[MAX_INFO_STRING],
@@ -1862,7 +1862,7 @@ SQLSpecialColumns(
    ConnInfo   *ci;
    HSTMT       hcol_stmt;
    StatementClass *col_stmt;
-   char        columns_query[STD_STATEMENT_LEN];
+   char        columns_query[INFO_INQUIRY_LEN];
    RETCODE     result;
    char        relhasrules[MAX_INFO_STRING];
 
@@ -2003,7 +2003,7 @@ SQLStatistics(
 {
    static char *func = "SQLStatistics";
    StatementClass *stmt = (StatementClass *) hstmt;
-   char        index_query[STD_STATEMENT_LEN];
+   char        index_query[INFO_INQUIRY_LEN];
    HSTMT       hindx_stmt;
    RETCODE     result;
    char       *table_name;
@@ -2171,12 +2171,12 @@ SQLStatistics(
    indx_stmt = (StatementClass *) hindx_stmt;
 
    sprintf(index_query, "select c.relname, i.indkey, i.indisunique"
-           ", x.indisclustered, a.amname, i.relhasrules"
-           " from pg_index x, pg_class i, pg_class c, pg_am a"
-           " where c.relname = '%s'"
-           " and c.oid = x.indrelid"
-           " and x.indexrelid = i.oid"
-           " and i.relam = a.oid"
+           ", i.indisclustered, a.amname, c.relhasrules"
+           " from pg_index i, pg_class c, pg_class d, pg_am a"
+           " where d.relname = '%s'"
+           " and d.oid = i.indrelid"
+           " and i.indexrelid = c.oid"
+           " and c.relam = a.oid"
            , table_name);
 
    result = SQLExecDirect(hindx_stmt, index_query, strlen(index_query));
@@ -2455,7 +2455,7 @@ SQLPrimaryKeys(
    int         seq = 0;
    HSTMT       htbl_stmt;
    StatementClass *tbl_stmt;
-   char        tables_query[STD_STATEMENT_LEN];
+   char        tables_query[INFO_INQUIRY_LEN];
    char        attname[MAX_INFO_STRING];
    SDWORD      attname_len;
    char        pktab[MAX_TABLE_LEN + 1];
@@ -2641,7 +2641,7 @@ SQLForeignKeys(
    StatementClass *tbl_stmt;
    RETCODE     result,
                keyresult;
-   char        tables_query[STD_STATEMENT_LEN];
+   char        tables_query[INFO_INQUIRY_LEN];
    char        trig_deferrable[2];
    char        trig_initdeferred[2];
    char        trig_args[1024];
index 9d39fdc7ffe341f746b7bcb20c88ae538eb5da5a..c14b32045bfaa9d275dc6d1e7728b9b2f2155e01 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Comments:       See "notice.txt" for copyright and license information.
  *
- * $Id: psqlodbc.h,v 1.42 2001/05/01 00:47:06 inoue Exp $
+ * $Id: psqlodbc.h,v 1.43 2001/05/17 02:56:37 inoue Exp $
  *
  */
 
@@ -191,6 +191,9 @@ typedef struct QueryInfo_
 #define PG_NUMERIC_MAX_PRECISION   1000
 #define PG_NUMERIC_MAX_SCALE       1000
 
+#define    INFO_INQUIRY_LEN        8192 /* this seems sufficiently big for
+queries used in info.c inoue 2001/05/17 */
+
 #include "misc.h"
 
 #endif