Fix getTableNames bug on empty database

When function "getTableNames" is called on a empty database, an error occured "Undefined variable: tableNames"
Merge pull request #103 from neilime/patch-1

Fix getTableNames bug on empty database