Fix table name prior to colum_exists call

Fix the table name for statistics tables prior before checking for dummycolum on it and use $table instead of $file as table name.