Changeset: c4693598a20e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c4693598a20e
Modified Files:
clients/python2/monetdb/mapi.py
clients/python2/monetdb/sql/cursors.py
clients/python3/monetdb/mapi.py
clients/python3/monetdb/sql/cursors.py
Branch: Feb2013
Log Message:
Fixed bug 3380.
Thanks to Pete Hollobon for finding and fixing the bug.
diffs (70 lines):
diff --git a/clients/python2/monetdb/mapi.py b/clients/python2/monetdb/mapi.py
--- a/clients/python2/monetdb/mapi.py
+++ b/clients/python2/monetdb/mapi.py
@@ -46,6 +46,7 @@ MSG_QPREPARE = "&5"
MSG_QBLOCK = "&6"
MSG_HEADER = "%"
MSG_TUPLE = "["
+MSG_TUPLE_NOSLICE = "="
MSG_REDIRECT = "^"
MSG_OK = "=OK"
diff --git a/clients/python2/monetdb/sql/cursors.py
b/clients/python2/monetdb/sql/cursors.py
--- a/clients/python2/monetdb/sql/cursors.py
+++ b/clients/python2/monetdb/sql/cursors.py
@@ -395,7 +395,10 @@ class Cursor(object):
elif line.startswith(mapi.MSG_TUPLE):
values = self.__parse_tuple(line)
- self.__rows .append(values)
+ self.__rows.append(values)
+
+ elif line.startswith(mapi.MSG_TUPLE_NOSLICE):
+ self.__rows.append((line[1:],))
elif line.startswith(mapi.MSG_QBLOCK):
self.__rows = []
@@ -423,7 +426,7 @@ class Cursor(object):
self.description = None
self.rowcount = -1
- elif line.startswith(mapi.MSG_PROMPT):
+ elif line == mapi.MSG_PROMPT:
return
elif line.startswith(mapi.MSG_ERROR):
diff --git a/clients/python3/monetdb/mapi.py b/clients/python3/monetdb/mapi.py
--- a/clients/python3/monetdb/mapi.py
+++ b/clients/python3/monetdb/mapi.py
@@ -47,6 +47,7 @@ MSG_QPREPARE = "&5"
MSG_QBLOCK = "&6"
MSG_HEADER = "%"
MSG_TUPLE = "["
+MSG_TUPLE_NOSLICE = "="
MSG_REDIRECT = "^"
MSG_OK = "=OK"
diff --git a/clients/python3/monetdb/sql/cursors.py
b/clients/python3/monetdb/sql/cursors.py
--- a/clients/python3/monetdb/sql/cursors.py
+++ b/clients/python3/monetdb/sql/cursors.py
@@ -393,7 +393,10 @@ class Cursor(object):
elif line.startswith(mapi.MSG_TUPLE):
values = self.__parse_tuple(line)
- self.__rows .append(values)
+ self.__rows.append(values)
+
+ elif line.startswith(mapi.MSG_TUPLE_NOSLCE):
+ self.__rows.append((line[1:],))
elif line.startswith(mapi.MSG_QBLOCK):
self.__rows = []
@@ -421,7 +424,7 @@ class Cursor(object):
self.description = None
self.rowcount = -1
- elif line.startswith(mapi.MSG_PROMPT):
+ elif line == mapi.MSG_PROMPT:
return
elif line.startswith(mapi.MSG_ERROR):
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list