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

Commite5cff3f

Browse files
author
Hiroshi Inoue
committed
Get rid of the following size limit.
1) Query size limit(was 65536) for >=7.0 servers.2) Text size limit(was 8190) for 7.1 servers.
1 parentf3c1ae5 commite5cff3f

File tree

8 files changed

+422
-116
lines changed

8 files changed

+422
-116
lines changed

‎src/interfaces/odbc/connection.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,7 @@ CC_send_query(ConnectionClass *self, char *query, QueryInfo *qi)
915915
charswallow;
916916
intid;
917917
SocketClass*sock=self->sock;
918+
intmaxlen;
918919

919920
/* ERROR_MSG_LENGTH is suffcient */
920921
staticcharmsgbuffer[ERROR_MSG_LENGTH+1];
@@ -926,7 +927,8 @@ CC_send_query(ConnectionClass *self, char *query, QueryInfo *qi)
926927
qlog("conn=%u, query='%s'\n",self,query);
927928

928929
/* Indicate that we are sending a query to the backend */
929-
if (strlen(query)>MAX_MESSAGE_LEN-2)
930+
maxlen=CC_get_max_query_len(self);
931+
if (maxlen>0&&maxlen< (int)strlen(query)+1)
930932
{
931933
self->errornumber=CONNECTION_MSG_TOO_LONG;
932934
self->errormsg="Query string is too long";
@@ -1643,3 +1645,18 @@ CC_log_error(char *func, char *desc, ConnectionClass *self)
16431645
qlog("INVALID CONNECTION HANDLE ERROR: func=%s, desc='%s'\n",func,desc);
16441646
#undef PRN_NULLCHECK
16451647
}
1648+
1649+
intCC_get_max_query_len(constConnectionClass*conn)
1650+
{
1651+
intvalue;
1652+
/* Long Queries in 7.0+ */
1653+
if (PG_VERSION_GE(conn,7.0))
1654+
value=0/* MAX_STATEMENT_LEN */;
1655+
/* Prior to 7.0 we used 2*BLCKSZ */
1656+
elseif (PG_VERSION_GE(conn,6.5))
1657+
value= (2*BLCKSZ);
1658+
else
1659+
/* Prior to 6.5 we used BLCKSZ */
1660+
value=BLCKSZ;
1661+
returnvalue;
1662+
}

‎src/interfaces/odbc/connection.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,6 @@ voidCC_lookup_lo(ConnectionClass *conn);
307307
voidCC_lookup_pg_version(ConnectionClass*conn);
308308
voidCC_initialize_pg_version(ConnectionClass*conn);
309309
voidCC_log_error(char*func,char*desc,ConnectionClass*self);
310-
310+
intCC_get_max_query_len(constConnectionClass*self);
311311

312312
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp