mirror of
https://github.com/gnustep/libs-sqlclient.git
synced 2025-02-21 02:41:07 +00:00
mysql fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/sqlclient/trunk@31131 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e307f93142
commit
6fe56d2e1e
3 changed files with 28 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2010-08-13 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* MySQL.m: Try to recognise loss of connection.
|
||||||
|
Fix bug in timezone management.
|
||||||
|
|
||||||
2010-07-16 Richard Frith-Macdonald <rfm@gnu.org>
|
2010-07-16 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* MySQL.m: Add support for TEXT data and for MySQL's failure to support
|
* MySQL.m: Add support for TEXT data and for MySQL's failure to support
|
||||||
|
|
26
MySQL.m
26
MySQL.m
|
@ -212,8 +212,17 @@ static NSNull *null = nil;
|
||||||
|
|
||||||
if (mysql_real_query(connection, statement, length) != 0)
|
if (mysql_real_query(connection, statement, length) != 0)
|
||||||
{
|
{
|
||||||
[NSException raise: SQLException format: @"%s",
|
NSString *s;
|
||||||
mysql_error(connection)];
|
|
||||||
|
s = [NSString stringWithFormat: @"%s", mysql_error(connection)];
|
||||||
|
if (mysql_ping(connection) == 0)
|
||||||
|
{
|
||||||
|
[NSException raise: SQLException format: @"%@", s];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[NSException raise: SQLConnectionException format: @"%@", s];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* discard any results.
|
/* discard any results.
|
||||||
*/
|
*/
|
||||||
|
@ -435,8 +444,17 @@ static unsigned int trim(char *str)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
[NSException raise: SQLException format: @"%s",
|
NSString *s;
|
||||||
mysql_error(connection)];
|
|
||||||
|
s = [NSString stringWithFormat: @"%s", mysql_error(connection)];
|
||||||
|
if (mysql_ping(connection) == 0)
|
||||||
|
{
|
||||||
|
[NSException raise: SQLException format: @"%@", s];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[NSException raise: SQLConnectionException format: @"%@", s];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
|
|
|
@ -1161,7 +1161,7 @@ static unsigned int maxConnections = 8;
|
||||||
NSTimeInterval elapsed;
|
NSTimeInterval elapsed;
|
||||||
|
|
||||||
/* If we have repeated connection failures, we enforce a
|
/* If we have repeated connection failures, we enforce a
|
||||||
* delay fo up to 30 seconds between connection attempts
|
* delay of up to 30 seconds between connection attempts
|
||||||
* to avoid overloading the system with too frequent
|
* to avoid overloading the system with too frequent
|
||||||
* connection attempts.
|
* connection attempts.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue