From db23d388a35fd6a9b83f13939b254680b6109e5e Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Fri, 15 Mar 2013 23:02:31 +0300 Subject: [PATCH] db: fix bug handling ':' character There was a bug here where if you tried to enter something with a colon it messed up. This is a problem for some of my unreleased code. Signed-off-by: Dan Carpenter --- smatch_data/db/fill_db_caller_info.pl | 2 +- smatch_data/db/fill_db_sql.pl | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/smatch_data/db/fill_db_caller_info.pl b/smatch_data/db/fill_db_caller_info.pl index 131eab47..dbbdee00 100755 --- a/smatch_data/db/fill_db_caller_info.pl +++ b/smatch_data/db/fill_db_caller_info.pl @@ -64,7 +64,7 @@ while () { next; } - ($dummy, $dummy, $sql) = split(/:/); + ($dummy, $dummy, $sql) = split(/:/, $_, 3); $sql =~ s/%CALL_ID%/$call_id/; if ($sql =~ /%call_marker%/) { diff --git a/smatch_data/db/fill_db_sql.pl b/smatch_data/db/fill_db_sql.pl index 4b0ed33b..92877a85 100755 --- a/smatch_data/db/fill_db_sql.pl +++ b/smatch_data/db/fill_db_sql.pl @@ -14,6 +14,9 @@ my $db = DBI->connect("dbi:SQLite:smatch_db.sqlite", "", "", {AutoCommit => 0}); $db->do("PRAGMA synchronous = OFF"); $db->do("PRAGMA cache_size = 800000"); $db->do("PRAGMA journal_mode = OFF"); +$db->do("PRAGMA count_changes = OFF"); +$db->do("PRAGMA temp_store = MEMORY"); +$db->do("PRAGMA locking = EXCLUSIVE"); my ($dummy, $sql); @@ -23,7 +26,7 @@ while () { if (!($_ =~ /^.*? [^ ]*\(\) SQL: /)) { next; } - ($dummy, $dummy, $sql) = split(/:/); + ($dummy, $dummy, $sql) = split(/:/, $_, 3); $db->do($sql); } -- 2.11.4.GIT