Fixed build error caused by invalid references during purging/truncating in behat

Fixed build caused by invalid references during purging/truncating at mysql >= 5.5

Please see: 
http://bugs.mysql.com/bug.php?id=58788