<commit_before>
from django.db import connection
from django.conf import settings
from south.db import generic

class DatabaseOperations(generic.DatabaseOperations):

    """
    MySQL implementation of database operations.
    """
    
    backend_name = "mysql"
    alter_string_set_type = ''
    alter_string_set_null = 'MODIFY %(column)s %(type)s NULL;'
    alter_string_drop_null = 'MODIFY %(column)s %(type)s NOT NULL;'
    drop_index_string = 'DROP INDEX %(index_name)s ON %(table_name)s'
    drop_primary_key_string = "ALTER TABLE %(table)s DROP PRIMARY KEY"
    allows_combined_alters = False
    has_ddl_transactions = False
    has_check_constraints = False
    delete_unique_sql = "ALTER TABLE %s DROP INDEX %s"
    
    
    def connection_init(self):
        """
        Run before any SQL to let database-specific config be sent as a command,
        e.g. which storage engine (MySQL) or transaction serialisability level.
        """
        if hasattr(settings, "DATABASE_STORAGE_ENGINE") and \
           settings.DATABASE_STORAGE_ENGINE:
            generic.DatabaseOperations.execute(self, "SET storage_engine=%s;" %
                settings.DATABASE_STORAGE_ENGINE)

    
    def rename_column(self, table_name, old, new):
        if old == new or self.dry_run:
            return []
        
        qn = connection.ops.quote_name
        
        rows = [x for x in self.execute('DESCRIBE %s' % (qn(table_name),)) if x[0] == old]<commit_msg>Fix recursion issue with connection_init<commit_after>
from django.db import connection
from django.conf import settings
from south.db import generic

class DatabaseOperations(generic.DatabaseOperations):

    """
    MySQL implementation of database operations.
    """
    
    backend_name = "mysql"
    alter_string_set_type = ''
    alter_string_set_null = 'MODIFY %(column)s %(type)s NULL;'
    alter_string_drop_null = 'MODIFY %(column)s %(type)s NOT NULL;'
    drop_index_string = 'DROP INDEX %(index_name)s ON %(table_name)s'
    drop_primary_key_string = "ALTER TABLE %(table)s DROP PRIMARY KEY"
    allows_combined_alters = False
    has_ddl_transactions = False
    has_check_constraints = False
    delete_unique_sql = "ALTER TABLE %s DROP INDEX %s"
    
    
    def connection_init(self):
        """
        Run before any SQL to let database-specific config be sent as a command,
        e.g. which storage engine (MySQL) or transaction serialisability level.
        """
        if hasattr(settings, "DATABASE_STORAGE_ENGINE") and \
           settings.DATABASE_STORAGE_ENGINE:
            cursor = connection.cursor()
            cursor.execute("SET storage_engine=%s;" % settings.DATABASE_STORAGE_ENGINE)

    
    def rename_column(self, table_name, old, new):
        if old == new or self.dry_run:
            return []
        
        qn = connection.ops.quote_name
        
        rows = [x for x in self.execute('DESCRIBE %s' % (qn(table_name),)) if x[0] == old]
{'fraction_non_alphanumeric': 0.0927555856465809, 'fraction_numerical': 0.0006770480704129993, 'mean_word_length': 2.945260347129506, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2710625', 'n_tokens_mistral': 936, 'n_tokens_neox': 918, 'n_words': 238}