Changeset: d308dfce812a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d308dfce812a
Added Files:
        
sql/test/BugTracker-2014/Tests/outer_join_using_diff_types_using.Bug-3536.sql
        
sql/test/BugTracker-2014/Tests/outer_join_using_diff_types_using.Bug-3536.stable.err
        
sql/test/BugTracker-2014/Tests/outer_join_using_diff_types_using.Bug-3536.stable.out
Modified Files:
        MonetDB.spec
        configure.ag
        monetdb5/extras/rapi/Makefile.ag
        sql/backends/monet5/bam/Makefile.ag
        sql/server/rel_select.c
        sql/test/BugTracker-2014/Tests/All
Branch: default
Log Message:

Merge with Oct2014 branch.


diffs (286 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -40,6 +40,10 @@
 %define with_samtools 1
 %endif
 
+%if %{?_with_rintegration:1}%{!?_with_rintegration:0}
+%define with_rintegration 1
+%endif
+
 Name: %{name}
 Version: %{version}
 Release: %{release}
@@ -85,6 +89,9 @@ BuildRequires: zlib-devel
 %if %{?with_samtools:1}%{!?with_samtools:0}
 BuildRequires: samtools-devel
 %endif
+%if %{?with_rintegration:1}%{!?with_rintegration:0}
+BuildRequires: R-core-devel
+%endif
 
 # need to define python_sitelib on RHEL 5 and older
 # no need to define python3_sitelib: it's defined by python3-devel
@@ -479,6 +486,34 @@ version of Sequence Alignment/Map) data.
 %{_libdir}/monetdb5/lib_bam.so
 %endif
 
+%if %{?_with_rintegration:1}%{!?_with_rintegration:0}
+%package R
+Summary: MonetDB5 SQL interface to the bam library
+Group: Applications/Databases
+Requires: MonetDB5-server = %{version}-%{release}
+Requires: MonetDB-SQL-server5 = %{version}-%{release}
+
+%description R
+MonetDB is a database management system that is developed from a
+main-memory perspective with use of a fully decomposed storage model,
+automatic index management, extensibility of data types and search
+accelerators.  It also has an SQL frontend.
+
+This package contains the interface to use the R language from within
+SQL queries.
+
+NOTE: INSTALLING THIS PACKAGE OPENS UP SECURITY ISSUES.  If you don't
+know how this package affects the security of your system, do not
+install it.
+
+%files R
+%defattr(-,root,root)
+%{_includedir}/monetdb/rapi*.h
+%{_libdir}/monetdb5/rapi.*
+%{_libdir}/monetdb5/autoload/*_rapi.mal
+%{_libdir}/monetdb5/lib_rapi.so
+%endif
+
 %package -n MonetDB5-server
 Summary: MonetDB - Monet Database Management System
 Group: Applications/Databases
@@ -528,6 +563,9 @@ fi
 %exclude %{_libdir}/monetdb5/geom.mal
 %endif
 %exclude %{_libdir}/monetdb5/gsl.mal
+%if %{?_with_rintegration:1}%{!?_with_rintegration:0}
+%exclude %{_libdir}/monetdb5/rapi.mal
+%endif
 # %exclude %{_libdir}/monetdb5/rdf.mal
 %exclude %{_libdir}/monetdb5/sql.mal
 %{_libdir}/monetdb5/*.mal
@@ -535,6 +573,9 @@ fi
 %exclude %{_libdir}/monetdb5/autoload/*_geom.mal
 %endif
 %exclude %{_libdir}/monetdb5/autoload/*_gsl.mal
+%if %{?_with_rintegration:1}%{!?_with_rintegration:0}
+%exclude %{_libdir}/monetdb5/autoload/*_rapi.mal
+%endif
 # %exclude %{_libdir}/monetdb5/autoload/*_rdf.mal
 %exclude %{_libdir}/monetdb5/autoload/*_sql.mal
 %{_libdir}/monetdb5/autoload/*.mal
@@ -542,6 +583,9 @@ fi
 %exclude %{_libdir}/monetdb5/lib_geom.so
 %endif
 %exclude %{_libdir}/monetdb5/lib_gsl.so
+%if %{?_with_rintegration:1}%{!?_with_rintegration:0}
+%exclude %{_libdir}/monetdb5/lib_rapi.so
+%endif
 %if %{?_with_samtools:1}%{!?_with_samtools:0}
 %exclude %{_libdir}/monetdb5/bam.mal
 %exclude %{_libdir}/monetdb5/autoload/*_bam.mal
@@ -783,6 +827,7 @@ developer, but if you do want to test, t
        --enable-optimize=yes \
        --enable-profile=no \
        --enable-rdf=no \
+       
--enable-rintegration=%{?with_rintegration:yes}%{!?with_rintegration:no} \
        --enable-sql=yes \
        --enable-strict=no \
        --enable-testing=yes \
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -3479,7 +3479,6 @@ for comp in \
        'gdk         ' \
        'monetdb5    ' \
        'sql         ' \
-       'jaql        ' \
        'geom        ' \
        'gsl         ' \
        'fits        ' \
diff --git a/monetdb5/extras/rapi/Makefile.ag b/monetdb5/extras/rapi/Makefile.ag
--- a/monetdb5/extras/rapi/Makefile.ag
+++ b/monetdb5/extras/rapi/Makefile.ag
@@ -28,16 +28,10 @@ MTSAFE
 lib__rapi = {
        MODULE
        DIR = libdir/monetdb5
-       SOURCES = rapi.c
+       SOURCES = rapi.c rapi.h
        LIBS = $(libr_LIBS)
 }
 
-headers_h = {
-       DIR = includedir/monetdb
-       HEADERS = h
-       SOURCES = rapi.h 
-}
-
 headers_rapi_mal = {
        HEADERS = mal
        DIR = libdir/monetdb5
@@ -57,4 +51,3 @@ headers_autoload = {
 }
 
 EXTRA_DIST_DIR = Tests
-EXTRA_DIST = 50_rapi.mal rapi.mal rapi.R
diff --git a/sql/backends/monet5/bam/Makefile.ag 
b/sql/backends/monet5/bam/Makefile.ag
--- a/sql/backends/monet5/bam/Makefile.ag
+++ b/sql/backends/monet5/bam/Makefile.ag
@@ -37,11 +37,12 @@ lib__bam = {
        MODULE
        DIR = libdir/monetdb5
        SOURCES = bam_loader.c bam_loader.h \
-                         bam_wrapper.c bam_wrapper.h \
-                         bam_db_interface.c bam_db_interface.h \
-                         bam_globals.c bam_globals.h \
-                         bam_lib.c bam_lib.h \
-                         bam_export.c bam_export.h
+                 bam_wrapper.c bam_wrapper.h \
+                 bam_db_interface.c bam_db_interface.h \
+                 bam_globals.c bam_globals.h \
+                 bam_lib.c bam_lib.h \
+                 bam_export.c bam_export.h \
+                 mykstring.h
        LIBS = ../../../../monetdb5/tools/libmonetdb5 \
                   ../../../../gdk/libbat \
                   $(SAMTOOLS_LIBS)
diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -5544,8 +5544,12 @@ rel_joinquery_(mvc *sql, sql_rel *rel, s
                                return NULL;
                        }
                        rel = rel_compare_exp(sql, rel, ls, rs, "=", NULL, 
TRUE);
-                       cond = rel_unop_(sql, ls, NULL, "isnull", card_value);
-                       ls = rel_nop_(sql, cond, rs, ls, NULL, NULL, 
"ifthenelse", card_value);
+                       if (op != op_join) {
+                               cond = rel_unop_(sql, ls, NULL, "isnull", 
card_value);
+                               if (rel_convert_types(sql, &ls, &rs, 1, 
type_equal) < 0)
+                                       return NULL;
+                               ls = rel_nop_(sql, cond, rs, ls, NULL, NULL, 
"ifthenelse", card_value);
+                       }
                        exp_setname(sql->sa, ls, rnme, nm);
                        append(outexps, ls);
                        if (!rel) 
diff --git a/sql/test/BugTracker-2014/Tests/All 
b/sql/test/BugTracker-2014/Tests/All
--- a/sql/test/BugTracker-2014/Tests/All
+++ b/sql/test/BugTracker-2014/Tests/All
@@ -30,3 +30,4 @@ union_with_subqueries.Bug-3518
 unsafe_project_push_down.Bug-3523
 non_groupby_column.Bug-3524
 orderby_count.Bug-3526
+outer_join_using_diff_types_using.Bug-3536
diff --git 
a/sql/test/BugTracker-2014/Tests/outer_join_using_diff_types_using.Bug-3536.sql 
b/sql/test/BugTracker-2014/Tests/outer_join_using_diff_types_using.Bug-3536.sql
new file mode 100644
--- /dev/null
+++ 
b/sql/test/BugTracker-2014/Tests/outer_join_using_diff_types_using.Bug-3536.sql
@@ -0,0 +1,9 @@
+
+create table test_a (a integer);
+create table test_b (a smallint);
+
+select * from test_a join test_b using (a);
+select * from test_a left outer join test_b using (a);
+
+drop table test_a;
+drop table test_b;
diff --git 
a/sql/test/BugTracker-2014/Tests/outer_join_using_diff_types_using.Bug-3536.stable.err
 
b/sql/test/BugTracker-2014/Tests/outer_join_using_diff_types_using.Bug-3536.stable.err
new file mode 100644
--- /dev/null
+++ 
b/sql/test/BugTracker-2014/Tests/outer_join_using_diff_types_using.Bug-3536.stable.err
@@ -0,0 +1,35 @@
+stderr of test 'outer_join_using_diff_types_using.Bug-3536` in directory 
'sql/test/BugTracker-2014` itself:
+
+
+# 11:45:36 >  
+# 11:45:36 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=31021" "--set" 
"mapi_usock=/var/tmp/mtest-13021/.s.monetdb.31021" "--set" "monet_prompt=" 
"--forcemito" "--set" "mal_listing=2" 
"--dbpath=/home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2014"
 "--set" "mal_listing=0"
+# 11:45:36 >  
+
+# builtin opt  gdk_dbpath = 
/home/niels/scratch/rc-clean/Linux-x86_64/var/monetdb5/dbfarm/demo
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_vmtrim = no
+# builtin opt  monet_prompt = >
+# builtin opt  monet_daemon = no
+# builtin opt  mapi_port = 50000
+# builtin opt  mapi_open = false
+# builtin opt  mapi_autosense = false
+# builtin opt  sql_optimizer = default_pipe
+# builtin opt  sql_debug = 0
+# cmdline opt  gdk_nr_threads = 0
+# cmdline opt  mapi_open = true
+# cmdline opt  mapi_port = 31021
+# cmdline opt  mapi_usock = /var/tmp/mtest-13021/.s.monetdb.31021
+# cmdline opt  monet_prompt = 
+# cmdline opt  mal_listing = 2
+# cmdline opt  gdk_dbpath = 
/home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2014
+# cmdline opt  mal_listing = 0
+
+# 11:45:36 >  
+# 11:45:36 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-13021" "--port=31021"
+# 11:45:36 >  
+
+
+# 11:45:36 >  
+# 11:45:36 >  "Done."
+# 11:45:36 >  
+
diff --git 
a/sql/test/BugTracker-2014/Tests/outer_join_using_diff_types_using.Bug-3536.stable.out
 
b/sql/test/BugTracker-2014/Tests/outer_join_using_diff_types_using.Bug-3536.stable.out
new file mode 100644
--- /dev/null
+++ 
b/sql/test/BugTracker-2014/Tests/outer_join_using_diff_types_using.Bug-3536.stable.out
@@ -0,0 +1,46 @@
+stdout of test 'outer_join_using_diff_types_using.Bug-3536` in directory 
'sql/test/BugTracker-2014` itself:
+
+
+# 11:45:36 >  
+# 11:45:36 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=31021" "--set" 
"mapi_usock=/var/tmp/mtest-13021/.s.monetdb.31021" "--set" "monet_prompt=" 
"--forcemito" "--set" "mal_listing=2" 
"--dbpath=/home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2014"
 "--set" "mal_listing=0"
+# 11:45:36 >  
+
+# MonetDB 5 server v11.17.22
+# This is an unreleased version
+# Serving database 'mTests_sql_test_BugTracker-2014', using 4 threads
+# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically 
linked
+# Found 7.334 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2014 MonetDB B.V., all rights reserved
+# Visit http://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://localhost.nes.nl:31021/
+# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-13021/.s.monetdb.31021
+# MonetDB/GIS module loaded
+# MonetDB/JAQL module loaded
+# MonetDB/SQL module loaded
+
+Ready.
+
+# 11:45:36 >  
+# 11:45:36 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-13021" "--port=31021"
+# 11:45:36 >  
+
+#create table test_a (a integer);
+#create table test_b (a smallint);
+#select * from test_a join test_b using (a);
+% sys.L1 # table_name
+% a # name
+% int # type
+% 1 # length
+#select * from test_a left outer join test_b using (a);
+% .L1 # table_name
+% a # name
+% int # type
+% 1 # length
+#drop table test_a;
+#drop table test_b;
+
+# 11:45:36 >  
+# 11:45:36 >  "Done."
+# 11:45:36 >  
+
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to