File tree Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.9 1997/02/14 04:15:59 momjian Exp $
11
+ * $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.10 1997/02/19 20:10:38 momjian Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
20
20
#include < stdlib.h>
21
21
#endif /* __linux__ */
22
22
#include < string.h>
23
+ #include < errno.h>
23
24
24
25
#include " postgres.h"
25
26
#include " miscadmin.h"
30
31
#include " parser/scansup.h"
31
32
#include " parser/sysfunc.h"
32
33
#include " parse.h"
34
+ #include " utils/builtins.h"
33
35
34
36
extern char *parseString;
35
37
extern char *parseCh;
@@ -109,8 +111,13 @@ other .
109
111
return (ICONST);
110
112
}
111
113
{real } {
112
- yylval.dval = atof ((char *)yytext);
113
- return (FCONST);
114
+ char * endptr;
115
+ errno = 0 ;
116
+ yylval.dval = strtod (((char *)yytext),&endptr);
117
+ if (*endptr != ' \0 ' || errno == ERANGE)
118
+ elog (WARN," \t Bad float8 input format\n " );
119
+ CheckFloat8Val (yylval.dval );
120
+ return (FCONST);
114
121
}
115
122
{quote } {
116
123
char literal[MAX_PARSE_BUFFER];
Original file line number Diff line number Diff line change 7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.11 1997/02/14 04:17:52 momjian Exp $
10
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.12 1997/02/19 20:10:49 momjian Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -127,7 +127,7 @@ static void CheckFloat4Val(double val)
127
127
128
128
raise an elog warning if it is
129
129
*/
130
- static void CheckFloat8Val (double val )
130
+ void CheckFloat8Val (double val )
131
131
{
132
132
/* defining unsafe floats's will make float4 and float8 ops faster
133
133
at the cost of safety, of course! */
Original file line number Diff line number Diff line change 6
6
*
7
7
* Copyright (c) 1994, Regents of the University of California
8
8
*
9
- * $Id: builtins.h,v 1.8 1996/11/16 04:59:10 momjian Exp $
9
+ * $Id: builtins.h,v 1.9 1997/02/19 20:11:05 momjian Exp $
10
10
*
11
11
* NOTES
12
12
* This should normally only be included by fmgr.h.
@@ -260,6 +260,7 @@ extern char *filename_in(char *file);
260
260
extern char * filename_out (char * s );
261
261
262
262
/* float.c */
263
+ extern void CheckFloat8Val (double val ); /* used by lex */
263
264
extern float32 float4in (char * num );
264
265
extern char * float4out (float32 num );
265
266
extern float64 float8in (char * num );
You can’t perform that action at this time.
0 commit comments