madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r19496: LJSV-1325: Last txtid select.

Committer: sbelyaev
LJSV-1325: Last txtid select.
U   trunk/cgi-bin/ljlang.pl
Modified: trunk/cgi-bin/ljlang.pl
===================================================================
--- trunk/cgi-bin/ljlang.pl	2011-07-19 08:14:48 UTC (rev 19495)
+++ trunk/cgi-bin/ljlang.pl	2011-07-19 09:45:23 UTC (rev 19496)
@@ -358,7 +358,7 @@
     my $dbh = LJ::get_db_writer();
     my $txtid = 0;
 
-    my $oldtextid = $dbh->selectrow_array("SELECT txtid FROM ml_text WHERE lnid=? AND dmid=? AND itid=?", undef, $lnid, $dmid, $itid);
+    my $oldtextid = $dbh->selectrow_array("SELECT MAX(txtid) FROM ml_text WHERE lnid=? AND dmid=? AND itid=?", undef, $lnid, $dmid, $itid);
 
     if (defined $text) {
         my $userid = $opts->{'userid'} + 0;

Tags: livejournal, madeon, pl
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