Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: third_party/sqlite/src/interior.pl

Issue 9144001: The complete work-in-progress SQLite recover virtual table. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sigh, forgot to specify baseline. Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/sqlite/src/create_tables ('k') | third_party/sqlite/src/main.mk » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/interior.pl
diff --git a/third_party/sqlite/src/interior.pl b/third_party/sqlite/src/interior.pl
new file mode 100755
index 0000000000000000000000000000000000000000..414380301093a9282a0ccd45e01643f89f85d546
--- /dev/null
+++ b/third_party/sqlite/src/interior.pl
@@ -0,0 +1,27 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Getopt::Long;
+
+my $table = "interior";
+GetOptions("table=s" => \$table);
+
+print "-- Create a tree with interior nodes.\n";
+print "CREATE TABLE $table (\n";
+print " file TEXT,\n";
+print " lineno INT,\n";
+print " line TEXT\n";
+print ");\n";
+
+foreach my $file (@ARGV) {
+ print "SELECT 'Loading from $file';\n";
+ print "BEGIN;\n";
+ open(F, $file) || die("Open $file: $!");
+ while (<F>) {
+ chomp;
+ s/'/''/g;
+ print "INSERT INTO $table VALUES ('$file', $., '$_');\n";
+ }
+ close(F) || die("Close $file: $!");
+ print "COMMIT;\n";
+}
« no previous file with comments | « third_party/sqlite/src/create_tables ('k') | third_party/sqlite/src/main.mk » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698