[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] [BUG] Interchange Search Problem
****** message to minivend-users from Mike Heins <mikeh@minivend.com> ******
Quoting Stefan Hornburg (racke@linuxia.de):
> ****** message to minivend-users from Stefan Hornburg <racke@linuxia.de> ******
>
>
> There is a problem with the MiniVend code in IC latest with database
> records containing \t in their fields. This is at least possible
> with SQL databases. The code portion(s) which is found in DbSearch.pm
> looks like that:
>
> elsif(defined $limit_sub) {
> #::logDebug("f and limit, dbref=$dbref");
> while($_ = join "\t", $dbref->each_nokey($qual || undef) ) {
> next unless &$f();
> next unless &$limit_sub($_);
> push @out, &$return_sub($_);
> }
> }
>
> Any tabs in columns let shows the wrong fields up in limit_sub.
> How can this be fixed ? I have no suggestion yet, only a workaround
> for DBI.pm:
>
> for (my $i; $i < @$return; $i++) {
> $$return[$i] =~ s/\t/ /g;
> }
>
> Insert it at the end of each_nokey.
>
> BTW: Why does MV sorts the records out itself. For performance and
> debugging it would be better to push this task to the SQL engine.
>
I have already found and addressed this separately.
Because you cannot easily predict:
1. Whether it is a SQL database in the firstplace.
2. How to sort case-insensitively.
3. How to sort numerically.
4. How to preload this including joined fields.
It would be possible to add perhaps a "tq" parameter that would
be passed something like:
tq=ORDER by sort_field DESC
and sent via the $qual string in the original select.
--
Akopia, Inc., 131 Willow Lane, Floor 2, Oxford, OH 45056
phone +1.513.523.8220 fax 7501 <heins@akopia.com>
Any man who is under 30, and is not liberal, has not heart; and any man
who is over 30, and is not a conservative, has not brains.
-- Winston Churchill
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list