Update of /cvsroot/monetdb/sql/src/server
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv24178/src/server

Modified Files:
      Tag: Aug2009
        sql_parser.mx 
Log Message:
fixed bug, ie handle 0.0 correctly as a decimal(1,0)
fixed bug, ie decimal(d,s) d < 19 and s < d (not d+s < 19)
make sure we flush all inserts to disk when we restart the log



U sql_parser.mx
Index: sql_parser.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/server/sql_parser.mx,v
retrieving revision 1.312.2.2
retrieving revision 1.312.2.3
diff -u -d -r1.312.2.2 -r1.312.2.3
--- sql_parser.mx       4 Aug 2009 12:53:39 -0000       1.312.2.2
+++ sql_parser.mx       4 Aug 2009 22:15:23 -0000       1.312.2.3
@@ -3847,6 +3847,8 @@
                  int scale = digits - (int) (dot-s);
                  sql_subtype t;
 
+                 if (digits <= 0)
+                       digits = 1;
                  if (digits <= 18) {
                        double val = strtod($1,NULL);
                        lng value = decimal_from_str(s);
@@ -4263,12 +4265,12 @@
                        { 
                          int d = $3;
                          int s = $5;
-                         if (s > d || s + d > 18) {
+                         if (s > d || d > 18) {
                                char *msg = NULL;
                                if (s > d)
                                        msg = sql_message("scale (%d) should be 
less or equal to the precision (%d)", s, d);
                                else
-                                       msg = sql_message("decimal(%d,%d) isn't 
supported because P=%d + S=%d > 18", d, s, d, s);
+                                       msg = sql_message("decimal(%d,%d) isn't 
supported because P=%d > 18", d, s, d);
                                yyerror(msg);
                                _DELETE(msg);
                                $$.type = NULL;


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to