diff options
Diffstat (limited to 'rpki/sql.py')
-rw-r--r-- | rpki/sql.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/rpki/sql.py b/rpki/sql.py index d75b45b3..96c8d086 100644 --- a/rpki/sql.py +++ b/rpki/sql.py @@ -81,8 +81,15 @@ class session(object): self.db.autocommit(True) self.timestamp = rpki.sundial.now() - # Try this as a workaround for MySQL 5.6 UTF8 characterset braindamage - self.execute("charset = latin1") + # Try this as a workaround for MySQL 5.6 UTF8 characterset + # braindamage, in which MySQL starts rejecting ASN.1 DER because + # it's not valid UTF-8. Twits. + # + # Except that it breaks MySQL 5.5, so wrap it and ignore errors. Twits ** 2. + try: + self.execute("charset = latin1") + except: + logger.info("Whacking charset to Latin1 to save MySQL 5.6 from its own confusion failed, blundering onwards") def close(self): if self.cur: |