Transfer 'query' field into table, selection and where if possible

This commit is contained in:
Jamie Cameron
2016-06-22 22:44:14 -07:00
parent 613efe4ace
commit bcd16e5ade

View File

@@ -2078,6 +2078,12 @@ else {
local $v = &get_real_value($value."_".$k);
$conf->{$k} = $v;
}
if ($conf->{'query'} =~ /^select\s+(\S+)\s+from\s+(\S+)\s+where\s+(\S+)\s+=\s+'\%s'/i && !$conf->{'table'}) {
# Try to extract table and fields from the query
$conf->{'select_field'} = $1;
$conf->{'table'} = $2;
$conf->{'where_field'} = $3;
}
}
return $conf;
}