From 497ab60346e74927fb7980734799d1e57af541d5 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Wed, 18 Apr 2012 23:59:05 +0000 Subject: - Correctly call mysql_library_init() on application start, and mysql_thread_init() and mysql_thread_end() on each thread as appropriate. This will improve observed MySQL stability, especially in certain circumstances such as LOAD DATA INFILE. --- .../Source/SPMySQLConnection Categories/Querying & Preparation.m | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Querying & Preparation.m') diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Querying & Preparation.m b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Querying & Preparation.m index 5df71e96..46615cae 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Querying & Preparation.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Querying & Preparation.m @@ -76,6 +76,9 @@ } if (![self _checkConnectionIfNecessary]) return nil; + // Ensure per-thread variables are set up + [self _validateThreadSetup]; + // Perform a lossy conversion to bytes, using NSData to do the hard work. Preserves // nul characters correctly. NSData *cData = [theString dataUsingEncoding:stringEncoding allowLossyConversion:YES]; @@ -229,6 +232,9 @@ return nil; } + // Ensure per-thread variables are set up + [self _validateThreadSetup]; + // Check the connection if necessary, returning nil if the query couldn't be validated if (![self _checkConnectionIfNecessary]) return nil; -- cgit v1.2.3