Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[ljcom] r9764: do not issue an SQL query with an empty ...

Committer: ailyin
do not issue an SQL query with an empty IN() (also, what does this module do?)
U   trunk/cgi-bin/LJ/PromoText.pm
Modified: trunk/cgi-bin/LJ/PromoText.pm
===================================================================
--- trunk/cgi-bin/LJ/PromoText.pm	2010-11-29 04:05:00 UTC (rev 9763)
+++ trunk/cgi-bin/LJ/PromoText.pm	2010-11-30 03:52:51 UTC (rev 9764)
@@ -155,6 +155,8 @@
         $sets{$row->{setid}} = $row;
     }
 
+    return unless %sets;
+
     # get the items of each set that the given effective class can see
     my $need_bind = join(",", map { "?" } keys %sets);
     $sth = $dbh->prepare("SELECT * FROM promo_item WHERE setid IN ($need_bind)");

Tags: andy, ljcom, pm
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments