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
f2874feb
Commit
f2874feb
authored
Feb 21, 2015
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some more FLEXIBLE_ARRAY_MEMBER fixes.
parent
33b2a2c9
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
9 deletions
+18
-9
src/backend/optimizer/plan/setrefs.c
src/backend/optimizer/plan/setrefs.c
+2
-3
src/include/access/brin_page.h
src/include/access/brin_page.h
+6
-1
src/include/replication/slot.h
src/include/replication/slot.h
+4
-0
src/interfaces/libpq/fe-exec.c
src/interfaces/libpq/fe-exec.c
+2
-1
src/interfaces/libpq/libpq-int.h
src/interfaces/libpq/libpq-int.h
+2
-2
src/pl/plpgsql/src/pl_funcs.c
src/pl/plpgsql/src/pl_funcs.c
+1
-1
src/pl/plpgsql/src/plpgsql.h
src/pl/plpgsql/src/plpgsql.h
+1
-1
No files found.
src/backend/optimizer/plan/setrefs.c
View file @
f2874feb
...
@@ -41,9 +41,8 @@ typedef struct
...
@@ -41,9 +41,8 @@ typedef struct
int
num_vars
;
/* number of plain Var tlist entries */
int
num_vars
;
/* number of plain Var tlist entries */
bool
has_ph_vars
;
/* are there PlaceHolderVar entries? */
bool
has_ph_vars
;
/* are there PlaceHolderVar entries? */
bool
has_non_vars
;
/* are there other entries? */
bool
has_non_vars
;
/* are there other entries? */
/* array of num_vars entries: */
tlist_vinfo
vars
[
FLEXIBLE_ARRAY_MEMBER
];
/* has num_vars entries */
tlist_vinfo
vars
[
1
];
/* VARIABLE LENGTH ARRAY */
}
indexed_tlist
;
}
indexed_tlist
;
/* VARIABLE LENGTH STRUCT */
typedef
struct
typedef
struct
{
{
...
...
src/include/access/brin_page.h
View file @
f2874feb
...
@@ -56,7 +56,12 @@ typedef struct BrinMetaPageData
...
@@ -56,7 +56,12 @@ typedef struct BrinMetaPageData
/* Definitions for revmap pages */
/* Definitions for revmap pages */
typedef
struct
RevmapContents
typedef
struct
RevmapContents
{
{
ItemPointerData
rm_tids
[
1
];
/* really REVMAP_PAGE_MAXITEMS */
/*
* This array will fill all available space on the page. It should be
* declared [FLEXIBLE_ARRAY_MEMBER], but for some reason you can't do that
* in an otherwise-empty struct.
*/
ItemPointerData
rm_tids
[
1
];
}
RevmapContents
;
}
RevmapContents
;
#define REVMAP_CONTENT_SIZE \
#define REVMAP_CONTENT_SIZE \
...
...
src/include/replication/slot.h
View file @
f2874feb
...
@@ -130,6 +130,10 @@ typedef struct ReplicationSlot
...
@@ -130,6 +130,10 @@ typedef struct ReplicationSlot
*/
*/
typedef
struct
ReplicationSlotCtlData
typedef
struct
ReplicationSlotCtlData
{
{
/*
* This array should be declared [FLEXIBLE_ARRAY_MEMBER], but for some
* reason you can't do that in an otherwise-empty struct.
*/
ReplicationSlot
replication_slots
[
1
];
ReplicationSlot
replication_slots
[
1
];
}
ReplicationSlotCtlData
;
}
ReplicationSlotCtlData
;
...
...
src/interfaces/libpq/fe-exec.c
View file @
f2874feb
...
@@ -892,7 +892,8 @@ pqSaveMessageField(PGresult *res, char code, const char *value)
...
@@ -892,7 +892,8 @@ pqSaveMessageField(PGresult *res, char code, const char *value)
pfield
=
(
PGMessageField
*
)
pfield
=
(
PGMessageField
*
)
pqResultAlloc
(
res
,
pqResultAlloc
(
res
,
sizeof
(
PGMessageField
)
+
strlen
(
value
),
offsetof
(
PGMessageField
,
contents
)
+
strlen
(
value
)
+
1
,
TRUE
);
TRUE
);
if
(
!
pfield
)
if
(
!
pfield
)
return
;
/* out of memory? */
return
;
/* out of memory? */
...
...
src/interfaces/libpq/libpq-int.h
View file @
f2874feb
...
@@ -145,7 +145,7 @@ typedef struct pgMessageField
...
@@ -145,7 +145,7 @@ typedef struct pgMessageField
{
{
struct
pgMessageField
*
next
;
/* list link */
struct
pgMessageField
*
next
;
/* list link */
char
code
;
/* field code */
char
code
;
/* field code */
char
contents
[
1
];
/* field value (VARIABLE LENGTH)
*/
char
contents
[
FLEXIBLE_ARRAY_MEMBER
];
/* value, nul-terminated
*/
}
PGMessageField
;
}
PGMessageField
;
/* Fields needed for notice handling */
/* Fields needed for notice handling */
...
...
src/pl/plpgsql/src/pl_funcs.c
View file @
f2874feb
...
@@ -97,7 +97,7 @@ plpgsql_ns_additem(int itemtype, int itemno, const char *name)
...
@@ -97,7 +97,7 @@ plpgsql_ns_additem(int itemtype, int itemno, const char *name)
/* first item added must be a label */
/* first item added must be a label */
Assert
(
ns_top
!=
NULL
||
itemtype
==
PLPGSQL_NSTYPE_LABEL
);
Assert
(
ns_top
!=
NULL
||
itemtype
==
PLPGSQL_NSTYPE_LABEL
);
nse
=
palloc
(
sizeof
(
PLpgSQL_nsitem
)
+
strlen
(
name
)
);
nse
=
palloc
(
offsetof
(
PLpgSQL_nsitem
,
name
)
+
strlen
(
name
)
+
1
);
nse
->
itemtype
=
itemtype
;
nse
->
itemtype
=
itemtype
;
nse
->
itemno
=
itemno
;
nse
->
itemno
=
itemno
;
nse
->
prev
=
ns_top
;
nse
->
prev
=
ns_top
;
...
...
src/pl/plpgsql/src/plpgsql.h
View file @
f2874feb
...
@@ -329,7 +329,7 @@ typedef struct PLpgSQL_nsitem
...
@@ -329,7 +329,7 @@ typedef struct PLpgSQL_nsitem
int
itemtype
;
int
itemtype
;
int
itemno
;
int
itemno
;
struct
PLpgSQL_nsitem
*
prev
;
struct
PLpgSQL_nsitem
*
prev
;
char
name
[
1
];
/* actually, as long as needed
*/
char
name
[
FLEXIBLE_ARRAY_MEMBER
];
/* nul-terminated string
*/
}
PLpgSQL_nsitem
;
}
PLpgSQL_nsitem
;
...
...
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