aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CMMCPResult.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-07-13 21:05:51 +0000
committerrowanbeentje <rowan@beent.je>2009-07-13 21:05:51 +0000
commit778d7280bae1fe413e0b2db799495454ac165c35 (patch)
treeca520b830274ee08aaefe2db02d903caa329ac70 /Source/CMMCPResult.m
parent27db10fe504117dd8b4a166dcfc94881528c44c3 (diff)
downloadsequelpro-778d7280bae1fe413e0b2db799495454ac165c35.tar.gz
sequelpro-778d7280bae1fe413e0b2db799495454ac165c35.tar.bz2
sequelpro-778d7280bae1fe413e0b2db799495454ac165c35.zip
Rework data storage and retrieval in TableContent and CustomQuery backing arrays, and make some editable CustomQuery improvements:
- Switch to using arrays for row storage rather than dictionaries. Use the data column index for table column identifiers. - This fixes Issue #316 and also allows sorting by all custom query result columns using a column index rather than the name - Offers significant speed and memory advantages: result building is now 2x-3x faster, memory used for results storage is 30-40% lower, and result access is slightly faster. (Note full 2x-3x speed results won't be seen - result fetching and mysql binary work isn't included in the timing) - No longer need to fetch the first column of data for tables containing only blob types - Correctly escape strings when editing CustomQuery results - Rewrite NSArrayObjectAtIndex to use the native CFArrayGetValueAtIndex rather than cached selectors - neater code and I think slightly faster
Diffstat (limited to 'Source/CMMCPResult.m')
-rw-r--r--Source/CMMCPResult.m5
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/CMMCPResult.m b/Source/CMMCPResult.m
index afc7c2ed..610b6655 100644
--- a/Source/CMMCPResult.m
+++ b/Source/CMMCPResult.m
@@ -327,7 +327,10 @@ modified version for use with sequel-pro
for (i=0; i < numFields; i++)
{
- NSMutableDictionary *fieldStructure = [NSMutableDictionary dictionaryWithCapacity:38];
+ NSMutableDictionary *fieldStructure = [NSMutableDictionary dictionaryWithCapacity:39];
+
+ /* Original column position */
+ [fieldStructure setObject:[NSNumber numberWithInt:i] forKey:@"datacolumnindex"];
/* Name of column */
[fieldStructure setObject:[self stringWithCString:theField[i].name] forKey:@"name"];