Project

General

Profile

Actions

Feature #30977

closed

Wrong ext_tables.sql in an extension breaks Extension Manager and Installtool Database Analyzer logic

Added by Markus Bucher about 13 years ago. Updated over 4 years ago.

Status:
Rejected
Priority:
Could have
Assignee:
-
Category:
Extension Manager
Target version:
-
Start date:
2011-10-16
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
hard
Sprint Focus:
Needs Decision

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.

Actions #1

Updated by Christian Kuhn about 13 years ago

  • Complexity set to hard
Actions #2

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...

Actions #3

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".

Actions #4

Updated by Susanne Moog over 10 years ago

  • Tracker changed from Bug to Feature
Actions #5

Updated by Susanne Moog over 9 years ago

  • Sprint Focus set to PRC
Actions #6

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.

Actions #7

Updated by Benni Mack over 4 years ago

  • Sprint Focus changed from PRC to Needs Decision
Actions

Also available in: Atom PDF