Hello,
I am using UTF-8 characters within Dollar-quoted tags.
Following code is the problem-setting.
--- CODE BEGIN ---
#!/usr/bin/perl
use strict; use DBI;
my $db = DBI->connect(
"dbi:Pg:dbname=$PgDbName;host=$PgHost;port=$PgPort",
$PgSqlUser, $PgSqlPass);
my $txt = '2';
my $delim = "\$\x{5317}\$";
my $sql = "SELECT $delim$txt$delim";
print "SQL = '$sql'\n";
$db->do($sql);
print "after do\n";
$db->selectrow_hashref($sql);
print "after_selectrow_hashref\n";
--- CODE END ---
The script dies during selectrow_hashref and the output of the script is
--- OUTPUT BEGIN ---
SQL = 'SELECT $北$2$北$'
after do
Invalid placeholders: must start at $1 and increment one at a time
(expected: $1)
--- OUTPUT END ---
It seems like $2 is interpreted as placeholder before the evaluation of
Dollar-quoting, but only in $db->selectrow_hashref().
The inconsistent part is that $db->do() works just fine.
Regards,
Markus
System: Debian sid with libdbd-pg-perl 2.18.1-1+b1 and perl 5.14.2-6