mysql backend: 'SHOW TABLE STATUS WHERE name=...' not compatible with MySQL 4
|Reported by:||matf@…||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||1.4|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
django/db/backends/mysql/base.py executes "SHOW TABLE STATUS WHERE Name='INTROSPECT_TEST'" query.
"SHOW TABLE STATUS WHERE name='table_name'" syntax was introduced in mysql 5.
See link: http://dev.mysql.com/doc/refman/5.0/en/show-table-status.html
Correct syntax that works with both MySQL 4 and MySQL 5 is "SHOW TABLE STATUS LIKE 'table_name'"
See link: http://dev.mysql.com/doc/refman/4.1/en/show-table-status.html
Since django <= 1.4 is compatible with MySQL 4 this is a bug. This functionality is used in e.g. South database migration library.
Change History (7)
comment:1 Changed 4 years ago by claudep
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Resolution set to wontfix
- Status changed from new to closed
comment:5 Changed 4 years ago by aaugustin
- Resolution wontfix deleted
- Status changed from closed to new