From f30af71a7d984d3e941214784c83e88de4d87787 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Wed, 22 Jan 2014 14:10:41 +0000 Subject: [PATCH] Fix SQL logic in PortMAC.pm (imperfectus) SQL::Abstract::belch(): [SQL::Abstract::_where_field_op_ARRAYREF] Warning: A multi-element arrayref as an argument to the inequality op '!=' is technically equivalent to an always-true 1=1 (you probably wanted to say ...{ $inequality_op => [ -and => @values ] }... instead) at /home/netdisco/perl5/lib/perl5/App/Netdisco/Util/PortMAC.pm line 48 --- Netdisco/Changes | 1 + Netdisco/lib/App/Netdisco/Util/PortMAC.pm | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Netdisco/Changes b/Netdisco/Changes index d52a9fc3..314ede5c 100644 --- a/Netdisco/Changes +++ b/Netdisco/Changes @@ -14,6 +14,7 @@ * [#85] device property in _no/_only fails with error (R. Kerr) * Also prefer port filter when linking to connected devices + * Fix SQL logic in PortMAC.pm (imperfectus) 2.021001 diff --git a/Netdisco/lib/App/Netdisco/Util/PortMAC.pm b/Netdisco/lib/App/Netdisco/Util/PortMAC.pm index b656e3a5..72836397 100644 --- a/Netdisco/lib/App/Netdisco/Util/PortMAC.pm +++ b/Netdisco/lib/App/Netdisco/Util/PortMAC.pm @@ -41,7 +41,7 @@ sub get_port_macs { my $dp_macs = schema('netdisco')->resultset('DevicePort') - ->search( { mac => { '!=', [ undef, '00:00:00:00:00:00' ] } }, + ->search( { mac => { '!=' => [ -and => (undef, '00:00:00:00:00:00') ] } }, { select => [ 'mac', 'ip' ], group_by => [ 'mac', 'ip' ] } ); my $dp_cursor = $dp_macs->cursor;