workaround for mySql truncate function
improved function test