fixed #4235 Copy table causes SQL error

Signed-off-by: Viduranga Wijesooriya <vpowerrc@gmail.com>
Merge pull request #862 from vpowerrc/bug-#4235

fixed #4235 Copy table causes SQL error