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

Modified Files:
      Tag: Nov2009
        sql_result.mx 
Log Message:

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.127.2.8
retrieving revision 1.127.2.9
diff -u -d -r1.127.2.8 -r1.127.2.9
--- sql_result.mx       7 Jan 2010 15:18:28 -0000       1.127.2.8
+++ sql_result.mx       17 Jan 2010 12:47:07 -0000      1.127.2.9
@@ -816,8 +816,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;
@@ -921,14 +921,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;
@@ -965,7 +965,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);
@@ -1118,7 +1118,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