Skip to content

Commit

Permalink
Changed default to InnoDB and results column to MEDIUMBLOB.
Browse files Browse the repository at this point in the history
  • Loading branch information
laapsaap committed Jan 27, 2015
1 parent aa0210d commit 6a792fd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyspider/database/mysql/projectdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(self, host='localhost', port=3306, database='projectdb',
`rate` float(11, 4),
`burst` float(11, 4),
`updatetime` double(16, 4)
) ENGINE=MyISAM CHARSET=utf8''' % self.escape(self.__tablename__))
) ENGINE=InnoDB CHARSET=utf8''' % self.escape(self.__tablename__))

def insert(self, name, obj={}):
obj = dict(obj)
Expand Down
4 changes: 2 additions & 2 deletions pyspider/database/mysql/resultdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ def _create_project(self, project):
self._execute('''CREATE TABLE %s (
`taskid` varchar(64) PRIMARY KEY,
`url` varchar(1024),
`result` BLOB,
`result` MEDIUMBLOB,
`updatetime` double(16, 4)
) ENGINE=MyISAM CHARSET=utf8''' % self.escape(tablename))
) ENGINE=InnoDB CHARSET=utf8''' % self.escape(tablename))

def _parse(self, data):
for key, value in list(six.iteritems(data)):
Expand Down
2 changes: 1 addition & 1 deletion pyspider/database/mysql/taskdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def _create_project(self, project):
`lastcrawltime` double(16, 4),
`updatetime` double(16, 4),
INDEX `status_index` (`status`)
) ENGINE=MyISAM CHARSET=utf8''' % self.escape(tablename))
) ENGINE=InnoDB CHARSET=utf8''' % self.escape(tablename))

def _parse(self, data):
for key, value in list(six.iteritems(data)):
Expand Down

0 comments on commit 6a792fd

Please sign in to comment.