From 7c236e35cb6539bacc4e990978726b2c0436d95a Mon Sep 17 00:00:00 2001 From: timriker Date: Mon, 4 Nov 2002 06:54:16 +0000 Subject: [PATCH] randKey dbm fix git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@603 c11ca15a-4712-0410-83d8-924469b57eb5 --- src/db_dbm.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/db_dbm.pl b/src/db_dbm.pl index 909ed18..3bfd992 100644 --- a/src/db_dbm.pl +++ b/src/db_dbm.pl @@ -321,6 +321,7 @@ sub getKeys { sub randKey { &DEBUG("STUB: &randKey(@_);"); + my ($table, $select) = @_; my @format = &dbGetColInfo($table); if (!scalar @format) { return; @@ -328,7 +329,7 @@ sub randKey { my $rand = int(rand(&countKeys($table) - 1)); my @keys = keys %{$table}; - &dbGet($table, '*', "@format[0]=@keys[$rand]"); + &dbGet($table, '$select', "@format[0]=@keys[$rand]"); } ##### -- 2.39.5