Changeset: 940183ddc2a0 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=940183ddc2a0
Added Files:
        README.rst
Removed Files:
        README
Modified Files:
        HowToStart.rst
        Makefile.ag
        monetdb5/extras/rapi/Tests/rapi08.malC
        sql/backends/monet5/vaults/bam/bam_wrapper.c
        sql/server/sql_parser.y
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (220 lines):

diff --git a/HowToStart.rst b/HowToStart.rst
--- a/HowToStart.rst
+++ b/HowToStart.rst
@@ -24,7 +24,7 @@ This document assumes that you are plann
 installing MonetDB on a Unix-like system (e.g., Linux, IRIX, Solaris,
 AIX, Mac OS X/Darwin, or CYGWIN).  For compilation and installation on
 a native Windows system (NT, 2000, XP) see the instructions in the
-file `../buildtools/doc/windowsbuild.rst`__.
+file `buildtools/doc/windowsbuild.rst`__.
 
 __ http://dev.monetdb.org/downloads/
 __ Windows-Installation.html
diff --git a/Makefile.ag b/Makefile.ag
--- a/Makefile.ag
+++ b/Makefile.ag
@@ -13,7 +13,7 @@ SUBDIRS = buildtools common clients \
        HAVE_TESTING?testing \
 
 EXTRA_DIST = bootstrap configure configure.ac configure.ag libversions \
-                        MonetDB.spec rpm.mk.in COPYING README license.txt 
HowToStart.rst
+                        MonetDB.spec rpm.mk.in COPYING README.rst license.txt 
HowToStart.rst
 
 EXTRA_DIST_DIR = NT debian MacOSX
 
diff --git a/README b/README
deleted file mode 100644
--- a/README
+++ /dev/null
@@ -1,26 +0,0 @@
-The MonetDB Database System
-===========================
-
-The MonetDB database is developed by the CWI database research group
-(see http://www.monetdb.org/).
-
-Via the MonetDB project we have brought the MonetDB system in open source,
-where it is accessible at http://www.monetdb.org/Downloads/
-
-The MonetDB database system is a high-performance database kernel for
-query-intensive applications. The MonetDB kernel works together with an
-SQL frontend that is in a separate CVS module.
-
-If you got a source distribution, please compile and install MonetDB first,
-following the instructions in the file 'HowToStart.rst' (for Unix)
-or 'buildtools/doc/windowsbuild.rst' (for Windows).
-
-
-Copyright Notice
-================
-
-This Source Code Form is subject to the terms of the Mozilla Public
-License, v. 2.0.  If a copy of the MPL was not distributed with this
-file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-Copyright 1997 - July 2008 CWI, August 2008 - 2017 MonetDB B.V.
diff --git a/README.rst b/README.rst
new file mode 100644
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,34 @@
+The MonetDB Database System
+===========================
+
+The MonetDB database is developed by the CWI database research group
+(see http://www.monetdb.org/).
+
+Via the MonetDB project we have brought the MonetDB system in open source,
+where it is accessible at http://www.monetdb.org/Downloads/
+
+The MonetDB database system is a high-performance database kernel for
+query-intensive applications. The MonetDB source can be found at our `Mercurial
+server`__. There is also a `github mirror`__ that is updated once a day.
+
+.. _MonetDB: http://dev.monetdb.org/hg/MonetDB/
+__ MonetDB_
+
+.. _github: https://github.com/MonetDB/MonetDB
+__ github_
+
+If you got a source distribution, please compile and install MonetDB first,
+following the instructions in the file `HowToStart.rst`__ (for Unix)
+or `buildtools/doc/windowsbuild.rst`__ (for Windows).
+
+__ HowToStart.rst
+__ buildtools/doc/windowsbuild.rst
+
+Copyright Notice
+================
+
+This Source Code Form is subject to the terms of the Mozilla Public
+License, v. 2.0.  If a copy of the MPL was not distributed with this
+file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+Copyright 1997 - July 2008 CWI, August 2008 - 2017 MonetDB B.V.
diff --git a/sql/backends/monet5/vaults/bam/bam_wrapper.c 
b/sql/backends/monet5/vaults/bam/bam_wrapper.c
--- a/sql/backends/monet5/vaults/bam/bam_wrapper.c
+++ b/sql/backends/monet5/vaults/bam/bam_wrapper.c
@@ -1613,13 +1613,16 @@ bam1_t2alignment(bam_wrapper * bw, lng v
                a_out->cigar[1] = '\0';
        } else {
                uint32_t *cigar_bin = bam1_cigar(a_in);
+               uint32_t c;
                int index = 0;
 
                for (i = 0; i < a_in->core.n_cigar; ++i) {
+                       /* work around unaligned access */
+                       memcpy(&c, &cigar_bin[i], sizeof(c));
                        snprintf(&a_out->cigar[index],
                                 a_out->cigar_size - index, "%u%c",
-                                cigar_bin[i] >> BAM_CIGAR_SHIFT,
-                                bam_cigar_opchr(cigar_bin[i]));
+                                c >> BAM_CIGAR_SHIFT,
+                                bam_cigar_opchr(c));
                        index += strlen(&a_out->cigar[index]);
                }
        }
@@ -1750,25 +1753,37 @@ write_aux_bam1_t(bam_wrapper * bw, bam1_
                        kputw(*(int8_t *) s, &aux_value_stream);
                        ++s;
                } else if (type == 'S') {
+                       uint16_t u;
+                       memcpy(&u, s, sizeof(uint16_t));
                        type_str[0] = 'i';
-                       kputw(*(uint16_t *) s, &aux_value_stream);
+                       kputw(u, &aux_value_stream);
                        s += 2;
                } else if (type == 's') {
+                       int16_t i;
+                       memcpy(&i, s, sizeof(int16_t));
                        type_str[0] = 'i';
-                       kputw(*(int16_t *) s, &aux_value_stream);
+                       kputw(i, &aux_value_stream);
                        s += 2;
                } else if (type == 'I') {
+                       uint32_t u;
+                       memcpy(&u, s, sizeof(uint32_t));
                        type_str[0] = 'i';
-                       kputuw(*(uint32_t *) s, &aux_value_stream);
+                       kputuw(u, &aux_value_stream);
                        s += 4;
                } else if (type == 'i') {
-                       kputw(*(int32_t *) s, &aux_value_stream);
+                       int32_t i;
+                       memcpy(&i, s, sizeof(int32_t));
+                       kputw(i, &aux_value_stream);
                        s += 4;
                } else if (type == 'f') {
-                       ksprintf(&aux_value_stream, "%g", *(float *) s);
+                       float f;
+                       memcpy(&f, s, sizeof(float));
+                       ksprintf(&aux_value_stream, "%g", f);
                        s += 4;
                } else if (type == 'd') {
-                       ksprintf(&aux_value_stream, "%lg", *(double *) s);
+                       double d;
+                       memcpy(&d, s, sizeof(double));
+                       ksprintf(&aux_value_stream, "%lg", d);
                        s += 8;
                } else if (type == 'Z' || type == 'H') {
                        while (*s) {
@@ -1794,24 +1809,29 @@ write_aux_bam1_t(bam_wrapper * bw, bam1_
                                                  &aux_value_stream);
                                        ++s;
                                } else if ('s' == sub_type) {
-                                       kputw(*(int16_t *) s,
-                                                 &aux_value_stream);
+                                       int16_t i;
+                                       memcpy(&i, s, sizeof(int16_t));
+                                       kputw(i, &aux_value_stream);
                                        s += 2;
                                } else if ('S' == sub_type) {
-                                       kputw(*(uint16_t *) s,
-                                                 &aux_value_stream);
+                                       uint16_t u;
+                                       memcpy(&u, s, sizeof(uint16_t));
+                                       kputw(u, &aux_value_stream);
                                        s += 2;
                                } else if ('i' == sub_type) {
-                                       kputw(*(int32_t *) s,
-                                                 &aux_value_stream);
+                                       int32_t i;
+                                       memcpy(&i, s, sizeof(int32_t));
+                                       kputw(i, &aux_value_stream);
                                        s += 4;
                                } else if ('I' == sub_type) {
-                                       kputuw(*(uint32_t *) s,
-                                                  &aux_value_stream);
+                                       uint32_t u;
+                                       memcpy(&u, s, sizeof(uint32_t));
+                                       kputuw(u, &aux_value_stream);
                                        s += 4;
                                } else if ('f' == sub_type) {
-                                       ksprintf(&aux_value_stream, "%g",
-                                                *(float *) s);
+                                       float f;
+                                       memcpy(&f, s, sizeof(float));
+                                       ksprintf(&aux_value_stream, "%g", f);
                                        s += 4;
                                }
                        }
diff --git a/sql/server/sql_parser.y b/sql/server/sql_parser.y
--- a/sql/server/sql_parser.y
+++ b/sql/server/sql_parser.y
@@ -4441,10 +4441,12 @@ literal:
                  if (!err) {
                    int bits = digits2bits(digits), obits = bits;
 
-                   for (;(one<<(bits-1)) > value; bits--)
-                           ;
-                  
-                   if (bits != obits && 
+                   while (bits > 0 &&
+                          (bits == sizeof(value) * 8 ||
+                           (one << (bits - 1)) > value))
+                         bits--;
+
+                   if (bits != obits &&
                       (bits == 8 || bits == 16 || bits == 32 || bits == 64))
                                bits++;
                
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to