cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eev...@apache.org
Subject svn commit: r1082272 - in /cassandra/trunk/drivers/py: cql/marshal.py test/test_query_preparation.py
Date Wed, 16 Mar 2011 19:36:40 GMT
Author: eevans
Date: Wed Mar 16 19:36:40 2011
New Revision: 1082272

URL: http://svn.apache.org/viewvc?rev=1082272&view=rev
Log:
fix unicode term marshal function (and tests)

Patch by eevans

Modified:
    cassandra/trunk/drivers/py/cql/marshal.py
    cassandra/trunk/drivers/py/test/test_query_preparation.py

Modified: cassandra/trunk/drivers/py/cql/marshal.py
URL: http://svn.apache.org/viewvc/cassandra/trunk/drivers/py/cql/marshal.py?rev=1082272&r1=1082271&r2=1082272&view=diff
==============================================================================
--- cassandra/trunk/drivers/py/cql/marshal.py (original)
+++ cassandra/trunk/drivers/py/cql/marshal.py Wed Mar 16 19:36:40 2011
@@ -49,7 +49,7 @@ def marshal(term):
     if isinstance(term, (long,int)):
         return "%d" % term
     elif isinstance(term, unicode):
-        return "u'%s'" % term
+        return "'%s'" % term.encode('utf8')
     elif isinstance(term, str):
         return "'%s'" % term
     elif isinstance(term, UUID):

Modified: cassandra/trunk/drivers/py/test/test_query_preparation.py
URL: http://svn.apache.org/viewvc/cassandra/trunk/drivers/py/test/test_query_preparation.py?rev=1082272&r1=1082271&r2=1082272&view=diff
==============================================================================
--- cassandra/trunk/drivers/py/test/test_query_preparation.py (original)
+++ cassandra/trunk/drivers/py/test/test_query_preparation.py Wed Mar 16 19:36:40 2011
@@ -6,7 +6,7 @@ from cql.errors import InvalidQueryForma
 # TESTS[i] ARGUMENTS[i] -> STANDARDS[i]
 TESTS = (
 """
-SELECT ?,?,?,? FROM ColumnFamily WHERE KEY = ? AND "col" = ?;
+SELECT ?,?,?,? FROM ColumnFamily WHERE KEY = ? AND 'col' = ?;
 """,
 """
 USE Keyspace;
@@ -20,7 +20,7 @@ ARGUMENTS = (
 
 STANDARDS = (
 """
-SELECT 1,3,1000L,3000L FROM ColumnFamily WHERE KEY = "key" AND "col" = u"val";
+SELECT 1,3,1000,3000 FROM ColumnFamily WHERE KEY = 'key' AND 'col' = 'val';
 """,
 """
 USE Keyspace;



Mime
View raw message