Skip to content

Commit 92457cc

Browse files
author
Justus Pendleton
committed
mysql table creation syntax change
The MySQL people gratuitously changed the syntax for specifying the storage engine a while back and the current alpha drops support for the old syntax. This patch changes TYPE to ENGINE in the mysql backend and updates the documentation to show that we require MySQL 4.0.18 because of that. I also removed a note in the mysql docs about a bug in InnoDB that has been fixed as of the required version. This fixes [SF#1727529]
1 parent 99af4bd commit 92457cc

File tree

2 files changed

+11
-17
lines changed

2 files changed

+11
-17
lines changed

doc/mysql.txt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
MySQL Backend
33
=============
44

5-
:version: $Revision: 1.12 $
5+
:version: $Revision: 1.13 $
66

77
This notes detail the MySQL backend for the Roundup issue tracker.
88

@@ -13,19 +13,13 @@ Prerequisites
1313
To use MySQL as the backend for storing roundup data, you also need
1414
to install:
1515

16-
1. MySQL RDBMS 4.0.16 or higher - http://www.mysql.com. Your MySQL
16+
1. MySQL RDBMS 4.0.18 or higher - http://www.mysql.com. Your MySQL
1717
installation MUST support InnoDB tables (or Berkeley DB (BDB) tables
18-
if you have no other choice). If you're running < 4.0.16 (but not <4.0)
18+
if you have no other choice). If you're running < 4.0.18 (but not <4.0)
1919
then you'll need to use BDB to pass all unit tests. Edit the
2020
``roundup/backends/back_mysql.py`` file to enable DBD instead of InnoDB.
2121
2. Python MySQL interface - http://sourceforge.net/projects/mysql-python
2222

23-
.. note::
24-
The InnoDB implementation has a bug__ that Roundup tickles. See
25-
26-
__ http://bugs.mysql.com/bug.php?id=1810
27-
28-
2923
Running the MySQL tests
3024
=======================
3125

roundup/backends/back_mysql.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#$Id: back_mysql.py,v 1.72 2007-06-21 07:35:50 schlatterbeck Exp $
1+
#$Id: back_mysql.py,v 1.73 2007-09-28 15:26:10 jpend Exp $
22
#
33
# Copyright (c) 2003 Martynas Sklyzmantas, Andrey Lebedev <[email protected]>
44
#
@@ -166,10 +166,10 @@ def open_connection(self):
166166
if message[0] != ER.NO_SUCH_TABLE:
167167
raise DatabaseError, message
168168
self.init_dbschema()
169-
self.sql("CREATE TABLE `schema` (`schema` TEXT) TYPE=%s"%
169+
self.sql("CREATE TABLE `schema` (`schema` TEXT) ENGINE=%s"%
170170
self.mysql_backend)
171171
self.sql('''CREATE TABLE ids (name VARCHAR(255),
172-
num INTEGER) TYPE=%s'''%self.mysql_backend)
172+
num INTEGER) ENGINE=%s'''%self.mysql_backend)
173173
self.sql('create index ids_name_idx on ids(name)')
174174
self.create_version_2_tables()
175175

@@ -194,22 +194,22 @@ def create_version_2_tables(self):
194194
# OTK store
195195
self.sql('''CREATE TABLE otks (otk_key VARCHAR(255),
196196
otk_value TEXT, otk_time FLOAT(20))
197-
TYPE=%s'''%self.mysql_backend)
197+
ENGINE=%s'''%self.mysql_backend)
198198
self.sql('CREATE INDEX otks_key_idx ON otks(otk_key)')
199199

200200
# Sessions store
201201
self.sql('''CREATE TABLE sessions (session_key VARCHAR(255),
202202
session_time FLOAT(20), session_value TEXT)
203-
TYPE=%s'''%self.mysql_backend)
203+
ENGINE=%s'''%self.mysql_backend)
204204
self.sql('''CREATE INDEX sessions_key_idx ON
205205
sessions(session_key)''')
206206

207207
# full-text indexing store
208208
self.sql('''CREATE TABLE __textids (_class VARCHAR(255),
209209
_itemid VARCHAR(255), _prop VARCHAR(255), _textid INT)
210-
TYPE=%s'''%self.mysql_backend)
210+
ENGINE=%s'''%self.mysql_backend)
211211
self.sql('''CREATE TABLE __words (_word VARCHAR(30),
212-
_textid INT) TYPE=%s'''%self.mysql_backend)
212+
_textid INT) ENGINE=%s'''%self.mysql_backend)
213213
self.sql('CREATE INDEX words_word_ids ON __words(_word)')
214214
self.sql('CREATE INDEX words_by_id ON __words (_textid)')
215215
self.sql('CREATE UNIQUE INDEX __textids_by_props ON '
@@ -467,7 +467,7 @@ def drop_journal_table_indexes(self, classname):
467467

468468
def create_multilink_table(self, spec, ml):
469469
sql = '''CREATE TABLE `%s_%s` (linkid VARCHAR(255),
470-
nodeid VARCHAR(255)) TYPE=%s'''%(spec.classname, ml,
470+
nodeid VARCHAR(255)) ENGINE=%s'''%(spec.classname, ml,
471471
self.mysql_backend)
472472
self.sql(sql)
473473
self.create_multilink_table_indexes(spec, ml)

0 commit comments

Comments
 (0)