code: def set_sql_mode(self, sql_mode):
          
          if self._server_version < (4, 1):
              raise NotSupportedError("server is too old to set sql_mode")
          self.query("SET SESSION sql_mode='%s'" % sql_mode)
          self.store_result()
docs: Set the connection sql_mode. See MySQL documentation for
          legal values.