diff options
-rw-r--r-- | Source/SPDatabaseDocument.m | 8 | ||||
-rw-r--r-- | Source/SPExtendedTableInfo.m | 2 | ||||
-rw-r--r-- | Source/SPTableData.m | 4 | ||||
-rw-r--r-- | Source/SPTableInfo.m | 7 | ||||
-rw-r--r-- | Source/SPTablesList.m | 1 |
5 files changed, 14 insertions, 8 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 51fc7a7e..c338224b 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -5608,9 +5608,9 @@ static int64_t SPDatabaseDocumentInstanceCounter = 0; } NSError *err = nil; [tableMetaData writeToFile:metaFileName - atomically:YES - encoding:NSUTF8StringEncoding - error:&err]; + atomically:YES + encoding:NSUTF8StringEncoding + error:&err]; if(err != nil) { NSLog(@"Error while writing “%@”", tableMetaData); NSBeep(); @@ -5705,7 +5705,7 @@ static int64_t SPDatabaseDocumentInstanceCounter = 0; } if(userTerminated) { - [SPTooltip showWithObject:NSLocalizedString(@"URL scheme command was terminated by user", @"URL scheme command was terminated by user") atLocation:[NSApp mouseLocation]]; + [SPTooltip showWithObject:NSLocalizedString(@"URL scheme command was terminated by user", @"URL scheme command was terminated by user") atLocation:[NSEvent mouseLocation]]; status = @"1"; } diff --git a/Source/SPExtendedTableInfo.m b/Source/SPExtendedTableInfo.m index e2f38a69..df084bf3 100644 --- a/Source/SPExtendedTableInfo.m +++ b/Source/SPExtendedTableInfo.m @@ -681,7 +681,7 @@ static NSString *SPMySQLCommentField = @"Comment"; { NSString *value = [infoDict objectForKey:key]; - if ([value isNSNull]) { + if (![value unboxNull]) { // (value == nil || value == [NSNull null]) value = @""; } else { diff --git a/Source/SPTableData.m b/Source/SPTableData.m index 689ecc8f..8033d5a0 100644 --- a/Source/SPTableData.m +++ b/Source/SPTableData.m @@ -1156,7 +1156,9 @@ #endif if (rowCountLevel == SPRowCountFetchNever - || (rowCountLevel == SPRowCountFetchIfCheap && [[self statusValueForKey:@"Data_length"] integerValue] >= rowCountCheapBoundary)) + || (rowCountLevel == SPRowCountFetchIfCheap + && (![[self statusValueForKey:@"Data_length"] unboxNull] //this works as a nil check for both NSNull and nil. + || [[self statusValueForKey:@"Data_length"] integerValue] >= rowCountCheapBoundary))) { return YES; } diff --git a/Source/SPTableInfo.m b/Source/SPTableInfo.m index 1767d3b0..b72d55f8 100644 --- a/Source/SPTableInfo.m +++ b/Source/SPTableInfo.m @@ -190,8 +190,11 @@ [info addObject:[NSString stringWithFormat:[[tableStatus objectForKey:@"RowsCountAccurate"] boolValue] ? NSLocalizedString(@"rows: %@", @"Table Info Section : number of rows (exact value)") : NSLocalizedString(@"rows: ~%@", @"Table Info Section : number of rows (estimated value)"), [numberFormatter stringFromNumber:[NSNumber numberWithLongLong:[[tableStatus objectForKey:@"Rows"] longLongValue]]]]]; } - - [info addObject:[NSString stringWithFormat:NSLocalizedString(@"size: %@", @"Table Info Section : table size on disk"), [NSString stringForByteSize:[[tableStatus objectForKey:@"Data_length"] longLongValue]]]]; + + // Check for 'Data_Length' == NULL (see PR #2606) + if([[tableStatus objectForKey:@"Data_length"] unboxNull]) { + [info addObject:[NSString stringWithFormat:NSLocalizedString(@"size: %@", @"Table Info Section : table size on disk"), [NSString stringForByteSize:[[tableStatus objectForKey:@"Data_length"] longLongValue]]]]; + } NSString *tableEnc = [tableDataInstance tableEncoding]; NSString *tableColl = [tableStatus objectForKey:@"Collation"]; if([tableColl length]) { diff --git a/Source/SPTablesList.m b/Source/SPTablesList.m index 77817040..3cc8ae3a 100644 --- a/Source/SPTablesList.m +++ b/Source/SPTablesList.m @@ -231,6 +231,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; // views; on MySQL versions >= 5.0.02 select the "full" list to also select the table type column. theResult = [mySQLConnection queryString:@"SHOW /*!50002 FULL*/ TABLES"]; [theResult setDefaultRowReturnType:SPMySQLResultRowAsArray]; + [theResult setReturnDataAsStrings:YES]; // MySQL 5.8 (beta) seems to return Table_type as data (see PR #2606) if ([theResult numberOfFields] == 1) { for (NSArray *eachRow in theResult) { [tables addObject:[eachRow objectAtIndex:0]]; |