From 800161301a3ad18f1ebb9b377a275c73ea8aaa93 Mon Sep 17 00:00:00 2001
From: Peter Rabbitson <ribasushi@cpan.org>
Date: Mon, 2 Mar 2015 07:08:00 +0100
Subject: [PATCH 2/5] Remove runtime warning not applicable to the slow-moving
 world of debian

While the problem *was* affecting 0.08196, it's not something that would
be of use to many debian production users, and in fact can generate many
misguided bugreports (the warned-about and raher rare condition has been
fixed since 0.08210)

(cherry pick of 93cef6c0)
---
 Changes                              |  3 +++
 lib/DBIx/Class/Storage/DBI/SQLite.pm | 26 +++-----------------------
 t/100populate.t                      | 15 +--------------
 3 files changed, 7 insertions(+), 37 deletions(-)

--- a/Changes
+++ b/Changes
@@ -5,6 +5,9 @@
           resolution codepath, restoring exotic uses of inflate_result
           http://lists.scsys.co.uk/pipermail/dbix-class/2015-January/011876.html
 
+    * Misc
+        - Remove warning about potential side effects of RT#79576 (scheduled)
+
 0.082810 2014-10-25 13:58 (UTC)
     * Fixes
         - Fix incorrect collapsing-parser source being generated in the
--- a/lib/DBIx/Class/Storage/DBI/SQLite.pm
+++ b/lib/DBIx/Class/Storage/DBI/SQLite.pm
@@ -61,14 +61,9 @@
 
 Even if you upgrade DBIx::Class (which works around the bug starting from
 version 0.08210) you may still have corrupted/incorrect data in your database.
-DBIx::Class will currently detect when this condition (more than one
-stringifiable object in one CRUD call) is encountered and will issue a warning
-pointing to this section. This warning will be removed 2 years from now,
-around April 2015, You can disable it after you've audited your data by
-setting the C<DBIC_RT79576_NOWARN> environment variable. Note - the warning
-is emitted only once per callsite per process and only when the condition in
-question is encountered. Thus it is very unlikely that your logsystem will be
-flooded as a result of this.
+DBIx::Class warned about this condition for several years, hoping to give
+anyone affected sufficient notice of the potential issues. The warning was
+removed in version 0.082900.
 
 =back
 
@@ -317,14 +312,7 @@
       = modver_gt_or_eq('DBD::SQLite', '1.37') ? 1 : 0;
   }
 
-  # an attempt to detect former effects of RT#79576, bug itself present between
-  # 0.08191 and 0.08209 inclusive (fixed in 0.08210 and higher)
-  my $stringifiable = 0;
-
   for my $i (0.. $#$bindattrs) {
-
-    $stringifiable++ if ( length ref $bind->[$i][1] and is_plain_value($bind->[$i][1]) );
-
     if (
       defined $bindattrs->[$i]
         and
@@ -367,14 +355,6 @@
     }
   }
 
-  carp_unique(
-    'POSSIBLE *PAST* DATA CORRUPTION detected - see '
-  . 'DBIx::Class::Storage::DBI::SQLite/RT79576 or '
-  . 'http://v.gd/DBIC_SQLite_RT79576 for further details or set '
-  . '$ENV{DBIC_RT79576_NOWARN} to disable this warning. Trigger '
-  . 'condition encountered'
-  ) if (!$ENV{DBIC_RT79576_NOWARN} and $stringifiable > 1);
-
   return $bindattrs;
 }
 
--- a/t/100populate.t
+++ b/t/100populate.t
@@ -385,8 +385,6 @@
 # test all kinds of population with stringified objects
 # or with empty sets
 warnings_like {
-  local $ENV{DBIC_RT79576_NOWARN};
-
   my $rs = $schema->resultset('Artist')->search({}, { columns => [qw(name rank)], order_by => 'artistid' });
 
   # the stringification has nothing to do with the artist name
@@ -507,18 +505,7 @@
   );
 
   $rs->delete;
-} [
-  # warning to be removed around Apr 1st 2015
-  # smokers start failing a month before that
-  (
-    ( DBICTest::RunMode->is_author and ( time() > 1427846400 ) )
-      or
-    ( DBICTest::RunMode->is_smoker and ( time() > 1425168000 ) )
-  )
-    ? ()
-    # one unique for populate() and create() each
-    : (qr/\QPOSSIBLE *PAST* DATA CORRUPTION detected \E.+\QTrigger condition encountered at @{[ __FILE__ ]} line\E \d/) x 4
-], 'Data integrity warnings as planned';
+} [], 'Data integrity warnings gone as planned';
 
 $schema->is_executed_sql_bind(
   sub {
