mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-18 18:44:06 +08:00
1) Decrease the size of some buffers.
2) Repair broken SQLStatistics().
This commit is contained in:
parent
77f277575a
commit
e7ffdd4475
@ -1104,7 +1104,7 @@ SQLTables(
|
|||||||
HSTMT htbl_stmt;
|
HSTMT htbl_stmt;
|
||||||
RETCODE result;
|
RETCODE result;
|
||||||
char *tableType;
|
char *tableType;
|
||||||
char tables_query[STD_STATEMENT_LEN];
|
char tables_query[INFO_INQUIRY_LEN];
|
||||||
char table_name[MAX_INFO_STRING],
|
char table_name[MAX_INFO_STRING],
|
||||||
table_owner[MAX_INFO_STRING],
|
table_owner[MAX_INFO_STRING],
|
||||||
relkind_or_hasrules[MAX_INFO_STRING];
|
relkind_or_hasrules[MAX_INFO_STRING];
|
||||||
@ -1422,7 +1422,7 @@ SQLColumns(
|
|||||||
TupleNode *row;
|
TupleNode *row;
|
||||||
HSTMT hcol_stmt;
|
HSTMT hcol_stmt;
|
||||||
StatementClass *col_stmt;
|
StatementClass *col_stmt;
|
||||||
char columns_query[STD_STATEMENT_LEN];
|
char columns_query[INFO_INQUIRY_LEN];
|
||||||
RETCODE result;
|
RETCODE result;
|
||||||
char table_owner[MAX_INFO_STRING],
|
char table_owner[MAX_INFO_STRING],
|
||||||
table_name[MAX_INFO_STRING],
|
table_name[MAX_INFO_STRING],
|
||||||
@ -1862,7 +1862,7 @@ SQLSpecialColumns(
|
|||||||
ConnInfo *ci;
|
ConnInfo *ci;
|
||||||
HSTMT hcol_stmt;
|
HSTMT hcol_stmt;
|
||||||
StatementClass *col_stmt;
|
StatementClass *col_stmt;
|
||||||
char columns_query[STD_STATEMENT_LEN];
|
char columns_query[INFO_INQUIRY_LEN];
|
||||||
RETCODE result;
|
RETCODE result;
|
||||||
char relhasrules[MAX_INFO_STRING];
|
char relhasrules[MAX_INFO_STRING];
|
||||||
|
|
||||||
@ -2003,7 +2003,7 @@ SQLStatistics(
|
|||||||
{
|
{
|
||||||
static char *func = "SQLStatistics";
|
static char *func = "SQLStatistics";
|
||||||
StatementClass *stmt = (StatementClass *) hstmt;
|
StatementClass *stmt = (StatementClass *) hstmt;
|
||||||
char index_query[STD_STATEMENT_LEN];
|
char index_query[INFO_INQUIRY_LEN];
|
||||||
HSTMT hindx_stmt;
|
HSTMT hindx_stmt;
|
||||||
RETCODE result;
|
RETCODE result;
|
||||||
char *table_name;
|
char *table_name;
|
||||||
@ -2171,12 +2171,12 @@ SQLStatistics(
|
|||||||
indx_stmt = (StatementClass *) hindx_stmt;
|
indx_stmt = (StatementClass *) hindx_stmt;
|
||||||
|
|
||||||
sprintf(index_query, "select c.relname, i.indkey, i.indisunique"
|
sprintf(index_query, "select c.relname, i.indkey, i.indisunique"
|
||||||
", x.indisclustered, a.amname, i.relhasrules"
|
", i.indisclustered, a.amname, c.relhasrules"
|
||||||
" from pg_index x, pg_class i, pg_class c, pg_am a"
|
" from pg_index i, pg_class c, pg_class d, pg_am a"
|
||||||
" where c.relname = '%s'"
|
" where d.relname = '%s'"
|
||||||
" and c.oid = x.indrelid"
|
" and d.oid = i.indrelid"
|
||||||
" and x.indexrelid = i.oid"
|
" and i.indexrelid = c.oid"
|
||||||
" and i.relam = a.oid"
|
" and c.relam = a.oid"
|
||||||
, table_name);
|
, table_name);
|
||||||
|
|
||||||
result = SQLExecDirect(hindx_stmt, index_query, strlen(index_query));
|
result = SQLExecDirect(hindx_stmt, index_query, strlen(index_query));
|
||||||
@ -2455,7 +2455,7 @@ SQLPrimaryKeys(
|
|||||||
int seq = 0;
|
int seq = 0;
|
||||||
HSTMT htbl_stmt;
|
HSTMT htbl_stmt;
|
||||||
StatementClass *tbl_stmt;
|
StatementClass *tbl_stmt;
|
||||||
char tables_query[STD_STATEMENT_LEN];
|
char tables_query[INFO_INQUIRY_LEN];
|
||||||
char attname[MAX_INFO_STRING];
|
char attname[MAX_INFO_STRING];
|
||||||
SDWORD attname_len;
|
SDWORD attname_len;
|
||||||
char pktab[MAX_TABLE_LEN + 1];
|
char pktab[MAX_TABLE_LEN + 1];
|
||||||
@ -2641,7 +2641,7 @@ SQLForeignKeys(
|
|||||||
StatementClass *tbl_stmt;
|
StatementClass *tbl_stmt;
|
||||||
RETCODE result,
|
RETCODE result,
|
||||||
keyresult;
|
keyresult;
|
||||||
char tables_query[STD_STATEMENT_LEN];
|
char tables_query[INFO_INQUIRY_LEN];
|
||||||
char trig_deferrable[2];
|
char trig_deferrable[2];
|
||||||
char trig_initdeferred[2];
|
char trig_initdeferred[2];
|
||||||
char trig_args[1024];
|
char trig_args[1024];
|
||||||
|
@ -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.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_PRECISION 1000
|
||||||
#define PG_NUMERIC_MAX_SCALE 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"
|
#include "misc.h"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user