Crash: SQL syntax error in get_bibles()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lyricue |
Fix Released
|
Medium
|
ChrisDebenham |
Bug Description
lyricue-2.2.1
mysql-5.1.46
perl-DBD-
When running lyricue and after successfully logging into the database I have been getting this:
DBD::mysql::db selectall_arrayref failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INDEX_STATISTICS' at line 1 at /usr/bin/lyricue line 9896.
Can't use an undefined value as an ARRAY reference at /usr/bin/lyricue line 9896.
I finally figured out your scan for tables was returning the information_schema pseudo table in new mysql servers, and of course these tables can't be poked at with a select looking for verses like you normally would.
You can probably come up with something more elegant in perl than I can, but attached is a quick patch that makes it work here.
Changed in lyricue: | |
assignee: | nobody → ChrisDebenham (chris-debenham) |
importance: | Undecided → Medium |
status: | New → In Progress |
Changed in lyricue: | |
status: | Fix Committed → Fix Released |
Interesting - I have the information_schema db as well, but don't have the INDEX_STATISTICS table so I don't hit this issue.
The search for valid bible databases is able to handle databases without any suitable bible tables (it just checks all tables in each database for a 'verseid' field and then checks for a verse with the bookname 'Bible' so should ignore anything other than lyricue format bibles)
The failure is when lyricue is trying to run "describe INDEX_STATISTICS" so I'm not sure why that would fail
I've made a change to that direct line to avoid this issue for any table which is not behaving :-)
From:
my @fields = @{$db-> selectall_ arrayref( "describe " . $tablename)};
To:
my $tmpfields = $db->selectall_ arrayref( "describe " . $tablename);
if (!defined $tmpfields) {
next;
}
my @fields = @{$tmpfields};