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
97dfff83
Commit
97dfff83
authored
Jul 03, 1999
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix to prevent too large tuple from being created.
parent
954e466c
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
46 additions
and
40 deletions
+46
-40
src/backend/access/heap/stats.c
src/backend/access/heap/stats.c
+2
-1
src/backend/catalog/index.c
src/backend/catalog/index.c
+3
-2
src/backend/commands/copy.c
src/backend/commands/copy.c
+2
-2
src/backend/commands/vacuum.c
src/backend/commands/vacuum.c
+2
-2
src/backend/optimizer/path/_deadcode/xfunc.c
src/backend/optimizer/path/_deadcode/xfunc.c
+3
-2
src/backend/parser/gram.y
src/backend/parser/gram.y
+5
-3
src/backend/storage/page/bufpage.c
src/backend/storage/page/bufpage.c
+2
-2
src/backend/utils/adt/varchar.c
src/backend/utils/adt/varchar.c
+14
-9
src/include/access/htup.h
src/include/access/htup.h
+7
-2
src/include/storage/bufpage.h
src/include/storage/bufpage.h
+1
-13
src/interfaces/ecpg/preproc/preproc.y
src/interfaces/ecpg/preproc/preproc.y
+5
-2
No files found.
src/backend/access/heap/stats.c
View file @
97dfff83
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/heap/Attic/stats.c,v 1.1
5 1999/02/13 23:14:25
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/heap/Attic/stats.c,v 1.1
6 1999/07/03 00:32:36
momjian Exp $
*
*
* NOTES
* NOTES
* initam should be moved someplace else.
* initam should be moved someplace else.
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
*/
*/
#include <stdio.h>
#include <stdio.h>
#include <time.h>
#include <postgres.h>
#include <postgres.h>
...
...
src/backend/catalog/index.c
View file @
97dfff83
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.
79 1999/06/19 04:54:11
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.
80 1999/07/03 00:32:38
momjian Exp $
*
*
*
*
* INTERFACE ROUTINES
* INTERFACE ROUTINES
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include "postgres.h"
#include "postgres.h"
#include "access/genam.h"
#include "access/genam.h"
#include "access/htup.h"
#include "access/heapam.h"
#include "access/heapam.h"
#include "access/istrat.h"
#include "access/istrat.h"
#include "access/xact.h"
#include "access/xact.h"
...
@@ -56,7 +57,7 @@
...
@@ -56,7 +57,7 @@
/*
/*
* macros used in guessing how many tuples are on a page.
* macros used in guessing how many tuples are on a page.
*/
*/
#define AVG_TUPLE_SIZE
8
#define AVG_TUPLE_SIZE
MinTupleSize
#define NTUPLES_PER_PAGE(natts) (BLCKSZ/((natts)*AVG_TUPLE_SIZE))
#define NTUPLES_PER_PAGE(natts) (BLCKSZ/((natts)*AVG_TUPLE_SIZE))
/* non-export function prototypes */
/* non-export function prototypes */
...
...
src/backend/commands/copy.c
View file @
97dfff83
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.8
0 1999/06/12 20:41:25 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.8
1 1999/07/03 00:32:39 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -1073,7 +1073,7 @@ GetIndexRelations(Oid main_relation_oid,
...
@@ -1073,7 +1073,7 @@ GetIndexRelations(Oid main_relation_oid,
}
}
}
}
#define EXT_ATTLEN
5*BLCKSZ
#define EXT_ATTLEN
(5 * BLCKSZ)
/*
/*
returns 1 is c is in s
returns 1 is c is in s
...
...
src/backend/commands/vacuum.c
View file @
97dfff83
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.1
09 1999/06/11 09:35:08 vadim
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.1
10 1999/07/03 00:32:40 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -624,7 +624,7 @@ vc_scanheap(VRelStats *vacrelstats, Relation onerel,
...
@@ -624,7 +624,7 @@ vc_scanheap(VRelStats *vacrelstats, Relation onerel,
empty_end_pages
;
empty_end_pages
;
Size
free_size
,
Size
free_size
,
usable_free_size
;
usable_free_size
;
Size
min_tlen
=
M
AXTUPLEN
;
Size
min_tlen
=
M
axTupleSize
;
Size
max_tlen
=
0
;
Size
max_tlen
=
0
;
int32
i
;
int32
i
;
struct
rusage
ru0
,
struct
rusage
ru0
,
...
...
src/backend/optimizer/path/_deadcode/xfunc.c
View file @
97dfff83
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/_deadcode/Attic/xfunc.c,v 1.
4 1999/05/25 22:41:36
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/_deadcode/Attic/xfunc.c,v 1.
5 1999/07/03 00:32:42
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include "postgres.h"
#include "postgres.h"
#include "access/htup.h"
#include "access/heapam.h"
#include "access/heapam.h"
#include "catalog/pg_language.h"
#include "catalog/pg_language.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_proc.h"
...
@@ -1094,7 +1095,7 @@ xfunc_expense_per_tuple(JoinPath joinnode, int whichchild)
...
@@ -1094,7 +1095,7 @@ xfunc_expense_per_tuple(JoinPath joinnode, int whichchild)
RelOptInfo
outerrel
=
get_parent
((
Path
)
get_outerjoinpath
(
joinnode
));
RelOptInfo
outerrel
=
get_parent
((
Path
)
get_outerjoinpath
(
joinnode
));
RelOptInfo
innerrel
=
get_parent
((
Path
)
get_innerjoinpath
(
joinnode
));
RelOptInfo
innerrel
=
get_parent
((
Path
)
get_innerjoinpath
(
joinnode
));
Count
outerwidth
=
get_width
(
outerrel
);
Count
outerwidth
=
get_width
(
outerrel
);
Count
outers_per_page
=
ceil
(
BLCKSZ
/
(
outerwidth
+
sizeof
(
HeapTupleData
)
));
Count
outers_per_page
=
ceil
(
BLCKSZ
/
(
outerwidth
+
MinTupleSize
));
if
(
IsA
(
joinnode
,
HashPath
))
if
(
IsA
(
joinnode
,
HashPath
))
{
{
...
...
src/backend/parser/gram.y
View file @
97dfff83
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.8
4 1999/06/07 14:28:25 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.8
5 1999/07/03 00:32:44 momjian
Exp $
*
*
* HISTORY
* HISTORY
* AUTHOR DATE MAJOR EVENT
* AUTHOR DATE MAJOR EVENT
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
#include <ctype.h>
#include <ctype.h>
#include "postgres.h"
#include "postgres.h"
#include "access/htup.h"
#include "nodes/parsenodes.h"
#include "nodes/parsenodes.h"
#include "nodes/print.h"
#include "nodes/print.h"
#include "parser/gramparse.h"
#include "parser/gramparse.h"
...
@@ -3384,8 +3385,9 @@ Character: character '(' Iconst ')'
...
@@ -3384,8 +3385,9 @@ Character: character '(' Iconst ')'
if ($3 < 1)
if ($3 < 1)
elog(ERROR,"length for '%s' type must be at least 1",$1);
elog(ERROR,"length for '%s' type must be at least 1",$1);
else if ($3 > BLCKSZ - 128)
else if ($3 > MaxTupleSize)
elog(ERROR,"length for type '%s' cannot exceed %d",$1, BLCKSZ-128);
elog(ERROR,"length for type '%s' cannot exceed %d",$1,
MaxTupleSize);
/* we actually implement this sort of like a varlen, so
/* we actually implement this sort of like a varlen, so
* the first 4 bytes is the length. (the difference
* the first 4 bytes is the length. (the difference
...
...
src/backend/storage/page/bufpage.c
View file @
97dfff83
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/page/bufpage.c,v 1.2
2 1999/05/25 16:11:25
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/page/bufpage.c,v 1.2
3 1999/07/03 00:32:48
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -45,7 +45,7 @@ PageInit(Page page, Size pageSize, Size specialSize)
...
@@ -45,7 +45,7 @@ PageInit(Page page, Size pageSize, Size specialSize)
Assert
(
pageSize
==
BLCKSZ
);
Assert
(
pageSize
==
BLCKSZ
);
Assert
(
pageSize
>
Assert
(
pageSize
>
specialSize
+
sizeof
(
PageHeaderData
)
-
sizeof
(
ItemIdData
));
specialSize
+
sizeof
(
PageHeaderData
)
-
sizeof
(
ItemIdData
));
specialSize
=
DOUBLEALIGN
(
specialSize
);
specialSize
=
DOUBLEALIGN
(
specialSize
);
...
...
src/backend/utils/adt/varchar.c
View file @
97dfff83
...
@@ -7,13 +7,14 @@
...
@@ -7,13 +7,14 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.4
6 1999/05/25 16:12:21
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.4
7 1999/07/03 00:32:50
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
#include <stdio.h>
/* for sprintf() */
#include <stdio.h>
/* for sprintf() */
#include <string.h>
#include <string.h>
#include "postgres.h"
#include "postgres.h"
#include "access/htup.h"
#include "utils/array.h"
#include "utils/array.h"
#include "utils/builtins.h"
#include "utils/builtins.h"
#include "catalog/pg_type.h"
#include "catalog/pg_type.h"
...
@@ -81,8 +82,9 @@ bpcharin(char *s, int dummy, int32 atttypmod)
...
@@ -81,8 +82,9 @@ bpcharin(char *s, int dummy, int32 atttypmod)
else
else
len
=
atttypmod
-
VARHDRSZ
;
len
=
atttypmod
-
VARHDRSZ
;
if
(
len
>
BLCKSZ
-
128
)
if
(
len
>
MaxTupleSize
)
elog
(
ERROR
,
"bpcharin: length of char() must be less than %d"
,
BLCKSZ
-
128
);
elog
(
ERROR
,
"bpcharin: length of char() must be less than %d"
,
MaxTupleSize
);
result
=
(
char
*
)
palloc
(
atttypmod
);
result
=
(
char
*
)
palloc
(
atttypmod
);
VARSIZE
(
result
)
=
atttypmod
;
VARSIZE
(
result
)
=
atttypmod
;
...
@@ -151,8 +153,9 @@ bpchar(char *s, int32 len)
...
@@ -151,8 +153,9 @@ bpchar(char *s, int32 len)
rlen
=
len
-
VARHDRSZ
;
rlen
=
len
-
VARHDRSZ
;
if
(
rlen
>
BLCKSZ
-
128
)
if
(
rlen
>
MaxTupleSize
)
elog
(
ERROR
,
"bpchar: length of char() must be less than %d"
,
BLCKSZ
-
128
);
elog
(
ERROR
,
"bpchar: length of char() must be less than %d"
,
MaxTupleSize
);
#ifdef STRINGDEBUG
#ifdef STRINGDEBUG
printf
(
"bpchar- convert string length %d (%d) ->%d (%d)
\n
"
,
printf
(
"bpchar- convert string length %d (%d) ->%d (%d)
\n
"
,
...
@@ -332,8 +335,9 @@ varcharin(char *s, int dummy, int32 atttypmod)
...
@@ -332,8 +335,9 @@ varcharin(char *s, int dummy, int32 atttypmod)
if
(
atttypmod
!=
-
1
&&
len
>
atttypmod
)
if
(
atttypmod
!=
-
1
&&
len
>
atttypmod
)
len
=
atttypmod
;
/* clip the string at max length */
len
=
atttypmod
;
/* clip the string at max length */
if
(
len
>
BLCKSZ
-
128
)
if
(
len
>
MaxTupleSize
)
elog
(
ERROR
,
"varcharin: length of char() must be less than %d"
,
BLCKSZ
-
128
);
elog
(
ERROR
,
"varcharin: length of char() must be less than %d"
,
MaxTupleSize
);
result
=
(
char
*
)
palloc
(
len
);
result
=
(
char
*
)
palloc
(
len
);
VARSIZE
(
result
)
=
len
;
VARSIZE
(
result
)
=
len
;
...
@@ -403,8 +407,9 @@ varchar(char *s, int32 slen)
...
@@ -403,8 +407,9 @@ varchar(char *s, int32 slen)
len
=
slen
-
VARHDRSZ
;
len
=
slen
-
VARHDRSZ
;
#endif
#endif
if
(
len
>
BLCKSZ
-
128
)
if
(
len
>
MaxTupleSize
)
elog
(
ERROR
,
"varchar: length of varchar() must be less than BLCKSZ-128"
);
elog
(
ERROR
,
"varchar: length of varchar() must be less than %d"
,
MaxTupleSize
);
result
=
(
char
*
)
palloc
(
slen
);
result
=
(
char
*
)
palloc
(
slen
);
VARSIZE
(
result
)
=
slen
;
VARSIZE
(
result
)
=
slen
;
...
...
src/include/access/htup.h
View file @
97dfff83
...
@@ -6,14 +6,14 @@
...
@@ -6,14 +6,14 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: htup.h,v 1.1
6 1999/05/25 22:42:32
momjian Exp $
* $Id: htup.h,v 1.1
7 1999/07/03 00:32:55
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
#ifndef HTUP_H
#ifndef HTUP_H
#define HTUP_H
#define HTUP_H
#include <
utils/nabstim
e.h>
#include <
storage/bufpag
e.h>
#include <storage/itemptr.h>
#include <storage/itemptr.h>
#define MinHeapTupleBitmapSize 32
/* 8 * 4 */
#define MinHeapTupleBitmapSize 32
/* 8 * 4 */
...
@@ -52,6 +52,11 @@ typedef struct HeapTupleHeaderData
...
@@ -52,6 +52,11 @@ typedef struct HeapTupleHeaderData
typedef
HeapTupleHeaderData
*
HeapTupleHeader
;
typedef
HeapTupleHeaderData
*
HeapTupleHeader
;
#define MinTupleSize (sizeof (PageHeaderData) + \
sizeof(HeapTupleHeaderData) + sizeof(int4))
#define MaxTupleSize (BLCKSZ/2 - MinTupleSize)
#define SelfItemPointerAttributeNumber (-1)
#define SelfItemPointerAttributeNumber (-1)
#define ObjectIdAttributeNumber (-2)
#define ObjectIdAttributeNumber (-2)
#define MinTransactionIdAttributeNumber (-3)
#define MinTransactionIdAttributeNumber (-3)
...
...
src/include/storage/bufpage.h
View file @
97dfff83
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: bufpage.h,v 1.2
2 1999/05/25 16:14:40
momjian Exp $
* $Id: bufpage.h,v 1.2
3 1999/07/03 00:32:59
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -133,18 +133,6 @@ typedef enum
...
@@ -133,18 +133,6 @@ typedef enum
OverwritePageManagerMode
OverwritePageManagerMode
}
PageManagerMode
;
}
PageManagerMode
;
/* ----------------
* misc support macros
* ----------------
*/
/*
* XXX this is wrong -- ignores padding/alignment, variable page size,
* AM-specific opaque space at the end of the page (as in btrees), ...
* however, it at least serves as an upper bound for heap pages.
*/
#define MAXTUPLEN (BLCKSZ - sizeof (PageHeaderData))
/* ----------------------------------------------------------------
/* ----------------------------------------------------------------
* page support macros
* page support macros
* ----------------------------------------------------------------
* ----------------------------------------------------------------
...
...
src/interfaces/ecpg/preproc/preproc.y
View file @
97dfff83
...
@@ -3,6 +3,9 @@
...
@@ -3,6 +3,9 @@
#include <stdio.h>
#include <stdio.h>
#include <string.h>
#include <string.h>
#include <stdlib.h>
#include <stdlib.h>
#include "postgres.h"
#include "access/htup.h"
#include "catalog/catname.h"
#include "catalog/catname.h"
#include "utils/numeric.h"
#include "utils/numeric.h"
...
@@ -3351,8 +3354,8 @@ Character: character '(' Iconst ')'
...
@@ -3351,8 +3354,8 @@ Character: character '(' Iconst ')'
sprintf(errortext, "length for '%s' type must be at least 1",$1);
sprintf(errortext, "length for '%s' type must be at least 1",$1);
yyerror(errortext);
yyerror(errortext);
}
}
else if (atol($3) >
BLCKSZ - 128
) {
else if (atol($3) >
MaxTupleSize
) {
sprintf(errortext, "length for type '%s' cannot exceed %d",$1,
BLCKSZ - 128
);
sprintf(errortext, "length for type '%s' cannot exceed %d",$1,
MaxTupleSize
);
yyerror(errortext);
yyerror(errortext);
}
}
...
...
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