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 {