Ticket #3030: 3030.diff

File 3030.diff, 751 bytes (added by Peter Melvyn <peter.melvyn@…>, 16 years ago)
  • django/db/backends/mysql/base.py

     
    154154    def __init__(self, **kwargs):
    155155        super(DatabaseWrapper, self).__init__(**kwargs)
    156156        self.server_version = None
     157        # MySQL servers version 5++ creates implied PK and/or FK indeces
     158        # (what behaveour was before version 5 I don't know/ don't care)
     159        self.server_version = self.get_server_version()
     160        self.features.autoindexes_primary_keys = self.server_version and (self.server_version[0]>=5)
    157161
    158162    def _valid_connection(self):
    159163        if self.connection is not None:
Back to Top