From 71c9f7cf49552486bbee3504a96eb8ca4b86b5fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Tue, 10 Nov 2009 15:24:40 +0100
Subject: [PATCH] DECIMAL numbers aren't integers.

Rev: src/modules/Mysql/result.c:1.50
---
 src/modules/Mysql/result.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/modules/Mysql/result.c b/src/modules/Mysql/result.c
index f73bb284f5..35fb9d70e8 100644
--- a/src/modules/Mysql/result.c
+++ b/src/modules/Mysql/result.c
@@ -2,7 +2,7 @@
 || This file is part of Pike. For copyright information see COPYRIGHT.
 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 || for more information.
-|| $Id: result.c,v 1.49 2009/11/10 09:34:10 grubba Exp $
+|| $Id: result.c,v 1.50 2009/11/10 14:24:40 grubba Exp $
 */
 
 /*
@@ -579,7 +579,6 @@ static void f_fetch_row(INT32 args)
 	    (field = mysql_fetch_field(PIKE_MYSQL_RES->result))) {
 	  switch (field->type) {
 	    /* Integer types */
-	  case FIELD_TYPE_DECIMAL:
           case FIELD_TYPE_LONGLONG:
 #ifdef AUTO_BIGNUM
 	    if (
@@ -606,6 +605,9 @@ static void f_fetch_row(INT32 args)
 	  case FIELD_TYPE_DOUBLE:
 	    push_float(atof(row[i]));
 	    break;
+	  case FIELD_TYPE_DECIMAL:
+	    /* Fixed-point number. */
+	    /* FIXME: Convert to Gmp.mpr? */
 	  default:
 #ifdef HAVE_MYSQL_FETCH_LENGTHS
 	    push_string(make_shared_binary_string(row[i], row_lengths[i]));
-- 
GitLab