fixed #4235 Copy table causes SQL error

Signed-off-by: Viduranga Wijesooriya <vpowerrc@gmail.com>