merge stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 14 Dec 2009 15:35:21 +0100
branchstable
changeset 4117 3f8b7ffdda53
parent 4116 20b23af4e51e (current diff)
parent 4115 6ec0fca70701 (diff)
child 4118 8a9a00a9405c
merge
--- a/server/sources/native.py	Mon Dec 14 15:33:33 2009 +0100
+++ b/server/sources/native.py	Mon Dec 14 15:35:21 2009 +0100
@@ -593,6 +593,7 @@
 
 def sql_schema(driver):
     helper = get_adv_func_helper(driver)
+    tstamp_col_type = helper.TYPE_MAPPING.get('TIMESTAMP', 'TIMESTAMP')
     schema = """
 /* Create the repository's system database */
 
@@ -602,7 +603,7 @@
   eid INTEGER PRIMARY KEY NOT NULL,
   type VARCHAR(64) NOT NULL,
   source VARCHAR(64) NOT NULL,
-  mtime TIMESTAMP NOT NULL,
+  mtime %s NOT NULL,
   extid VARCHAR(256)
 );
 CREATE INDEX entities_type_idx ON entities(type);
@@ -613,13 +614,13 @@
   eid INTEGER PRIMARY KEY NOT NULL,
   type VARCHAR(64) NOT NULL,
   source VARCHAR(64) NOT NULL,
-  dtime TIMESTAMP NOT NULL,
+  dtime %s NOT NULL,
   extid VARCHAR(256)
 );
 CREATE INDEX deleted_entities_type_idx ON deleted_entities(type);
 CREATE INDEX deleted_entities_dtime_idx ON deleted_entities(dtime);
 CREATE INDEX deleted_entities_extid_idx ON deleted_entities(extid);
-""" % helper.sql_create_sequence('entities_id_seq')
+""" % (helper.sql_create_sequence('entities_id_seq'), tstamp_col_type, tstamp_col_type)
     return schema
 
 
--- a/server/sources/rql2sql.py	Mon Dec 14 15:33:33 2009 +0100
+++ b/server/sources/rql2sql.py	Mon Dec 14 15:35:21 2009 +0100
@@ -995,7 +995,9 @@
             return self.keyword_map[value]()
         if constant.type == 'Boolean':
             value = self.dbms_helper.boolean_value(value)
-        if constant.type == 'Substitute':
+        elif constant.type == 'Password' or constant.type == 'Bytes':
+            value = self.dbms_helper.binary_value(value)
+        elif constant.type == 'Substitute':
             _id = constant.value
             if isinstance(_id, unicode):
                 _id = _id.encode()