Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit575c40a

Browse files
author
Thomas G. Lockhart
committed
Handle conversion of floating point constants to internal strings.
1 parent8d21a6e commit575c40a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

‎src/backend/parser/parse_expr.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.43 1999/04/23 19:37:41 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.44 1999/05/12 07:14:24 thomas Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -642,9 +642,12 @@ parser_typecast(Value *expr, TypeName *typename, int32 atttypmod)
642642
const_string=DatumGetPointer(expr->val.str);
643643
break;
644644
caseT_Integer:
645-
const_string= (char*)palloc(256);
646645
string_palloced= true;
647-
sprintf(const_string,"%ld",expr->val.ival);
646+
const_string=int4out(expr->val.ival);
647+
break;
648+
caseT_Float:
649+
string_palloced= true;
650+
const_string=float8out(&expr->val.dval);
648651
break;
649652
default:
650653
elog(ERROR,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp