Update of /cvsroot/monetdb/sql/src/backends/monet5
In directory 
sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1387/src/backends/monet5

Modified Files:
      Tag: Feb2010
        sql_result.mx 
Log Message:
propagated changes of Sunday Jan 17 2010 - Monday Jan 18 2010
from the Nov2009 branch to the Feb2010 branch

  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2010/01/17 - nielsnes: src/backends/monet5/sql_result.mx,1.127.2.9
  
  Fixed length of timestamp with timezone
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Index: sql_result.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql_result.mx,v
retrieving revision 1.134
retrieving revision 1.134.2.1
diff -u -d -r1.134 -r1.134.2.1
--- sql_result.mx       7 Jan 2010 15:24:31 -0000       1.134
+++ sql_result.mx       18 Jan 2010 10:36:12 -0000      1.134.2.1
@@ -815,8 +815,8 @@
        return 0;
 }
 
-int 
-export_length( stream *s, int mtype, int eclass, int digits, int scale, bat 
bid, ptr p) 
+static int 
+export_length( stream *s, int mtype, int eclass, int digits, int scale, int 
tz, bat bid, ptr p) 
 {
        int ok = 1;
        size_t count = 0;
@@ -920,14 +920,14 @@
                ok = mvc_send_int(s, 10);
        } else if (eclass == EC_TIME) {
                count = 8;
-               if (scale)      /* time zone */
+               if (tz) /* time zone */
                        count += 6;     /* +03:30 */
                if (digits > 1) /* fractional seconds precision (including dot) 
*/
                        count += digits;
                ok = mvc_send_lng(s, (lng) count);
        } else if (eclass == EC_TIMESTAMP) {
                count = 10 + 1 + 8;
-               if (scale)      /* time zone */
+               if (tz) /* time zone */
                        count += 6;             /* +03:30 */
                if (digits)     /* fractional seconds precision */
                        count += digits;
@@ -964,7 +964,7 @@
            stream_write(s, " # name\n% ", 10, 1) == 1 &&
            stream_write(s, type, strlen(type), 1) == 1 &&
            stream_write(s, " # type\n% ", 10, 1) == 1 &&
-           export_length(s, mtype, eclass, d, sc, 0, p) &&
+           export_length(s, mtype, eclass, d, sc, has_tz(eclass,type), 0, p) &&
            stream_write(s, " # length\n[ ", 12, 1) == 1 &&
            export_value( m, s, eclass, type, d, sc, p, mtype, &buf, &len, ns)) 
                ok = (stream_write(s, rsep, strlen(rsep), 1) == 1);
@@ -1117,7 +1117,7 @@
                int mtype = c->type.type->localtype;
                int eclass = c->type.type->eclass;
 
-               if (!export_length(s, mtype, eclass, c->type.digits, 
c->type.scale, c->b, c->p))
+               if (!export_length(s, mtype, eclass, c->type.digits, 
c->type.scale, type_has_tz(&c->type), c->b, c->p))
                        return export_error(order);
                if (i + 1 < t->nr_cols && stream_write(s, ",\t", 2, 1) != 1)
                        return export_error(order);


------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to