Changeset: d5561e6a7e4b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d5561e6a7e4b
Modified Files:
clients/python/monetdb/mapi2.py
clients/python/monetdb/mapi3.py
clients/python/monetdb/sql/connections.py
gdk/gdk_bat.c
sql/server/rel_select.c
sql/test/bugs/Tests/zero_or_one_bug.stable.out
testing/Mtest.py.in
Branch: default
Log Message:
Merge with Jul2012 branch.
diffs (192 lines):
diff --git a/clients/python/monetdb/mapi2.py b/clients/python/monetdb/mapi2.py
--- a/clients/python/monetdb/mapi2.py
+++ b/clients/python/monetdb/mapi2.py
@@ -31,11 +31,6 @@ from cStringIO import StringIO
from monetdb.monetdb_exceptions import *
-# Windows doesn't support MSG_WAITALL flag for recv
-flags = 0
-if hasattr(socket, 'MSG_WAITALL'):
- flags = socket.MSG_WAITALL
-
logger = logging.getLogger("monetdb")
MAX_PACKAGE_LENGTH = (1024*8)-2
@@ -232,7 +227,7 @@ class Server:
count = bytes
while count > 0:
try:
- recv = self.socket.recv(bytes, flags)
+ recv = self.socket.recv(bytes)
logger.debug("II: package size: %i payload: %s" % (len(recv),
recv))
except socket.error, error:
raise OperationalError(error[1])
diff --git a/clients/python/monetdb/mapi3.py b/clients/python/monetdb/mapi3.py
--- a/clients/python/monetdb/mapi3.py
+++ b/clients/python/monetdb/mapi3.py
@@ -31,11 +31,6 @@ from io import BytesIO
from monetdb.monetdb_exceptions import *
-# Windows doesn't support MSG_WAITALL flag for recv
-flags = 0
-if hasattr(socket, 'MSG_WAITALL'):
- flags = socket.MSG_WAITALL
-
logger = logging.getLogger("monetdb")
MAX_PACKAGE_LENGTH = (1024*8)-2
@@ -238,7 +233,7 @@ class Server:
count = bytes
while count > 0:
try:
- recv = self.socket.recv(bytes, flags)
+ recv = self.socket.recv(bytes)
logger.debug("II: package size: %i payload: %s" % (len(recv),
recv))
except socket.error as error:
raise OperationalError(error[1])
diff --git a/clients/python/monetdb/sql/connections.py
b/clients/python/monetdb/sql/connections.py
--- a/clients/python/monetdb/sql/connections.py
+++ b/clients/python/monetdb/sql/connections.py
@@ -132,7 +132,6 @@ class Connection:
#return self.execute('ROLLBACK')
-
def cursor(self):
"""
Return a new Cursor Object using the connection. If the
@@ -161,6 +160,16 @@ class Connection:
return True
+ def settimeout(self,timeout):
+ """ set the amount of time before a connection times out """
+ self.mapi.socket.settimeout(timeout)
+
+
+ def gettimeout(self):
+ """ get the amount of time before a connection times out """
+ return self.mapi.socket.gettimeout()
+
+
# these are required by the python DBAPI
Warning = Warning
Error = Error
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -1585,6 +1585,14 @@ BUNinplace(BAT *b, BUN p, const void *h,
BUN prv, nxt;
ALIGNinp(b, "BUNreplace", force); /* zap alignment info */
+ if (b->T->nil &&
+ atom_CMP(BUNtail(bi, p), ATOMnilptr(b->ttype), b->ttype) ==
0 &&
+ atom_CMP(t, ATOMnilptr(b->ttype), b->ttype) != 0) {
+ /* if old value is nil and new value isn't,
+ * we're not sure anymore about the nil
+ * property, so we must clear it */
+ b->T->nil = 0;
+ }
tacc_update(del,tail,p,pit);
Treplacevalue(b, BUNtloc(bi, p), t);
tacc_update(ins,tail,p,pit);
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
@@ -4744,7 +4744,7 @@ rel_select_exp(mvc *sql, sql_rel *rel, s
list *pre_prj = NULL;
list *outer_gbexps = NULL;
sql_rel *inner = NULL;
- int decorrelated = 0;
+ int decorrelated = 0, projection = 0;
assert(sn->s.token == SQL_SELECT);
if (!sn->selection)
@@ -4973,6 +4973,7 @@ rel_select_exp(mvc *sql, sql_rel *rel, s
sql_exp *e = rel_lastexp(sql, rel->r);
list *exps = list_dup(pre_prj, (fdup)NULL);
+ projection = 1;
exps = list_merge(exps, rel_projections(sql, outer,
NULL, 1, 1), (fdup)NULL);
rel = rel_project(sql->sa, rel, exps);
rel_project_add_exp(sql, rel, e);
@@ -4990,6 +4991,7 @@ rel_select_exp(mvc *sql, sql_rel *rel, s
if (outer && pre_prj) {
sql_rel *l;
node *n;
+ list *exps;
if (outer_gbexps) {
assert(is_groupby(rel->op));
@@ -5003,7 +5005,20 @@ rel_select_exp(mvc *sql, sql_rel *rel, s
rel->exps = outer_gbexps;
exps_fix_card(outer_gbexps, rel->card);
}
- l = rel = rel_project(sql->sa, rel, pre_prj);
+ if (projection) {
+ exps = new_exp_list(sql->sa);
+ for (n = pre_prj->h; n; n = n->next) {
+ sql_exp *pe = n->data;
+
+ if (!exp_name(pe))
+ exp_label(sql->sa, pe, ++sql->label);
+ pe = exp_column(sql->sa, exp_relname(pe),
exp_name(pe), exp_subtype(pe), exp_card(pe), has_nil(pe), is_intern(pe));
+ append(exps, pe);
+ }
+ } else {
+ exps = pre_prj;
+ }
+ l = rel = rel_project(sql->sa, rel, exps);
while(l && l->op != op_join)
l = l->l;
if (l && l->op == op_join && l->l == outer && ek.card !=
card_set)
diff --git a/sql/test/bugs/Tests/zero_or_one_bug.stable.out
b/sql/test/bugs/Tests/zero_or_one_bug.stable.out
--- a/sql/test/bugs/Tests/zero_or_one_bug.stable.out
+++ b/sql/test/bugs/Tests/zero_or_one_bug.stable.out
@@ -60,7 +60,7 @@ Ready.
#FROM my_table1 x
#;
% ., .my_table2 # table_name
-% isnull_not_isnull_id1, L2 # name
+% L3, L2 # name
% int, varchar # type
% 1, 0 # length
[ 1, NULL ]
@@ -78,7 +78,7 @@ Ready.
#FROM my_table1 x
#;
% ., .my_table2 # table_name
-% isnull_not_isnull_id1, my_col1 # name
+% L3, my_col1 # name
% int, varchar # type
% 1, 0 # length
[ 1, NULL ]
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -2266,10 +2266,6 @@ def randomPort(l,h) :
port = 0
else:
break
- else:
- if sys.platform == 'linux2':
- print 'Ports tried:',`ports`
- os.system('netstat -ap')
return (port,host)
### randomPort(l,h) #
@@ -2793,7 +2789,11 @@ def Check(command, input) :
STDERR.write("\n")
STDERR.flush()
#sys.exit(1)
- return 1
+ if sys.platform == 'linux2':
+ proc = subprocess.Popen(['netstat', '-ap'], stdout =
subprocess.PIPE, stderr = subprocess.PIPE, universal_newlines = True)
+ out, err = proc.communicate()
+ STDERR.write(err)
+ STDOUT.write(out)
if noErr:
STDOUT.flush()
STDERR.writelines(noErr)
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list