#31805: MySQL Schema tests fail on Windows
-------------------------------------+-------------------------------------
Reporter: Ahmad A. Hussein | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: needsinfo
Keywords: mysql, schema, | Triage Stage:
windows | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Ahmad A. Hussein):
{{{
ERROR: test_alter_int_pk_to_bigautofield_pk (schema.tests.SchemaTests)
Should be able to rename an IntegerField(primary_key=True) to
----------------------------------------------------------------------
Traceback (most recent call last):
File
"c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\utils.py",
line 82, in _execute
return self.cursor.execute(sql)
File
"c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\mysql\base.py",
line 73, in execute
return self.cursor.execute(query, args)
File "C:\Users\ahmad\Envs\parallelpr\lib\site-
packages\MySQLdb\cursors.py", line 209, in execute
res = self._query(query)
File "C:\Users\ahmad\Envs\parallelpr\lib\site-
packages\MySQLdb\cursors.py", line 315, in _query
db.query(q)
File "C:\Users\ahmad\Envs\parallelpr\lib\site-
packages\MySQLdb\connections.py", line 239, in query
_mysql.connection.query(self, query)
MySQLdb._exceptions.OperationalError: (1050, "Table 'integerpk' already
exists")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py",
line 1345, in test_alter_int_pk_to_bigautofield_pk
editor.create_model(IntegerPK)
File
"c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\base\schema.py",
line 324, in create_model
self.execute(sql, params or None)
File
"c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\base\schema.py",
line 142, in execute
cursor.execute(sql, params)
File
"c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\utils.py",
line 98, in execute
return super().execute(sql, params)
File
"c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\utils.py",
line 66, in execute
return self._execute_with_wrappers(sql, params, many=False,
executor=self._execute)
File
"c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\utils.py",
line 75, in _execute_with_wrappers
return executor(sql, params, many, context)
File
"c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\utils.py",
line 84, in _execute
return self.cursor.execute(sql, params)
File "c:\users\ahmad\desktop\projects\djangogsoc\django\db\utils.py",
line 90, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File
"c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\utils.py",
line 82, in _execute
return self.cursor.execute(sql)
File
"c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\mysql\base.py",
line 73, in execute
return self.cursor.execute(query, args)
File "C:\Users\ahmad\Envs\parallelpr\lib\site-
packages\MySQLdb\cursors.py", line 209, in execute
res = self._query(query)
File "C:\Users\ahmad\Envs\parallelpr\lib\site-
packages\MySQLdb\cursors.py", line 315, in _query
db.query(q)
File "C:\Users\ahmad\Envs\parallelpr\lib\site-
packages\MySQLdb\connections.py", line 239, in query
_mysql.connection.query(self, query)
django.db.utils.OperationalError: (1050, "Table 'integerpk' already
exists")
----------------------------------------------------------------------
CREATE TABLE `INTEGERPK` (`i` integer NOT NULL PRIMARY KEY, `j` integer
NOT NULL UNIQUE); (params None)
(0.000) SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; args=None
(0.094) None; args=None
(0.000) SET foreign_key_checks=0; args=None
(0.016) SHOW FULL TABLES; args=None
(0.000) SET foreign_key_checks=1; args=None
======================================================================
ERROR: test_alter_int_pk_to_int_unique (schema.tests.SchemaTests)
Should be able to rename an IntegerField(primary_key=True) to
----------------------------------------------------------------------
Traceback (most recent call last):
File
"c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\utils.py",
line 82, in _execute
return self.cursor.execute(sql)
File
"c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\mysql\base.py",
line 73, in execute
return self.cursor.execute(query, args)
File "C:\Users\ahmad\Envs\parallelpr\lib\site-
packages\MySQLdb\cursors.py", line 209, in execute
res = self._query(query)
File "C:\Users\ahmad\Envs\parallelpr\lib\site-
packages\MySQLdb\cursors.py", line 315, in _query
db.query(q)
File "C:\Users\ahmad\Envs\parallelpr\lib\site-
packages\MySQLdb\connections.py", line 239, in query
_mysql.connection.query(self, query)
MySQLdb._exceptions.OperationalError: (1050, "Table 'integerpk' already
exists")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py",
line 1383, in test_alter_int_pk_to_int_unique
editor.create_model(IntegerPK)
File
"c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\base\schema.py",
line 324, in create_model
self.execute(sql, params or None)
File
"c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\base\schema.py",
line 142, in execute
cursor.execute(sql, params)
File
"c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\utils.py",
line 98, in execute
return super().execute(sql, params)
File
"c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\utils.py",
line 66, in execute
return self._execute_with_wrappers(sql, params, many=False,
executor=self._execute)
File
"c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\utils.py",
line 75, in _execute_with_wrappers
return executor(sql, params, many, context)
File
"c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\utils.py",
line 84, in _execute
return self.cursor.execute(sql, params)
File "c:\users\ahmad\desktop\projects\djangogsoc\django\db\utils.py",
line 90, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File
"c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\utils.py",
line 82, in _execute
return self.cursor.execute(sql)
File
"c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\mysql\base.py",
line 73, in execute
return self.cursor.execute(query, args)
File "C:\Users\ahmad\Envs\parallelpr\lib\site-
packages\MySQLdb\cursors.py", line 209, in execute
res = self._query(query)
File "C:\Users\ahmad\Envs\parallelpr\lib\site-
packages\MySQLdb\cursors.py", line 315, in _query
db.query(q)
File "C:\Users\ahmad\Envs\parallelpr\lib\site-
packages\MySQLdb\connections.py", line 239, in query
_mysql.connection.query(self, query)
django.db.utils.OperationalError: (1050, "Table 'integerpk' already
exists")
----------------------------------------------------------------------
CREATE TABLE `INTEGERPK` (`i` integer NOT NULL PRIMARY KEY, `j` integer
NOT NULL UNIQUE); (params None)
(0.000) SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; args=None
(0.000) None; args=None
(0.000) SET foreign_key_checks=0; args=None
(0.000) SHOW FULL TABLES; args=None
(0.000) SET foreign_key_checks=1; args=None
----------------------------------------------------------------------
Ran 132 tests in 1083.874s
FAILED (errors=2, skipped=18)
Destroying test database for alias 'default'...
}}}
Value for ```lower_case_table_names``` is 1 (default on Windows)
--
Ticket URL: <https://code.djangoproject.com/ticket/31805#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.5a972d4cdde839c0760189070023a782%40djangoproject.com.