Ticket #387 (new enhancement)
wildcard select & num index for column
|Reported by:||joximu||Owned by:||joximu|
|Priority:||blocker||Milestone:||ispCP ω 1.x.0|
|Component:||Backend (Engine)||Version:||ispCP ω nightly build|
|Severity:||Hard||Keywords:||wildcard select and numeric column index|
Having a lok at the problem from here http://www.isp-control.net/forum/errors-after-update-to-latest-trunk-t-766.html I realized that the handling of the mysql selects and results is not very friendly for extensions. Example: add a new column to the domain table, eg. "myflag" defaulting to "no". Now add a new domain/user - in (apache)ispcp.conf and the zonefile of the new domain there will be "no" instead of the IP address. The reason: in ispcp-dmn-mngr (function dmn_mngr_engine) there is a mysql select and the handling of the result (picked out some commands in order):
$sql = "select t1.*, t2.ip_number from domain as t1, server_ips as t2 where ..." ($rs, $rows) = doSQL($sql); my $entry = @$rows; $rs = dmn_add_data($entry); # in "dmn_add_data" the argument is given over to other functions # also to dmn_add_named_db_data: my ($dmn_data) = @_; my $dmn_ip = @$dmn_data;
ok - the 21st field/column of the first result row is the IP address... not in our case with the new field....!
This really should be changed/improved. You never can rely on the order or the number of columns in a table (at least not if there is no check done if the order and numer still is as assumed) - a very basic database rule..
I put it to release 1.1 - for 1.0 we can write something about not extending the tables but as soon as there are people who want to extend ispcp this will be a bigger problem.
- Milestone changed from ispCP ω 1.1.0 to ispCP ω 1.0.0 - RC3
comment:25 Changed 6 years ago by rats
- Severity set to Hard
- Milestone changed from ispCP ω 1.1.0 to Working
comment:26 Changed 6 years ago by rats
- Priority changed from minor to blocker
- Version changed from ispCP ω 1.0.0 - RC2 to ispCP ω 1.0.0 - DEV
- Milestone changed from Working to ispCP ω 1.1.0