Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite7ffdd4

Browse files
author
Hiroshi Inoue
committed
1) Decrease the size of some buffers.
2) Repair broken SQLStatistics().
1 parent77f2775 commite7ffdd4

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

‎src/interfaces/odbc/info.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@ SQLTables(
11041104
HSTMThtbl_stmt;
11051105
RETCODEresult;
11061106
char*tableType;
1107-
chartables_query[STD_STATEMENT_LEN];
1107+
chartables_query[INFO_INQUIRY_LEN];
11081108
chartable_name[MAX_INFO_STRING],
11091109
table_owner[MAX_INFO_STRING],
11101110
relkind_or_hasrules[MAX_INFO_STRING];
@@ -1422,7 +1422,7 @@ SQLColumns(
14221422
TupleNode*row;
14231423
HSTMThcol_stmt;
14241424
StatementClass*col_stmt;
1425-
charcolumns_query[STD_STATEMENT_LEN];
1425+
charcolumns_query[INFO_INQUIRY_LEN];
14261426
RETCODEresult;
14271427
chartable_owner[MAX_INFO_STRING],
14281428
table_name[MAX_INFO_STRING],
@@ -1862,7 +1862,7 @@ SQLSpecialColumns(
18621862
ConnInfo*ci;
18631863
HSTMThcol_stmt;
18641864
StatementClass*col_stmt;
1865-
charcolumns_query[STD_STATEMENT_LEN];
1865+
charcolumns_query[INFO_INQUIRY_LEN];
18661866
RETCODEresult;
18671867
charrelhasrules[MAX_INFO_STRING];
18681868

@@ -2003,7 +2003,7 @@ SQLStatistics(
20032003
{
20042004
staticchar*func="SQLStatistics";
20052005
StatementClass*stmt= (StatementClass*)hstmt;
2006-
charindex_query[STD_STATEMENT_LEN];
2006+
charindex_query[INFO_INQUIRY_LEN];
20072007
HSTMThindx_stmt;
20082008
RETCODEresult;
20092009
char*table_name;
@@ -2171,12 +2171,12 @@ SQLStatistics(
21712171
indx_stmt= (StatementClass*)hindx_stmt;
21722172

21732173
sprintf(index_query,"select c.relname, i.indkey, i.indisunique"
2174-
",x.indisclustered, a.amname,i.relhasrules"
2175-
" from pg_indexx, pg_classi, pg_classc, pg_am a"
2176-
" wherec.relname = '%s'"
2177-
" andc.oid =x.indrelid"
2178-
" andx.indexrelid =i.oid"
2179-
" andi.relam = a.oid"
2174+
",i.indisclustered, a.amname,c.relhasrules"
2175+
" from pg_indexi, pg_classc, pg_classd, pg_am a"
2176+
" whered.relname = '%s'"
2177+
" andd.oid =i.indrelid"
2178+
" andi.indexrelid =c.oid"
2179+
" andc.relam = a.oid"
21802180
,table_name);
21812181

21822182
result=SQLExecDirect(hindx_stmt,index_query,strlen(index_query));
@@ -2455,7 +2455,7 @@ SQLPrimaryKeys(
24552455
intseq=0;
24562456
HSTMThtbl_stmt;
24572457
StatementClass*tbl_stmt;
2458-
chartables_query[STD_STATEMENT_LEN];
2458+
chartables_query[INFO_INQUIRY_LEN];
24592459
charattname[MAX_INFO_STRING];
24602460
SDWORDattname_len;
24612461
charpktab[MAX_TABLE_LEN+1];
@@ -2641,7 +2641,7 @@ SQLForeignKeys(
26412641
StatementClass*tbl_stmt;
26422642
RETCODEresult,
26432643
keyresult;
2644-
chartables_query[STD_STATEMENT_LEN];
2644+
chartables_query[INFO_INQUIRY_LEN];
26452645
chartrig_deferrable[2];
26462646
chartrig_initdeferred[2];
26472647
chartrig_args[1024];

‎src/interfaces/odbc/psqlodbc.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Comments:See "notice.txt" for copyright and license information.
77
*
8-
* $Id: psqlodbc.h,v 1.42 2001/05/01 00:47:06 inoue Exp $
8+
* $Id: psqlodbc.h,v 1.43 2001/05/17 02:56:37 inoue Exp $
99
*
1010
*/
1111

@@ -191,6 +191,9 @@ typedef struct QueryInfo_
191191
#definePG_NUMERIC_MAX_PRECISION1000
192192
#definePG_NUMERIC_MAX_SCALE1000
193193

194+
#defineINFO_INQUIRY_LEN8192/* this seems sufficiently big for
195+
queries used in info.c inoue 2001/05/17 */
196+
194197
#include"misc.h"
195198

196199
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp