Changeset: afe8a872f284 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=afe8a872f284
Modified Files:
        java/example/XQueryLoad.java
        sql/common/sql_types.c
Branch: default
Log Message:

Merged from Dec2011


diffs (187 lines):

diff --git a/java/example/SQLcopyinto.java b/java/example/SQLcopyinto.java
--- a/java/example/SQLcopyinto.java
+++ b/java/example/SQLcopyinto.java
@@ -79,8 +79,8 @@ public class SQLcopyinto {
 
                        query = "COPY INTO example FROM STDIN USING DELIMITERS 
',','\\n';";
                        // the leading 's' is essential, since it is a protocol
-                       // marker that should not be ommitted, as much as the
-                       // trailing semi-colon
+                       // marker that should not be omitted, likewise the
+                       // trailing semicolon
                        out.write('s');
                        out.write(query);
                        out.newLine();
diff --git a/java/example/XQueryLoad.java b/java/example/XQueryLoad.java
deleted file mode 100644
--- a/java/example/XQueryLoad.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * The contents of this file are subject to the MonetDB Public License
- * Version 1.1 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://www.monetdb.org/Legal/MonetDBLicense
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific language governing rights and limitations
- * under the License.
- *
- * The Original Code is the MonetDB Database System.
- *
- * The Initial Developer of the Original Code is CWI.
- * Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
- * Copyright August 2008-2012 MonetDB B.V.
- * All Rights Reserved.
- */
-
-import java.sql.*;
-
-/**
- * This is an example showing the use of loading ("shredding") XML
- * documents into MonetDB/XQuery.
- *
- * @author Fabian Groffen <[email protected]>
- */
-public class XQueryLoad {
-       public static void main(String[] args) throws Exception {
-               // make sure the driver is loaded
-               Class.forName("nl.cwi.monetdb.jdbc.MonetDriver");
-               Connection con = 
DriverManager.getConnection("jdbc:monetdb://localhost/notused?language=xquery&xdebug=true",
 "monetdb", "monetdb");
-               Statement st = con.createStatement();
-
-               st.addBatch("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
-               st.addBatch("<doc>");
-               st.addBatch(" <greet kind=\"informal\">Hi </greet>");
-               st.addBatch(" <greet kind=\"casual\">Hello </greet>");
-               st.addBatch(" <location kind=\"global\">World</location>");
-               st.addBatch(" <location kind=\"local\">Amsterdam</location>");
-               st.addBatch("</doc>");
-
-               st.executeBatch();
-
-               /* The name of the document is written as warning to the
-                * Connection's warning stack.  This is kind of dirty, but since
-                * the batch cannot return a string, there is no other way here.
-                */
-               SQLWarning w = con.getWarnings();
-               while (w != null) {
-                       System.out.println(w.getMessage());
-                       w = w.getNextWarning();
-               }
-
-               st.close();
-               con.close();
-       }
-}
diff --git a/sql/common/sql_types.c b/sql/common/sql_types.c
--- a/sql/common/sql_types.c
+++ b/sql/common/sql_types.c
@@ -96,7 +96,7 @@ static int convert_matrix[EC_MAX][EC_MAX
 /* EC_STRING */        { 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
 /* EC_BLOB */  { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
 /* EC_NUM */   { 0, 0, 2, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0 },
-/* EC_INTERVAL*/{ 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0 },
+/* EC_INTERVAL*/{ 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0 },
 /* EC_DEC */   { 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0 },
 /* EC_FLT */   { 0, 0, 0, 1, 1, 0, 1, 3, 1, 1, 0, 0, 0, 0 },
 /* EC_TIME */  { 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0 },
diff --git a/sql/test/BugTracker-2012/Tests/All 
b/sql/test/BugTracker-2012/Tests/All
--- a/sql/test/BugTracker-2012/Tests/All
+++ b/sql/test/BugTracker-2012/Tests/All
@@ -17,3 +17,4 @@ boolean_coersion.Bug-3012
 correlated_groupby_in_selection.Bug-3011
 multicolumn_join.Bug-2998
 simple_select.Bug-2988
+interval_timestamp.Bug-3002
diff --git a/sql/test/BugTracker-2012/Tests/interval_timestamp.Bug-3002.sql 
b/sql/test/BugTracker-2012/Tests/interval_timestamp.Bug-3002.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2012/Tests/interval_timestamp.Bug-3002.sql
@@ -0,0 +1,2 @@
+select '1970-01-01 11:00' - interval '600' second;
+select cast('1970-01-01 11:00' as timestamp) = '1970-01-01 11:00' - interval 
'600' second;
diff --git 
a/sql/test/BugTracker-2012/Tests/interval_timestamp.Bug-3002.stable.err 
b/sql/test/BugTracker-2012/Tests/interval_timestamp.Bug-3002.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2012/Tests/interval_timestamp.Bug-3002.stable.err
@@ -0,0 +1,43 @@
+stderr of test 'interval_timestamp.Bug-3002` in directory 
'test/BugTracker-2012` itself:
+
+
+# 15:55:40 >  
+# 15:55:40 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"gdk_dbfarm=/home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB" "--set" 
"mapi_open=true" "--set" "mapi_port=36462" "--set" "monet_prompt=" "--trace" 
"--forcemito" "--set" "mal_listing=2" "--dbname=mTests_test_BugTracker-2012" 
"--set" "mal_listing=0"
+# 15:55:40 >  
+
+# builtin opt  gdk_dbname = demo
+# builtin opt  gdk_dbfarm = 
/home/niels/scratch/rc-clean/Linux-x86_64/var/monetdb5/dbfarm
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_alloc_map = no
+# builtin opt  gdk_vmtrim = yes
+# 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  gdk_dbfarm = 
/home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB
+# cmdline opt  mapi_open = true
+# cmdline opt  mapi_port = 36462
+# cmdline opt  monet_prompt = 
+# cmdline opt  mal_listing = 2
+# cmdline opt  gdk_dbname = mTests_test_BugTracker-2012
+# cmdline opt  mal_listing = 0
+
+# 15:55:40 >  
+# 15:55:40 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" "--host=niels" 
"--port=36462"
+# 15:55:40 >  
+
+MAPI  = monetdb@niels:36462
+QUERY = select '1970-01-01 11:00' - interval '600' second;
+ERROR = !wrong format (1970-01-01 11:00)
+MAPI  = monetdb@niels:36462
+QUERY = select cast('1970-01-01 11:00' as timestamp) = '1970-01-01 11:00' - 
interval '600' second;
+ERROR = !types sec_interval(19,0) and timestamp(7,0) are not equal
+
+# 15:55:41 >  
+# 15:55:41 >  "Done."
+# 15:55:41 >  
+
diff --git 
a/sql/test/BugTracker-2012/Tests/interval_timestamp.Bug-3002.stable.out 
b/sql/test/BugTracker-2012/Tests/interval_timestamp.Bug-3002.stable.out
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2012/Tests/interval_timestamp.Bug-3002.stable.out
@@ -0,0 +1,30 @@
+stdout of test 'interval_timestamp.Bug-3002` in directory 
'test/BugTracker-2012` itself:
+
+
+# 15:55:40 >  
+# 15:55:40 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"gdk_dbfarm=/home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB" "--set" 
"mapi_open=true" "--set" "mapi_port=36462" "--set" "monet_prompt=" "--trace" 
"--forcemito" "--set" "mal_listing=2" "--dbname=mTests_test_BugTracker-2012" 
"--set" "mal_listing=0"
+# 15:55:40 >  
+
+# MonetDB 5 server v11.7.8
+# This is an unreleased version
+# Serving database 'mTests_test_BugTracker-2012', using 4 threads
+# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically 
linked
+# Found 3.779 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2012 MonetDB B.V., all rights reserved
+# Visit http://www.monetdb.org/ for further information
+# Listening for connection requests on 
mapi:monetdb://niels.nesco.mine.nu:36462/
+# MonetDB/GIS module loaded
+# MonetDB/SQL module loaded
+
+Ready.
+
+# 15:55:40 >  
+# 15:55:40 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" "--host=niels" 
"--port=36462"
+# 15:55:40 >  
+
+
+# 15:55:41 >  
+# 15:55:41 >  "Done."
+# 15:55:41 >  
+
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to