Skip to content

Commit 84055bd

Browse files
author
Richard Jones
committed
escape *all* uses of "schema" in mysql backend [SF#1472120]
1 parent 0f407aa commit 84055bd

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Fixed:
1313
FileClass schema where previously the "content" property was faked and
1414
"type" was optional)
1515
- verbose output during import is optional now (sf bug 1475624)
16+
- escape *all* uses of "schema" in mysql backend (sf bug 1472120)
1617

1718

1819
2006-03-03 1.1.1

roundup/backends/back_mysql.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#$Id: back_mysql.py,v 1.67 2006-03-03 01:02:26 richard Exp $
1+
#$Id: back_mysql.py,v 1.68 2006-04-27 03:40:42 richard Exp $
22
#
33
# Copyright (c) 2003 Martynas Sklyzmantas, Andrey Lebedev <[email protected]>
44
#
@@ -66,7 +66,7 @@ def db_nuke(config):
6666
tables = cursor.fetchall()
6767
# stupid MySQL bug requires us to drop all the tables first
6868
for table in tables:
69-
command = 'DROP TABLE %s'%table[0]
69+
command = 'DROP TABLE `%s`'%table[0]
7070
if __debug__:
7171
logging.getLogger('hyperdb').debug(command)
7272
cursor.execute(command)
@@ -183,6 +183,13 @@ def load_dbschema(self):
183183
else:
184184
self.database_schema = {}
185185

186+
def save_dbschema(self):
187+
''' Save the schema definition that the database currently implements
188+
'''
189+
s = repr(self.database_schema)
190+
self.sql('delete from `schema`')
191+
self.sql('insert into `schema` values (%s)', (s,))
192+
186193
def create_version_2_tables(self):
187194
# OTK store
188195
self.sql('''CREATE TABLE otks (otk_key VARCHAR(255),

0 commit comments

Comments
 (0)