Maybe your perl, maybe any of the versions of the modules used ...
I copied your events.db to rt121127.csv
--8<--- rt121127.pl
use 5.18.2;
use warnings;
use DBI;
use Data::Peek;
binmode STDERR, ":encoding(utf-8)";
my $dir = -d "sandbox" ? "sandbox" : ".";
my $dbh = DBI->connect ("dbi:CSV:", undef, undef, {
f_ext => ".csv/r",
f_dir => $dir,
csv_null => 1,
csv_sep_char => "|",
csv_quote_char => undef,
});
my $sth = $dbh->prepare (<<~ ";");
select *
from rt121127
where entry IS NOT NULL
and entry NOT LIKE '#%'
and band LIKE ?
order by entry
;
$sth->execute ("Canberra Brass");
while (my $row = $sth->fetch) {
DDumper $row;
}
-->8---
$ perl -d:TraceUse=hidecore sandbox/rt121127.pl
[ '1097',
'Canberra Brass',
'9th Annual Hall Concert',
'Australia',
'Brass Band',
'Hall School Museum and Heritage Centre, Australia capital territory',
undef,
'16',
'30',
'
https://www.facebook.com/events/1925594404364691',
undef,
'njh@bandsman.co.uk',
'19-Mar-2017',
'njh'
]
Modules used from sandbox/rt121127.pl:
2. DBI 1.637, sandbox/rt121127.pl line 6 [main]
15. Config_heavy.pl, Config.pm line 80
16. Config_git.pl, Config_heavy.pl line 1414 [Config]
53. DBD::CSV 0.50, DBI.pm line 787 (eval 15) [DBI::_firesafe]
54. Text::CSV_XS 1.32, DBD/CSV.pm line 43 [DBD::CSV::dr]
55. DBD::File 0.44, DBD/CSV.pm line 15 [DBI::_firesafe]
57. DBI::DBD::SqlEngine 0.06, base.pm line 100
58. DBI::SQL::Nano 1.015544, DBI/DBD/SqlEngine.pm line 27 [base]
59. SQL::Statement 1.412, DBI/SQL/Nano.pm line 34
60. SQL::Parser 1.412, SQL/Statement.pm line 20
61. Params::Util 1.07, SQL/Parser.pm line 21
65. utf8_heavy.pl, utf8.pm line 16
67. unicore/Heavy.pl, utf8_heavy.pl line 185 [utf8]
68. unicore/lib/Perl/Word.pl, utf8_heavy.pl line 534 [utf8]
89. SQL::Dialects::AnyData 1.412, SQL/Parser.pm line 319
90. SQL::Dialects::Role 1.412, SQL/Dialects/AnyData.pm line 20
69. SQL::Eval 1.412, SQL/Statement.pm line 21
70. SQL::Statement::RAM 1.412, SQL/Statement.pm line 22
71. SQL::Statement::TermFactory 1.412, SQL/Statement.pm line 23
72. SQL::Statement::Term 1.412, SQL/Statement/TermFactory.pm line 16
73. SQL::Statement::Operation 1.412, SQL/Statement/TermFactory.pm line 17
74. SQL::Statement::Placeholder 1.412, SQL/Statement/TermFactory.pm line 18
75. SQL::Statement::Function 1.412, SQL/Statement/TermFactory.pm line 19
76. SQL::Statement::Functions 1.412, SQL/Statement/Function.pm line 68 [SQL::Statement::Function::UserFunc]
80. Module::Runtime 0.015, SQL/Statement/Functions.pm line 26
81. SQL::Statement::Util 1.412, SQL/Statement.pm line 24
82. Clone 0.39, SQL/Statement.pm line 27
14. Data::Peek 0.47, sandbox/rt121127.pl line 7 [main]
17. Perl::Tidy 20170521, Data/Peek.pm line 24 (eval 5)
24. Log::Agent, Storable.pm line 32 (FAILED)
30. Encode::ConfigLocal, Encode.pm line 69 (FAILED)
48. HTML::Entities 3.69, Perl/Tidy.pm line 4613 (eval 13) [Perl::Tidy::HtmlWriter]
49. HTML::Parser 3.72, HTML/Entities.pm line 152
So, on my system with those modules, the error does not reproduce.