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
6eb05251
Commit
6eb05251
authored
Feb 19, 1997
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent under/over flow of float8 constants in parser. Small regression fix.
parent
5b5bbdb1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
6 deletions
+14
-6
src/backend/parser/scan.l
src/backend/parser/scan.l
+10
-3
src/backend/utils/adt/float.c
src/backend/utils/adt/float.c
+2
-2
src/include/utils/builtins.h
src/include/utils/builtins.h
+2
-1
No files found.
src/backend/parser/scan.l
View file @
6eb05251
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.
9 1997/02/14 04:15:59
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.
10 1997/02/19 20:10:38
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -20,6 +20,7 @@
#include <stdlib.h>
#endif /* __linux__ */
#include <string.h>
#include <errno.h>
#include "postgres.h"
#include "miscadmin.h"
...
...
@@ -30,6 +31,7 @@
#include "parser/scansup.h"
#include "parser/sysfunc.h"
#include "parse.h"
#include "utils/builtins.h"
extern char *parseString;
extern char *parseCh;
...
...
@@ -109,8 +111,13 @@ other .
return (ICONST);
}
{real} {
yylval.dval = atof((char*)yytext);
return (FCONST);
char* endptr;
errno = 0;
yylval.dval = strtod(((char *)yytext),&endptr);
if (*endptr != '\0' || errno == ERANGE)
elog(WARN,"\tBad float8 input format\n");
CheckFloat8Val(yylval.dval);
return (FCONST);
}
{quote} {
char literal[MAX_PARSE_BUFFER];
...
...
src/backend/utils/adt/float.c
View file @
6eb05251
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.1
1 1997/02/14 04:17:52
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.1
2 1997/02/19 20:10:49
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -127,7 +127,7 @@ static void CheckFloat4Val(double val)
raise an elog warning if it is
*/
static
void
CheckFloat8Val
(
double
val
)
void
CheckFloat8Val
(
double
val
)
{
/* defining unsafe floats's will make float4 and float8 ops faster
at the cost of safety, of course! */
...
...
src/include/utils/builtins.h
View file @
6eb05251
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: builtins.h,v 1.
8 1996/11/16 04:59:10
momjian Exp $
* $Id: builtins.h,v 1.
9 1997/02/19 20:11:05
momjian Exp $
*
* NOTES
* This should normally only be included by fmgr.h.
...
...
@@ -260,6 +260,7 @@ extern char *filename_in(char *file);
extern
char
*
filename_out
(
char
*
s
);
/* float.c */
extern
void
CheckFloat8Val
(
double
val
);
/* used by lex */
extern
float32
float4in
(
char
*
num
);
extern
char
*
float4out
(
float32
num
);
extern
float64
float8in
(
char
*
num
);
...
...
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