Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
ede5a418
Commit
ede5a418
authored
Jul 04, 1999
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up maximum rewrite tuple length.
parent
eba41848
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
14 deletions
+8
-14
src/backend/rewrite/rewriteDefine.c
src/backend/rewrite/rewriteDefine.c
+8
-14
No files found.
src/backend/rewrite/rewriteDefine.c
View file @
ede5a418
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteDefine.c,v 1.
29 1999/05/25 16:10:48
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteDefine.c,v 1.
30 1999/07/04 05:16:05
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -16,7 +16,9 @@
...
@@ -16,7 +16,9 @@
#include "postgres.h"
#include "postgres.h"
#include "access/htup.h"
#include "access/heapam.h"
/* access methods like amopenr */
#include "access/heapam.h"
/* access methods like amopenr */
#include "catalog/pg_rewrite.h"
#include "nodes/parsenodes.h"
#include "nodes/parsenodes.h"
#include "nodes/pg_list.h"
/* for Lisp support */
#include "nodes/pg_list.h"
/* for Lisp support */
#include "parser/parse_relation.h"
#include "parser/parse_relation.h"
...
@@ -32,14 +34,6 @@
...
@@ -32,14 +34,6 @@
Oid
LastOidProcessed
=
InvalidOid
;
Oid
LastOidProcessed
=
InvalidOid
;
/*
* This is too small for many rule plans, but it'll have to do for now.
* Rule plans, etc will eventually have to be large objects.
*
* should this be smaller?
*/
#define RULE_PLAN_SIZE BLCKSZ
static
void
static
void
strcpyq
(
char
*
dest
,
char
*
source
)
strcpyq
(
char
*
dest
,
char
*
source
)
{
{
...
@@ -84,9 +78,9 @@ InsertRule(char *rulname,
...
@@ -84,9 +78,9 @@ InsertRule(char *rulname,
bool
evinstead
,
bool
evinstead
,
char
*
actiontree
)
char
*
actiontree
)
{
{
static
char
rulebuf
[
RULE_PLAN_SIZE
];
static
char
rulebuf
[
MaxAttrSize
];
static
char
actionbuf
[
RULE_PLAN_SIZE
];
static
char
actionbuf
[
MaxAttrSize
];
static
char
qualbuf
[
RULE_PLAN_SIZE
];
static
char
qualbuf
[
MaxAttrSize
];
Oid
eventrel_oid
=
InvalidOid
;
Oid
eventrel_oid
=
InvalidOid
;
AttrNumber
evslot_index
=
InvalidAttrNumber
;
AttrNumber
evslot_index
=
InvalidAttrNumber
;
Relation
eventrel
=
NULL
;
Relation
eventrel
=
NULL
;
...
@@ -124,8 +118,8 @@ InsertRule(char *rulname,
...
@@ -124,8 +118,8 @@ InsertRule(char *rulname,
(rulename, ev_type, ev_class, ev_attr, ev_action, ev_qual, is_instead) VALUES \
(rulename, ev_type, ev_class, ev_attr, ev_action, ev_qual, is_instead) VALUES \
('%s', %d::char, %u::oid, %d::int2, '%s'::text, '%s'::text, \
('%s', %d::char, %u::oid, %d::int2, '%s'::text, '%s'::text, \
'%s'::bool);"
;
'%s'::bool);"
;
if
(
s
trlen
(
template
)
+
strlen
(
rulnam
e
)
+
strlen
(
actionbuf
)
+
if
(
s
izeof
(
FormData_pg_rewrit
e
)
+
strlen
(
actionbuf
)
+
strlen
(
qualbuf
)
+
20
/* fudge fac */
>
RULE_PLAN_SIZE
)
strlen
(
qualbuf
)
>
MaxAttrSize
)
elog
(
ERROR
,
"DefineQueryRewrite: rule plan string too big."
);
elog
(
ERROR
,
"DefineQueryRewrite: rule plan string too big."
);
sprintf
(
rulebuf
,
template
,
sprintf
(
rulebuf
,
template
,
rulname
,
evtype
,
eventrel_oid
,
evslot_index
,
actionbuf
,
rulname
,
evtype
,
eventrel_oid
,
evslot_index
,
actionbuf
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment