Skip Menu |

This queue is for tickets about the SQL-Object CPAN distribution.

Report information
The Basics
Id: 102356
Status: new
Priority: 0/
Queue: SQL-Object

People
Owner: Nobody in particular
Requestors: spechenin [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Overloaded operators should return new object instance
Date: Wed, 25 Feb 2015 23:43:45 +0300
To: bug-SQL-Object [...] rt.cpan.org
From: Vyacheslav Pechenin <spechenin [...] gmail.com>
$A = sql_obj("SQL1") $B = sql_obj("SQL2") Let us look at the logic of overloaded operator "+" $C = $A + $B The current module implementation makes changes to $A and then returns reference to $A as a result. So the result is: $A->as_sql() eq 'SQL1 AND SQL2'; # $A is changed! $B->as_sql() eq 'SQL2' $C->as_sql() eq 'SQL1 AND SQL2' $A == $C; # same address in memory This is incorrect and in no way acceptable behaviour.