in reply to Re^2: Recalcitrant placeholders
in thread Recalcitrant placeholders
"I cannot reproduce the problem myself..."
Why not? Please explain.
"To try and get to the bottom of the problem, I have written this script:"
But why post it here. It's littered with all sorts of things unrelated to the base problem which, until we know more, would seem to be database-related. There is taint-related code, web-related code, and three non-CPAN modules about which we basically know nothing. This is not an SSCCE.
I wrote a succinct test and suggested you try it: that doesn't appear to have happened. At the time of writing, you hadn't told us what database you were using. I chose SQLite because it's common and easy to use. If you don't have it, you should be able to write something equally simple with "dbi:SQLite:..." replaced with "dbi:mysql:...".
"The selectrow_array function should not be able to return zero when zero does not exist anywhere in the idPerson field of the database."
What's the basis for that claim?
In "DBI: selectrow_array", there are three examples with '@row_ary = ...'; none with '$some_scalar = ...'. It talks about how calling this in a scalar context can be handled differently depending on the driver being used. It ends with "... you should exercise some caution if you use selectrow_array in a scalar context, or just don't do that." [my emphasis]
Perhaps what you're seeing is something akin to:
$ perl -E 'my @x = (); my $y = @x; say $y' 0
If, after writing an SSCCE and perhaps resolving issues, this still fails in your main application, I would suggest the next step would be to write a /path/to/Bod/CRM/NN-selectrow_array.t and compare '$dbh->selectrow_array(...)' with '$crm->db->selectrow_array(...)'.
My code shown so far uses Perl(5.34.0), DBI(1.643) and DBD::SQLite(1.66). I don't have DBD::mysql installed and I haven't used MySQL for about 20 years, so I can't really help you with that.
— Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Recalcitrant placeholders
by Bod (Parson) on Jul 09, 2021 at 18:03 UTC | |
by haukex (Archbishop) on Jul 09, 2021 at 19:51 UTC | |
by Bod (Parson) on Jul 10, 2021 at 13:45 UTC | |
by haukex (Archbishop) on Jul 17, 2021 at 19:40 UTC | |
by Bod (Parson) on Jul 25, 2021 at 14:31 UTC | |
| |
by hippo (Archbishop) on Jul 09, 2021 at 19:54 UTC |