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
6d08b6a7
Commit
6d08b6a7
authored
May 19, 1999
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove 4096 string limited key on block size
parent
0a8fb5a8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
20 deletions
+14
-20
src/backend/parser/gram.y
src/backend/parser/gram.y
+3
-8
src/backend/utils/adt/varchar.c
src/backend/utils/adt/varchar.c
+9
-9
src/interfaces/ecpg/preproc/preproc.y
src/interfaces/ecpg/preproc/preproc.y
+2
-3
No files found.
src/backend/parser/gram.y
View file @
6d08b6a7
...
...
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.7
7 1999/05/17 01:01:06
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.7
8 1999/05/19 17:53:10
momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
...
...
@@ -3403,13 +3403,8 @@ Character: character '(' Iconst ')'
if ($3 < 1)
elog(ERROR,"length for '%s' type must be at least 1",$1);
else if ($3 > 4096)
/* we can store a char() of length up to the size
* of a page (8KB) - page headers and friends but
* just to be safe here... - ay 6/95
* XXX note this hardcoded limit - thomas 1997-07-13
*/
elog(ERROR,"length for type '%s' cannot exceed 4096",$1);
else if ($3 > BLCKSZ - 128)
elog(ERROR,"length for type '%s' cannot exceed %d",$1, BLCKSZ-128);
/* we actually implement this sort of like a varlen, so
* the first 4 bytes is the length. (the difference
...
...
src/backend/utils/adt/varchar.c
View file @
6d08b6a7
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.4
4 1999/05/03 19:10:02
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.4
5 1999/05/19 17:53:11
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -81,8 +81,8 @@ bpcharin(char *s, int dummy, int32 atttypmod)
else
len
=
atttypmod
-
VARHDRSZ
;
if
(
len
>
4096
)
elog
(
ERROR
,
"bpcharin: length of char() must be less than
4096"
);
if
(
len
>
BLCKSZ
-
128
)
elog
(
ERROR
,
"bpcharin: length of char() must be less than
%d"
,
BLCKSZ
-
128
);
result
=
(
char
*
)
palloc
(
atttypmod
);
VARSIZE
(
result
)
=
atttypmod
;
...
...
@@ -151,8 +151,8 @@ bpchar(char *s, int32 len)
rlen
=
len
-
VARHDRSZ
;
if
(
rlen
>
4096
)
elog
(
ERROR
,
"bpchar: length of char() must be less than
4096"
);
if
(
rlen
>
BLCKSZ
-
128
)
elog
(
ERROR
,
"bpchar: length of char() must be less than
%d"
,
BLCKSZ
-
128
);
#ifdef STRINGDEBUG
printf
(
"bpchar- convert string length %d (%d) ->%d (%d)
\n
"
,
...
...
@@ -330,8 +330,8 @@ varcharin(char *s, int dummy, int32 atttypmod)
if
(
atttypmod
!=
-
1
&&
len
>
atttypmod
)
len
=
atttypmod
;
/* clip the string at max length */
if
(
len
>
4096
)
elog
(
ERROR
,
"varcharin: length of char() must be less than
4096"
);
if
(
len
>
BLCKSZ
-
128
)
elog
(
ERROR
,
"varcharin: length of char() must be less than
%d"
,
BLCKSZ
-
128
);
result
=
(
char
*
)
palloc
(
len
);
VARSIZE
(
result
)
=
len
;
...
...
@@ -398,8 +398,8 @@ varchar(char *s, int32 slen)
len
=
slen
-
VARHDRSZ
;
#endif
if
(
len
>
4096
)
elog
(
ERROR
,
"varchar: length of varchar() must be less than
4096
"
);
if
(
len
>
BLCKSZ
-
128
)
elog
(
ERROR
,
"varchar: length of varchar() must be less than
BLCKSZ-128
"
);
result
=
(
char
*
)
palloc
(
slen
);
VARSIZE
(
result
)
=
slen
;
...
...
src/interfaces/ecpg/preproc/preproc.y
View file @
6d08b6a7
...
...
@@ -3355,13 +3355,12 @@ Character: character '(' Iconst ')'
sprintf(errortext, "length for '%s' type must be at least 1",$1);
yyerror(errortext);
}
else if (atol($3) >
4096
) {
else if (atol($3) >
BLCKSZ - 128
) {
/* we can store a char() of length up to the size
* of a page (8KB) - page headers and friends but
* just to be safe here... - ay 6/95
* XXX note this hardcoded limit - thomas 1997-07-13
*/
sprintf(errortext, "length for type '%s' cannot exceed
4096",$1
);
sprintf(errortext, "length for type '%s' cannot exceed
%d",BLCKSZ-128
);
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