Accidently added CONV in SQL::Statement
Jens Rehsack <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.dbi.sybase.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi,
during review of SQL::Statement wrt. RT#100551 I realized that the introduced SQL_FUNCTION_CONV (https://github.com/perl5-dbi/SQL-Statement/blob/master/lib/SQL/Statement/Functions.pm#L454) is unnecessary over-complex.
Since I learned that silent removal of once shipped functionality is a evil - I'd like to get some suggestions.
For existing implementation I miss a proper documentation of edge-cases:
* How is 1.E converted to octal and why is that necessary in SQL?
* Why do the alphabets lower 63 and 63+ based number differ?
* If different encoding schemes are supported either, why is xnt and b85 missing and what's about plain ascii?
From my perspective - unless proper answers are given - the implementation of SQL_FUNCTION_CONV should be replaced by an easy to use wrapper around https://metacpan.org/release/Math-Base-Convert to rely on dedicated tested and approved.
I started a rough test whether it's possible to keep the existing API and run into different results for 1st chosen test
{
test => 'conv 2->92',
sql => "SELECT CONV('101 0100 1111 0111 0110 1011', 2, 92)",
result => [ ['HN(/'] ],
},
Mike's module resulted 'HN)/' - so there seem to be more quirks in individual S::S solution.
Any comments?
Cheers
--
Jens Rehsack
[email protected]