aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/SPTableData.h2
-rw-r--r--Source/SPTableData.m16
2 files changed, 3 insertions, 15 deletions
diff --git a/Source/SPTableData.h b/Source/SPTableData.h
index 1b457ca7..05783256 100644
--- a/Source/SPTableData.h
+++ b/Source/SPTableData.h
@@ -55,8 +55,8 @@
}
@property (readonly, assign) BOOL tableHasAutoIncrementField;
+@property (nonatomic, retain) SPMySQLConnection *connection;
-- (void) setConnection:(SPMySQLConnection *)theConnection;
- (NSString *) tableEncoding;
- (NSString *) tableCreateSyntax;
- (NSArray *) columns;
diff --git a/Source/SPTableData.m b/Source/SPTableData.m
index cb98183e..27dd4ea1 100644
--- a/Source/SPTableData.m
+++ b/Source/SPTableData.m
@@ -48,6 +48,7 @@
@implementation SPTableData
@synthesize tableHasAutoIncrementField;
+@synthesize connection = mySQLConnection;
- (id) init
{
@@ -61,7 +62,6 @@
triggers = nil;
tableEncoding = nil;
tableCreateSyntax = nil;
- mySQLConnection = nil;
tableHasAutoIncrementField = NO;
pthread_mutex_init(&dataProcessingLock, NULL);
@@ -71,18 +71,6 @@
}
/**
- * Set the connection for use.
- * Called by the connect sheet methods.
- *
- * @param theConnection The used connection for the SPDatabaseDocument
- */
-- (void) setConnection:(SPMySQLConnection *)theConnection
-{
- mySQLConnection = theConnection;
- [mySQLConnection retain];
-}
-
-/**
* Retrieve the encoding for the current table, using or refreshing the cache as appropriate.
*/
- (NSString *) tableEncoding
@@ -1415,7 +1403,7 @@
if (triggers) SPClear(triggers);
if (tableEncoding) SPClear(tableEncoding);
if (tableCreateSyntax) SPClear(tableCreateSyntax);
- if (mySQLConnection) SPClear(mySQLConnection);
+ [self setConnection:nil];
pthread_mutex_destroy(&dataProcessingLock);