From adc715e3c685ec81f9a000ce88c19f33736557e8 Mon Sep 17 00:00:00 2001
From: Peter Rabbitson <ribasushi@cpan.org>
Date: Tue, 17 Mar 2015 16:21:47 +0100
Subject: [PATCH 4/5] Fix exception on complex update/delete under a replicated
 setup

THIS COMMIT IS A HACK!!! The actual fix is migration of the logic to the
SQLMaker subclass and deal with it there. However the entire class hierarchy
is currently in flux, so go with the least invasive change until the storage
rewrite settles.

(cherry pick of 7f95ea99)
---
 Changes                                  | 2 ++
 lib/DBIx/Class/Storage/DBI/Replicated.pm | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

--- a/Changes
+++ b/Changes
@@ -5,6 +5,8 @@
           resolution codepath, restoring exotic uses of inflate_result
           http://lists.scsys.co.uk/pipermail/dbix-class/2015-January/011876.html
         - Fix updating multiple CLOB/BLOB columns on Oracle
+        - Fix exception on complex update/delete under a replicated setup
+          http://lists.scsys.co.uk/pipermail/dbix-class/2015-January/011903.html
 
     * Misc
         - Remove warning about potential side effects of RT#79576 (scheduled)
--- a/lib/DBIx/Class/Storage/DBI/Replicated.pm
+++ b/lib/DBIx/Class/Storage/DBI/Replicated.pm
@@ -307,6 +307,7 @@
     _parse_connect_do
     savepoints
     _sql_maker_opts
+    _use_multicolumn_in
     _conn_pid
     _dbh_autocommit
     _native_data_type
@@ -363,7 +364,7 @@
     # the capability framework
     # not sure if CMOP->initialize does evil things to DBIC::S::DBI, fix if a problem
     grep
-      { $_ =~ /^ _ (?: use | supports | determine_supports ) _ /x }
+      { $_ =~ /^ _ (?: use | supports | determine_supports ) _ /x and $_ ne '_use_multicolumn_in' }
       ( Class::MOP::Class->initialize('DBIx::Class::Storage::DBI')->get_all_method_names )
   )],
 };
