diff options
author | stuconnolly <stuart02@gmail.com> | 2013-01-15 21:50:30 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2013-01-15 21:50:30 +0000 |
commit | ad016807a908e6bec3174f9e5eae9524e6243d57 (patch) | |
tree | 944a47c5e9c35ffa99fbfa424ee089ae85ea43d7 /Frameworks/PostgresKit/Source/PGPostgresConnection.m | |
parent | 4a5cc4d039152cea726e38af9ff72d617d584513 (diff) | |
download | sequelpro-ad016807a908e6bec3174f9e5eae9524e6243d57.tar.gz sequelpro-ad016807a908e6bec3174f9e5eae9524e6243d57.tar.bz2 sequelpro-ad016807a908e6bec3174f9e5eae9524e6243d57.zip |
- When requesting the server vesion with no current connection, return -1 instead of zero.
- When executing a query, perform the query checks before the connection check to avoid performing unnecessary library calls.
Diffstat (limited to 'Frameworks/PostgresKit/Source/PGPostgresConnection.m')
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresConnection.m | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Frameworks/PostgresKit/Source/PGPostgresConnection.m b/Frameworks/PostgresKit/Source/PGPostgresConnection.m index 3063db84..dda021fe 100644 --- a/Frameworks/PostgresKit/Source/PGPostgresConnection.m +++ b/Frameworks/PostgresKit/Source/PGPostgresConnection.m @@ -231,11 +231,11 @@ static void _PGPostgresConnectionNoticeProcessor(void *arg, const char *message) /** * Returns the version of the server we're connected to. * - * @return The server version (e.g. version 9.1 is 90100). Zero is returned if there's no connection. + * @return The server version (e.g. version 9.1 is 90100). -1 is returned if there's no connection. */ - (NSUInteger)serverVersion { - if (![self isConnected]) return 0; + if (![self isConnected]) return -1; return PQserverVersion(_connection); } |