fixed database::query() incorrect return value for NULL type

`query()` return the execute result but not the rows affected that type isn't select / insert / update.