Cloning a QueryBuilder object only performs a shallow clone. This is problematic as object references in the dqlParts array stay the same in cloned copies of a QueryBuilder object.
For example, say I have a QueryBuilder object with two simple "andWhere" clauses. Now I clone the QueryBuilder instance and add a third "andWhere" clause to the cloned object. The 3rd andWhere clause will also appear in the original QueryBuilder object. The desired behavior is that the original QueryBuilder object is not modified when adding clauses to the cloned copy.