From ecbae5d1a752590537ee6cd3d13970166e615aaa Mon Sep 17 00:00:00 2001 From: Rene Krenn Date: Thu, 16 May 2024 09:08:02 +0200 Subject: [PATCH] MT#60120 set explicit tempdir for SQlite huge sqlite databases cause huge tempfiles (even for SELECT), sometimes too big for the system's tempfolder. Change-Id: I7d19b1b30f90d63fdfd41f4c9329708f1584bfc9 (cherry picked from commit ad3b6e48f10ca0f4c5026786c6a4e4509fc4e858) (cherry picked from commit 3a2662ebd639de1b4fc28647a49d994ba4f1dd4d) --- lib/NGCP/BulkProcessor/SqlConnectors/SQLiteDB.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/NGCP/BulkProcessor/SqlConnectors/SQLiteDB.pm b/lib/NGCP/BulkProcessor/SqlConnectors/SQLiteDB.pm index 7b714aa..3eb925f 100644 --- a/lib/NGCP/BulkProcessor/SqlConnectors/SQLiteDB.pm +++ b/lib/NGCP/BulkProcessor/SqlConnectors/SQLiteDB.pm @@ -64,7 +64,7 @@ my $texttable_encoding = 'UTF-8'; # sqlite returns whats inserted... $DBD::SQLite::COLLATION{no_accents} = sub { my ( $a, $b ) = map lc, @_; - tr[àâáäåãçðèêéëìîíïñòôóöõøùûúüý] + tr[àâáäåãçðèêéëìîíïñòôóöõøùûúüý] [aaaaaacdeeeeiiiinoooooouuuuy] for $a, $b; $a cmp $b; }; @@ -269,6 +269,9 @@ sub db_connect { #PRAGMA locking_mode = NORMAL ... by default #$self->db_do('PRAGMA auto_vacuum = INCREMENTAL'); #$self->db_do('PRAGMA read_uncommitted = ' . $read_uncommitted_isolation_level); + if ($local_db_path and ($filemode == $staticdbfilemode or $filemode == $timestampdbfilemode)) { + $self->db_do("PRAGMA temp_store_directory = '$local_db_path'"); + } dbinfo($self,'connected',getlogger(__PACKAGE__));