Re: [Monetdb-developers] [Monetdb-sql-checkins] sql/src/backends/monet5 sql_result.mx, , 1.127, 1.128
Shouldn't this have gone to the Nov2009 branch? Martin Kersten wrote:
Update of /cvsroot/monetdb/sql/src/backends/monet5 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv7452
Modified Files: sql_result.mx Log Message: The loader now properly recognizes decimals read as integer values.
U sql_result.mx Index: sql_result.mx =================================================================== RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql_result.mx,v retrieving revision 1.127 retrieving revision 1.128 diff -u -d -r1.127 -r1.128 --- sql_result.mx 23 Sep 2009 07:36:21 -0000 1.127 +++ sql_result.mx 6 Oct 2009 13:30:13 -0000 1.128 @@ -381,8 +381,17 @@ }
len = (*BATatoms[type].atomFromStr)(s, &c->len, (ptr) &c->data); - if (len == 0 || len != e-s) + if (len == 0 || len != e-s){ + /* decimals can be converted to integers when *.000 */ + if ( s[len++] == '.') + switch( type ){ + case TYPE_bte: case TYPE_int: case TYPE_lng: case TYPE_sht: + while (s[len]=='0') len++; + if ( s[len] == 0) + return c->data; + } return NULL; + } return c->data; }
------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Monetdb-sql-checkins mailing list Monetdb-sql-checkins@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins
-- Sjoerd Mullender
participants (1)
-
Sjoerd Mullender