kareila: (Default)
kareila ([personal profile] kareila) wrote in [site community profile] changelog2010-07-17 04:20 pm

[dw-free] error in DW::Worker::DistributeInvites

[commit: http://hg.dwscoalition.org/dw-free/rev/9f696cf19910]

http://bugs.dwscoalition.org/show_bug.cgi?id=2777

Change INSERT DELAYED statements to regular INSERTS.

InnoDB doesn't support DELAYED. The latest MySQL upgrade made these cause
DBI errors instead of silently ignoring the DELAYED part as before.

Patch by [personal profile] kareila.

Files modified:
  • cgi-bin/LJ/AccessLogSink/Database.pm
  • cgi-bin/LJ/ConfCheck/General.pm
  • cgi-bin/LJ/Error.pm
  • cgi-bin/ljlib.pl
--------------------------------------------------------------------------------
diff -r 1caed5101568 -r 9f696cf19910 cgi-bin/LJ/AccessLogSink/Database.pm
--- a/cgi-bin/LJ/AccessLogSink/Database.pm	Sat Jul 17 10:57:34 2010 -0500
+++ b/cgi-bin/LJ/AccessLogSink/Database.pm	Sat Jul 17 11:20:10 2010 -0500
@@ -122,8 +122,7 @@ sub log {
     $self->extra_values($rec, $copy);
 
     my $ins = sub {
-        my $delayed = $LJ::IMMEDIATE_LOGGING ? "" : "DELAYED";
-        $dbl->do("INSERT $delayed INTO $table (" . join(',', keys %$copy) . ") ".
+        $dbl->do("INSERT INTO $table (" . join(',', keys %$copy) . ") ".
                  "VALUES (" . join(',', map { $dbl->quote($copy->{$_}) } keys %$copy) . ")");
     };
 
diff -r 1caed5101568 -r 9f696cf19910 cgi-bin/LJ/ConfCheck/General.pm
--- a/cgi-bin/LJ/ConfCheck/General.pm	Sat Jul 17 10:57:34 2010 -0500
+++ b/cgi-bin/LJ/ConfCheck/General.pm	Sat Jul 17 11:20:10 2010 -0500
@@ -489,9 +489,6 @@ add_conf('%DB_REPORT_HANDLES',
 add_conf('%DB_REPORT_HANDLES',
          type => '',
          des => "");
-add_conf('$IMMEDIATE_LOGGING',
-         type => '',
-         des => "");
 add_conf('$FREECHILDREN_BCAST',
          type => '',
          des => "");
diff -r 1caed5101568 -r 9f696cf19910 cgi-bin/LJ/Error.pm
--- a/cgi-bin/LJ/Error.pm	Sat Jul 17 10:57:34 2010 -0500
+++ b/cgi-bin/LJ/Error.pm	Sat Jul 17 11:20:10 2010 -0500
@@ -230,10 +230,8 @@ sub log {
         }
     };
 
-    my $delayed = $LJ::IMMEDIATE_LOGGING ? "" : "DELAYED";
-
     my $ins = sub {
-        my $insert_sql = "INSERT $delayed INTO $table_name (" . join(", ", keys %insert) . ") VALUES (" .
+        my $insert_sql = "INSERT INTO $table_name (" . join(", ", keys %insert) . ") VALUES (" .
             join(",", map { "?" } values %insert) . ")";
 
         $dbl->do($insert_sql, undef, values %insert);
diff -r 1caed5101568 -r 9f696cf19910 cgi-bin/ljlib.pl
--- a/cgi-bin/ljlib.pl	Sat Jul 17 10:57:34 2010 -0500
+++ b/cgi-bin/ljlib.pl	Sat Jul 17 11:20:10 2010 -0500
@@ -2136,7 +2136,7 @@ sub note_recent_action {
         or return undef;
 
     # append to recentactions table
-    $dbcm->do("INSERT DELAYED INTO recentactions VALUES (?)", undef, $action);
+    $dbcm->do( "INSERT INTO recentactions VALUES (?)", undef, $action );
     return undef if $dbcm->err;
 
     return 1;
--------------------------------------------------------------------------------