Changeset: b97f074c6a95 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b97f074c6a95
Added Files:
        sql/test/BugTracker-2015/Tests/case_type.Bug-3821.sql
        sql/test/BugTracker-2015/Tests/case_type.Bug-3821.stable.err
        sql/test/BugTracker-2015/Tests/case_type.Bug-3821.stable.out
        sql/test/BugTracker-2015/Tests/crash_in_reduce_groupby.Bug-3818.sql
        
sql/test/BugTracker-2015/Tests/crash_in_reduce_groupby.Bug-3818.stable.err
        
sql/test/BugTracker-2015/Tests/crash_in_reduce_groupby.Bug-3818.stable.out
        
sql/test/BugTracker-2015/Tests/crash_in_reduce_groupby.Bug-3818.stable.out.int128
        sql/test/BugTracker-2015/Tests/crash_timestamp_convert.Bug-3816.sql
        
sql/test/BugTracker-2015/Tests/crash_timestamp_convert.Bug-3816.stable.err
        
sql/test/BugTracker-2015/Tests/crash_timestamp_convert.Bug-3816.stable.out
        sql/test/BugTracker-2015/Tests/duplicate-constraint.Bug-3820.sql
        sql/test/BugTracker-2015/Tests/duplicate-constraint.Bug-3820.stable.err
        sql/test/BugTracker-2015/Tests/duplicate-constraint.Bug-3820.stable.out
        
sql/test/BugTracker-2015/Tests/fractional_precision_limitation.Bug-3808.sql
        
sql/test/BugTracker-2015/Tests/fractional_precision_limitation.Bug-3808.stable.err
        
sql/test/BugTracker-2015/Tests/fractional_precision_limitation.Bug-3808.stable.out
        sql/test/BugTracker-2015/Tests/like-escape.Bug-3822.sql
        sql/test/BugTracker-2015/Tests/like-escape.Bug-3822.stable.err
        sql/test/BugTracker-2015/Tests/like-escape.Bug-3822.stable.out
        sql/test/BugTracker-2015/Tests/local-remotetable-crash.Bug-3754.SQL.py
        sql/test/BugTracker-2015/Tests/timestamp_convert.Bug-3815.sql
        sql/test/BugTracker-2015/Tests/timestamp_convert.Bug-3815.stable.err
        sql/test/BugTracker-2015/Tests/timestamp_convert.Bug-3815.stable.out
        sql/test/Users/Tests/schemaRights.SQL.py
        sql/test/Users/Tests/schemaRights.stable.err
        sql/test/Users/Tests/schemaRights.stable.out
Removed Files:
        gdk/gdk_mapreduce.c
        gdk/gdk_mapreduce.h
        sql/test/BugTracker-2015/Tests/local-remotetable-crash.Bug-3754.sql
Modified Files:
        NT/monetdb_config.h.in
        clients/Tests/exports.stable.out
        clients/mapiclient/mclient.c
        clients/mapiclient/tomograph.c
        clients/php/examples/query.php
        clients/php/lib/php_monetdb.php
        clients/ruby/lib/MonetDB.rb
        clients/ruby/lib/MonetDBConnection.rb
        clients/ruby/lib/MonetDBData.rb
        configure.ag
        gdk/Makefile.ag
        gdk/gdk_bat.c
        gdk/gdk_join.c
        java/src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java
        java/src/main/java/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java
        monetdb5/modules/atoms/json.c
        monetdb5/modules/kernel/aggr.c
        monetdb5/modules/mal/Tests/remote12.stable.out
        monetdb5/modules/mal/pcre.c
        sql/ChangeLog
        sql/backends/monet5/sql.c
        sql/benchmarks/ssbm/Tests/01-explain.stable.out
        sql/benchmarks/ssbm/Tests/02-explain.stable.out
        sql/benchmarks/ssbm/Tests/03-explain.stable.out
        sql/benchmarks/ssbm/Tests/04-explain.stable.out
        sql/benchmarks/ssbm/Tests/05-explain.stable.out
        sql/benchmarks/ssbm/Tests/06-explain.stable.out
        sql/benchmarks/ssbm/Tests/07-explain.stable.out
        sql/benchmarks/ssbm/Tests/08-explain.stable.out
        sql/benchmarks/ssbm/Tests/09-explain.stable.out
        sql/benchmarks/ssbm/Tests/10-explain.stable.out
        sql/benchmarks/ssbm/Tests/11-explain.stable.out
        sql/benchmarks/ssbm/Tests/12-explain.stable.out
        sql/benchmarks/ssbm/Tests/13-explain.stable.out
        sql/benchmarks/tpch/Tests/01-explain.stable.out
        sql/benchmarks/tpch/Tests/01-explain.stable.out.32bit
        sql/benchmarks/tpch/Tests/03-explain.stable.out
        sql/benchmarks/tpch/Tests/04-explain.stable.out.32bit
        sql/benchmarks/tpch/Tests/05-explain.stable.out
        sql/benchmarks/tpch/Tests/05-explain.stable.out.32bit
        sql/benchmarks/tpch/Tests/06-explain.stable.out
        sql/benchmarks/tpch/Tests/07-explain.stable.out
        sql/benchmarks/tpch/Tests/08-explain.stable.out
        sql/benchmarks/tpch/Tests/09-explain.stable.out
        sql/benchmarks/tpch/Tests/10-explain.stable.out
        sql/benchmarks/tpch/Tests/11-explain.stable.out
        sql/benchmarks/tpch/Tests/14-explain.stable.out
        sql/benchmarks/tpch/Tests/15-explain.stable.out
        sql/benchmarks/tpch/Tests/17-explain.stable.out
        sql/benchmarks/tpch/Tests/18-explain.stable.out
        sql/benchmarks/tpch/Tests/19-explain.stable.out
        sql/benchmarks/tpch/Tests/20-explain.stable.out
        sql/benchmarks/tpch/Tests/20-explain.stable.out.32bit
        sql/benchmarks/tpch/Tests/22-explain.stable.out
        sql/benchmarks/tpch/Tests/22-explain.stable.out.32bit
        sql/common/sql_types.c
        sql/common/sql_types.h
        sql/server/rel_optimizer.c
        sql/server/rel_psm.c
        sql/server/rel_schema.c
        sql/server/rel_select.c
        sql/server/rel_sequence.c
        sql/server/sql_privileges.c
        sql/server/sql_privileges.h
        sql/storage/store.c
        sql/test/BugTracker-2010/Tests/rank-over-crash.SF-2926454.stable.out
        sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.stable.out
        sql/test/BugTracker-2013/Tests/between.Bug-3259.stable.out
        sql/test/BugTracker-2013/Tests/between.Bug-3259.stable.out.int128.single
        sql/test/BugTracker-2013/Tests/between.Bug-3259.stable.out.single
        sql/test/BugTracker-2015/Tests/All
        sql/test/BugTracker-2015/Tests/crash.Bug-3736.stable.out
        sql/test/BugTracker-2015/Tests/large_join.Bug-3809.sql
        sql/test/BugTracker-2015/Tests/large_join.Bug-3809.stable.out
        
sql/test/BugTracker-2015/Tests/local-remotetable-crash.Bug-3754.stable.err
        sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out.32bit
        sql/test/Users/Tests/All
        sql/test/leaks/Tests/check0.stable.out
        sql/test/leaks/Tests/check0.stable.out.int128
        sql/test/leaks/Tests/check1.stable.out
        sql/test/leaks/Tests/check2.stable.out
        sql/test/leaks/Tests/check3.stable.out
        sql/test/leaks/Tests/check4.stable.out
        sql/test/leaks/Tests/check5.stable.out
        sql/test/leaks/Tests/drop3.stable.out
        sql/test/leaks/Tests/select1.stable.out
        sql/test/leaks/Tests/select2.stable.out
        sql/test/leaks/Tests/temp1.stable.out
        sql/test/leaks/Tests/temp2.stable.out
        sql/test/leaks/Tests/temp2.stable.out.int128
        sql/test/leaks/Tests/temp3.stable.out
        sql/test/leaks/Tests/temp3.stable.out.int128
        sql/test/testdb-upgrade-chain-hge/Tests/dump.SQL.py
        sql/test/testdb-upgrade-chain-hge/Tests/dump.stable.out
        sql/test/testdb-upgrade-chain/Tests/dump.SQL.py
        sql/test/testdb-upgrade-chain/Tests/dump.stable.out
        sql/test/testdb-upgrade-chain/Tests/dump.stable.out.Windows
        sql/test/testdb-upgrade-hge/Tests/dump.SQL.py
        sql/test/testdb-upgrade-hge/Tests/dump.stable.out
        sql/test/testdb-upgrade/Tests/dump.SQL.py
        sql/test/testdb-upgrade/Tests/dump.stable.out
        sql/test/testdb-upgrade/Tests/dump.stable.out.Windows
        sql/test/testdb/Tests/testdb-dump.SQL.py
        sql/test/testdb/Tests/testdb-dump.stable.out
        sql/test/testdb/Tests/testdb-dump.stable.out.Windows
        tools/mserver/mserver5.c
Branch: 2PC
Log Message:

Merge with default branch


diffs (truncated from 12400 to 300 lines):

diff --git a/NT/monetdb_config.h.in b/NT/monetdb_config.h.in
--- a/NT/monetdb_config.h.in
+++ b/NT/monetdb_config.h.in
@@ -205,6 +205,9 @@
 /* Define to 1 if you have the `gettimeofday' function. */
 /* #undef HAVE_GETTIMEOFDAY */
 
+/* Define to 1 if you have the `_get_timezone' function. */
+#define HAVE__GET_TIMEZONE 1
+
 /* Define if you have the gsl library */
 /* #undef HAVE_GSL */
 
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -267,7 +267,6 @@ gdk_return HEAPextend(Heap *h, size_t si
 size_t HEAPmemsize(Heap *h);
 size_t HEAPvmsize(Heap *h);
 lng IMPSimprintsize(BAT *b);
-void MRschedule(int taskcnt, void **arg, void( *cmd)(void *p));
 int MT_check_nr_cores(void);
 int MT_create_thread(MT_Id *t, void( *function)(void *), void *arg, enum 
MT_thr_detach d);
 void MT_exiting_thread(void);
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -2911,12 +2911,22 @@ static void
 set_timezone(Mapi mid)
 {
        char buf[128];
-       time_t t, lt, gt;
-       struct tm *tmp;
        int tzone;
        MapiHdl hdl;
 
        /* figure out our current timezone */
+#ifdef HAVE__GET_TIMEZONE
+       long tz;
+       int dst;
+
+       _tzset();
+       _get_timezone(&tz);
+       _get_dstbias(&dst);
+       tzone = (int) (tz + dst);
+#else
+       time_t t, lt, gt;
+       struct tm *tmp;
+
        t = time(NULL);
        tmp = gmtime(&t);
        gt = mktime(tmp);
@@ -2925,6 +2935,7 @@ set_timezone(Mapi mid)
        lt = mktime(tmp);
        assert((lng) gt - (lng) lt >= (lng) INT_MIN && (lng) gt - (lng) lt <= 
(lng) INT_MAX);
        tzone = (int) (gt - lt);
+#endif
        if (tzone < 0)
                snprintf(buf, sizeof(buf),
                         "SET TIME ZONE INTERVAL '+%02d:%02d' HOUR TO MINUTE",
diff --git a/clients/mapiclient/tomograph.c b/clients/mapiclient/tomograph.c
--- a/clients/mapiclient/tomograph.c
+++ b/clients/mapiclient/tomograph.c
@@ -1172,7 +1172,7 @@ updatecolormap(int idx)
        if (fnd == 0 && i < NUM_COLORS) {
                /* not found, but still free slot: add new one */
                fnd = i;
-               colors[fnd].mod = mod?strdup(mod): 0;
+               colors[fnd].mod = strdup(mod);
                colors[fnd].fcn = strdup(fcn);
                if( debug) 
                        fprintf(stderr,"-- Added function #%d: %s.%s\n", fnd, 
mod, fcn);
diff --git a/clients/php/examples/query.php b/clients/php/examples/query.php
--- a/clients/php/examples/query.php
+++ b/clients/php/examples/query.php
@@ -17,7 +17,7 @@ require '../lib/php_monetdb.php';
 define("DB", "php_demo");
 
 /* Establish a connection and report errors in case they occour */
-$db = monetdb_connect($host = "127.0.0.1", $port = "50000", $database = DB , 
$username = "monetdb", $password = "monetdb" ) or 
trigger_error(monetdb_last_error());
+$db = monetdb_connect($lang = "sql", $host = "127.0.0.1", $port = "50000", 
$database = DB , $username = "monetdb", $password = "monetdb" ) or 
trigger_error(monetdb_last_error());
 
 /* Fire a query */
 
diff --git a/clients/php/lib/php_monetdb.php b/clients/php/lib/php_monetdb.php
--- a/clients/php/lib/php_monetdb.php
+++ b/clients/php/lib/php_monetdb.php
@@ -525,8 +525,9 @@
        */
        function auto_commit($conn, $flag=TRUE) {
                if ($conn["socket"] != NULL) {
-                       $cmd = "auto_commit " . $flag;
+                       $cmd = "auto_commit " . (int) $flag;
                        mapi_write($conn["socket"], format_command($cmd));
+                       mapi_read($conn["socket"]);
                        
                        return TRUE;
                }
diff --git a/clients/ruby/lib/MonetDB.rb b/clients/ruby/lib/MonetDB.rb
--- a/clients/ruby/lib/MonetDB.rb
+++ b/clients/ruby/lib/MonetDB.rb
@@ -176,7 +176,7 @@
   class MonetDB
     DEFAULT_USERNAME = "monetdb"
     DEFAULT_PASSWORD = "monetdb"
-    DEFAULT_LANG     = LANG_SQL
+    DEFAULT_LANG     = MonetDBConnection::LANG_SQL
     DEFAULT_HOST     = "127.0.0.1"
     DEFAULT_PORT     = 50000
     DEFAULT_DATABASE = "test"
diff --git a/clients/ruby/lib/MonetDBConnection.rb 
b/clients/ruby/lib/MonetDBConnection.rb
--- a/clients/ruby/lib/MonetDBConnection.rb
+++ b/clients/ruby/lib/MonetDBConnection.rb
@@ -11,41 +11,41 @@ require 'socket'
 require 'time'
 require 'hasher'
 require 'MonetDBExceptions'
-require 'iconv' # utf-8 support
 require 'uri'   # parse merovingian redirects
 
-Q_TABLE               = "1" # SELECT operation
-Q_UPDATE              = "2" # INSERT/UPDATE operations
-Q_CREATE              = "3" # CREATE/DROP TABLE operations
-Q_TRANSACTION         = "4" # TRANSACTION
-Q_PREPARE             = "5"
-Q_BLOCK               = "6" # QBLOCK message
+class MonetDBConnection
+  Q_TABLE               = "1" # SELECT operation
+  Q_UPDATE              = "2" # INSERT/UPDATE operations
+  Q_CREATE              = "3" # CREATE/DROP TABLE operations
+  Q_TRANSACTION         = "4" # TRANSACTION
+  Q_PREPARE             = "5"
+  Q_BLOCK               = "6" # QBLOCK message
 
-MSG_REDIRECT          = '^' # auth redirection through merovingian
-MSG_QUERY             = '&'
-MSG_SCHEMA_HEADER     = '%'
-MSG_INFO              = '!' # info response from mserver
-MSG_TUPLE             = '['
-MSG_PROMPT            =  ""
+  MSG_REDIRECT          = '^' # auth redirection through merovingian
+  MSG_QUERY             = '&'
+  MSG_SCHEMA_HEADER     = '%'
+  MSG_INFO              = '!' # info response from mserver
+  MSG_TUPLE             = '['
+  MSG_PROMPT            =  ""
 
 
-REPLY_SIZE            = '-1'
+  REPLY_SIZE            = '-1'
 
-MAX_AUTH_ITERATION    = 10  # maximum number of atuh iterations (thorough 
merovingian) allowed
- 
-MONET_ERROR           = -1
+  MAX_AUTH_ITERATION    = 10  # maximum number of atuh iterations (thorough 
merovingian) allowed
+   
+  MONET_ERROR           = -1
 
-LANG_SQL = "sql"
+  LANG_SQL = "sql"
 
-# Protocols
-MAPIv9 = 9
+  # Protocols
+  MAPIv9 = 9
 
-MONETDB_MEROVINGIAN = "merovingian"
-MONETDB_MSERVER     = "monetdb"
+  MONETDB_MEROVINGIAN = "merovingian"
+  MONETDB_MSERVER     = "monetdb"
 
-MEROVINGIAN_MAX_ITERATIONS = 10
+  MEROVINGIAN_MAX_ITERATIONS = 10
 
-class MonetDBConnection
+  
   # enable debug output
   @@DEBUG               = false
 
@@ -59,7 +59,7 @@ class MonetDBConnection
   @@CLIENT_ENDIANNESS   = "BIG"
   
   # MAPI protocols supported by the driver
-  @@SUPPORTED_PROTOCOLS = [ MAPIv9 ]
+  @@SUPPORTED_PROTOCOLS = [ MonetDBConnection::MAPIv9 ]
   
   attr_reader :socket, :auto_commit, :transactions, :lang
   
@@ -121,7 +121,7 @@ class MonetDBConnection
       @protocol = server_challenge.split(':')[2].to_i
       @supported_auth_types = server_challenge.split(':')[3].split(',')
       @server_endianness = server_challenge.split(':')[4]
-      if @@SUPPORTED_PROTOCOLS.include?(@protocol) == False
+      if @@SUPPORTED_PROTOCOLS.include?(@protocol) == false
         raise MonetDBProtocolError, "Protocol not supported. The current 
implementation of ruby-monetdb works with MAPI protocols 
#{@@SUPPORTED_PROTOCOLS} only."
       end
       @pwhash = server_challenge.split(':')[5]
@@ -149,7 +149,7 @@ class MonetDBConnection
         # auth succedeed
         true
       else
-        if monetdb_auth[0].chr == MSG_REDIRECT
+        if monetdb_auth[0].chr == MonetDBConnection::MSG_REDIRECT
         #redirection
           
           redirects = [] # store a list of possible redirects
@@ -191,14 +191,14 @@ class MonetDBConnection
             end
           end
           
-          if server_name == MONETDB_MEROVINGIAN
-            if @auth_iteration <= MEROVINGIAN_MAX_ITERATIONS
+          if server_name == MonetDBConnection::MONETDB_MEROVINGIAN
+            if @auth_iteration <= MonetDBConnection::MEROVINGIAN_MAX_ITERATIONS
               @auth_iteration += 1
               real_connect
             else
               raise MonetDBConnectionError, "Merovingian: too many iterations 
while proxying."
             end
-          elsif server_name == MONETDB_MSERVER
+          elsif server_name == MonetDBConnection::MONETDB_MSERVER
             begin
               @socket.close
             rescue
@@ -206,19 +206,20 @@ class MonetDBConnection
             end
             # reinitialize a connection
             @host = host
-                 @port = port
+            @port = port
             
             connect(database, @auth_type)
           else
             @connection_established = false
             raise MonetDBConnectionError, monetdb_auth
           end
-        elsif monetdb_auth[0].chr == MSG_INFO
+        elsif monetdb_auth[0].chr == MonetDBConnection::MSG_INFO
           raise MonetDBConnectionError, monetdb_auth
         end
       end
     end
   end
+
   def savepoint
     @transactions.savepoint
   end
@@ -236,13 +237,13 @@ class MonetDBConnection
   
   # send a 'reply_size' command to the server
   def set_reply_size
-    send(format_command(("reply_size " + REPLY_SIZE)))
+    send(format_command(("reply_size " + MonetDBConnection::REPLY_SIZE)))
     
     response = receive
   
-    if response == MSG_PROMPT
+    if response == MonetDBConnection::MSG_PROMPT
       true
-    elsif response[0] == MSG_INFO
+    elsif response[0] == MonetDBConnection::MSG_INFO
       raise MonetDBCommandError, "Unable to set reply_size: #{response}"
     end
     
@@ -277,7 +278,7 @@ class MonetDBConnection
     is_final, chunk_size = recv_decode_hdr
 
     if chunk_size == 0
-           return ""  # needed on ruby-1.8.6 linux/64bit; recv(0) hangs on 
this configuration. 
+      return ""  # needed on ruby-1.8.6 linux/64bit; recv(0) hangs on this 
configuration. 
     end
     
     data = @socket.recv(chunk_size)
@@ -409,9 +410,9 @@ class MonetDBConnection
     send(query_tz)
     response = receive
     
-    if response == MSG_PROMPT
+    if response == MonetDBConnection::MSG_PROMPT
       true
-    elsif response[0].chr == MSG_INFO
+    elsif response[0].chr == MonetDBConnection::MSG_INFO
       raise MonetDBQueryError, response
     end
   end
@@ -427,9 +428,9 @@ class MonetDBConnection
     send(format_command("auto_commit " + ac))
     
     response = receive
-    if response == MSG_PROMPT
+    if response == MonetDBConnection::MSG_PROMPT
       @auto_commit = flag
-    elsif response[0].chr == MSG_INFO
+    elsif response[0].chr == MonetDBConnection::MSG_INFO
       raise MonetDBCommandError, response
       return 
     end
@@ -443,7 +444,7 @@ class MonetDBConnection
   
   # Check if monetdb is running behind the merovingian proxy and forward the 
connection in case
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to