fixed issue 1176, truncate on GAE+SQL
This commit is contained in:
@@ -1 +1 @@
|
||||
Version 2.2.1 (2012-11-24 10:47:44) stable
|
||||
Version 2.2.1 (2012-11-24 10:58:12) stable
|
||||
|
||||
+11
-6
@@ -4010,12 +4010,17 @@ class DatabaseStoredFile:
|
||||
self.data += data
|
||||
|
||||
def close_connection(self):
|
||||
self.db.executesql(
|
||||
"DELETE FROM web2py_filesystem WHERE path='%s'" % self.filename)
|
||||
query = "INSERT INTO web2py_filesystem(path,content) VALUES ('%s','%s')"\
|
||||
% (self.filename, self.data.replace("'","''"))
|
||||
self.db.executesql(query)
|
||||
self.db.commit()
|
||||
if self.db is not None:
|
||||
self.db.executesql(
|
||||
"DELETE FROM web2py_filesystem WHERE path='%s'" % self.filename)
|
||||
query = "INSERT INTO web2py_filesystem(path,content) VALUES ('%s','%s')"\
|
||||
% (self.filename, self.data.replace("'","''"))
|
||||
self.db.executesql(query)
|
||||
self.db.commit()
|
||||
self.db = None
|
||||
|
||||
def close(self):
|
||||
self.close_connection()
|
||||
|
||||
@staticmethod
|
||||
def exists(db, filename):
|
||||
|
||||
Reference in New Issue
Block a user