]> git.donarmstrong.com Git - infobot.git/commitdiff
randKey dbm fix
authortimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Mon, 4 Nov 2002 06:54:16 +0000 (06:54 +0000)
committertimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Mon, 4 Nov 2002 06:54:16 +0000 (06:54 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@603 c11ca15a-4712-0410-83d8-924469b57eb5

blootbot/src/db_dbm.pl

index 909ed1858f107f0000d670c06a658c7b018a3bb7..3bfd992ca27d94a9776a24a417bd58d25d5e6bd0 100644 (file)
@@ -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]");
 }
 
 #####