From 5cb8c0e031a7225e191e678d445defba470cac42 Mon Sep 17 00:00:00 2001 From: kkalev Date: Sun, 26 Jan 2003 16:54:12 +0000 Subject: [PATCH] Do a write lock in radacct before truncating it in truncate_radacct --- Changelog | 1 + bin/truncate_radacct | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index f0c0dfb..1e4dd0c 100644 --- a/Changelog +++ b/Changelog @@ -32,6 +32,7 @@ Ver 1.62: * Make things a little bit more simple in lib/ldap/change_attrs.php3 * Fix a small bug in lib/ldap/create_user.php3. Unset the mod array before adding any values to it. * Fix a small problem with debugging +* Do a write lock in radacct before truncating it in truncate_radacct Ver 1.61: * Add a string encoder for greek * If general_decode_normal_attributes is set then encode attributes in lib/ldap/change_info. In the near future diff --git a/bin/truncate_radacct b/bin/truncate_radacct index b12c9d9..9721071 100755 --- a/bin/truncate_radacct +++ b/bin/truncate_radacct @@ -27,5 +27,5 @@ $date = POSIX::strftime("%Y-%m-%d %T",$sec,$min,$hour,($mday - $back_days),$mon, print "$date\n"; $dbh = DBI->connect("DBI:mysql:$sql_database:$sql_server","$sql_username","$sql_password"); -$dbh->do("DELETE FROM $sql_accounting_table WHERE AcctStopTime < '$date';"); +$dbh->do("LOCK TABLES $sql_accounting_table WRITE;DELETE FROM $sql_accounting_table WHERE AcctStopTime < '$date';UNLOCK TABLES;"); $dbh->disconnect(); -- 2.39.5