Skip Menu |

This queue is for tickets about the Net-Google-SafeBrowsing2 CPAN distribution.

Report information
The Basics
Id: 72317
Status: resolved
Priority: 0/
Queue: Net-Google-SafeBrowsing2

People
Owner: Nobody in particular
Requestors: colinmkeith [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.0
Fixed in: (no value)



Subject: DBD::SQLite::db do failed: no such table: main.s_chunks
When running the example code from the POD to download and check the SafeBrowsing database I get this error message: DBD::SQLite::db do failed: no such table: main.s_chunks at .../Net/Google/SafeBrowsing2/Sqlite.pm line 192. And the queries fail to work even for sites known to be bad sites. The attached patch moves the creation of the unique index on s_chunks from create_table_a_chunks() into create_table_s_chunks() so that the table exists before the index is created. I'm still not finding that a known host is returning any response though, but at least it no longer generates an error.
Subject: Sqlite.pm.patch
--- Net/Google/SafeBrowsing2/Sqlite.pm.orig 2011-11-09 12:48:08.000000000 -0500 +++ Net/Google/SafeBrowsing2/Sqlite.pm 2011-11-09 12:48:30.000000000 -0500 @@ -179,17 +179,6 @@ ); }; $self->{dbh}->do($index); - - $index = qq{ - CREATE UNIQUE INDEX s_chunks_unique ON s_chunks ( - hostkey, - prefix, - num, - add_num, - list - ); - }; - $self->{dbh}->do($index); } sub create_table_s_chunks { @@ -220,6 +209,17 @@ ); }; $self->{dbh}->do($index); + + $index = qq{ + CREATE UNIQUE INDEX s_chunks_unique ON s_chunks ( + hostkey, + prefix, + num, + add_num, + list + ); + }; + $self->{dbh}->do($index); } sub create_table_full_hashes {
Thank you for the patch. Indeed I put the code at the right place. This is fixed, and the new Sqlite module is now in CPAN. It takes about 24 hours to get a complete local database due to how the API works. If you still have issues after ensuring you have a complete local database, please let me know at jsobrier@zscaler.com