mirror of
https://github.com/gnustep/libs-sqlclient.git
synced 2025-02-22 11:21:20 +00:00
tweak
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/sqlclient/trunk@35723 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
bb290f0415
commit
828973acbc
2 changed files with 6 additions and 2 deletions
|
@ -11,7 +11,7 @@
|
||||||
* testPostgres.m:
|
* testPostgres.m:
|
||||||
Change execute methods to return a count of the rows to which the
|
Change execute methods to return a count of the rows to which the
|
||||||
executed operation applies, or -1 if not supported.
|
executed operation applies, or -1 if not supported.
|
||||||
Implement for postgresql.
|
Implement for postgresql and mysql.
|
||||||
|
|
||||||
2012-06-17 Richard Frith-Macdonald <rfm@gnu.org>
|
2012-06-17 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
|
6
MySQL.m
6
MySQL.m
|
@ -176,6 +176,7 @@ static NSNull *null = nil;
|
||||||
- (NSInteger) backendExecute: (NSArray*)info
|
- (NSInteger) backendExecute: (NSArray*)info
|
||||||
{
|
{
|
||||||
NSString *stmt;
|
NSString *stmt;
|
||||||
|
NSInteger rowCount = 0;
|
||||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||||
|
|
||||||
stmt = [info objectAtIndex: 0];
|
stmt = [info objectAtIndex: 0];
|
||||||
|
@ -225,6 +226,9 @@ static NSNull *null = nil;
|
||||||
[NSException raise: SQLConnectionException format: @"%@", s];
|
[NSException raise: SQLConnectionException format: @"%@", s];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* See how many rows were modified.
|
||||||
|
*/
|
||||||
|
rowCount = mysql_affected_rows(connection);
|
||||||
/* discard any results.
|
/* discard any results.
|
||||||
*/
|
*/
|
||||||
result = mysql_store_result(connection);
|
result = mysql_store_result(connection);
|
||||||
|
@ -258,7 +262,7 @@ static NSNull *null = nil;
|
||||||
}
|
}
|
||||||
NS_ENDHANDLER
|
NS_ENDHANDLER
|
||||||
[arp release];
|
[arp release];
|
||||||
return -1;
|
return rowCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned int trim(char *str)
|
static unsigned int trim(char *str)
|
||||||
|
|
Loading…
Reference in a new issue