Feature #30977
closedWrong ext_tables.sql in an extension breaks Extension Manager and Installtool Database Analyzer logic
0%
Description
If an extension introduces a not valid SQL-Structure in ext_tables.sql the parsed sql-statement that contains the neccessary tables and fields gets mashed up.
Say you have an ext_tables.sql like this:
CREATE TABLE `test` (,
id int(11) unsigned NOT NULL auto_increment,
which lacks the closing ")" em tries to execute the following sql-query:
CREATE TABLE test (
id int(11) unsigned NOT NULL auto_increment,
CREATE TABLE cf_cache_hash (,
identifier varchar(250) NOT NULL default '',
expires int(11) unsigned NOT NULL default '0',
content mediumblob,
PRIMARY KEY (id),
KEY cache_id (identifier,expires)
) ENGINE=InnoDB;
Furthermore Install Tool Database Analyser offers deleting next extensions sql:
Removing tables (rename with prefix)
ALTER TABLE cf_cache_hash RENAME zzz_deleted_cf_cache_hash;
Records in table: 20
I recommend using a regex that checks for the validity of given sqls.
Updated by Markus Bucher about 13 years ago
There is an online SQL Validation tool located at http://developer.mimer.se/validator/index.htm which could give an idea, if an automated check could be possible. This page can't handle all MySQL-specific queries, obviously, but still finds errors.
Another project is http://www.codeproject.com/KB/database/sqlvalidator.aspx
Maybe we can find information there. I will have a look...
Updated by Xavier Perseguers about 13 years ago
- Priority changed from Must have to Could have
ext_tables.sql file should be generated by a mysqldump utility/mysql DB structure export.
If someone modifies it manually, s/he should know what to do and double check the resulting file is valid.
I set the priority to "Could have" because I really see this only as "nice to have".
Updated by Christian Kuhn about 9 years ago
- Status changed from New to Rejected
imho, it is nearly impossible to implement this. even with a "clean" db analyzer code, this would be very hard. if a dev adds broken sql, it is broken. i think we should close this issue since it is not very realistic to have something like that in the shorter future.
Updated by Benni Mack over 4 years ago
- Sprint Focus changed from PRC to Needs Decision