Update of /cvsroot/monetdb/sql/src/backends/monet5
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv15869
Modified Files:
Tag: Nov2009
sql_result.mx
Log Message:
Backport:
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.127.2.1
diff -u -d -r1.127 -r1.127.2.1
--- sql_result.mx 23 Sep 2009 07:36:21 -0000 1.127
+++ sql_result.mx 6 Oct 2009 14:50:53 -0000 1.127.2.1
@@ -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
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins