Skip to content

Commit

Permalink
* Fix truncation behavior of lines in Console
Browse files Browse the repository at this point in the history
* Workaround view info being displayed as hex data in mysql 8.0
  • Loading branch information
dmoagx committed Jul 22, 2018
1 parent 879817c commit edd1f54
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Interfaces/English.lproj/Console.xib
Expand Up @@ -108,7 +108,7 @@
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell>
<textFieldCell key="dataCell" controlSize="small" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="g2D-wF-fcB">
<textFieldCell key="dataCell" controlSize="small" lineBreakMode="truncatingTail" truncatesLastVisibleLine="YES" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="g2D-wF-fcB">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
Expand Down
2 changes: 1 addition & 1 deletion Source/SPTableData.m
Expand Up @@ -1007,8 +1007,8 @@ - (BOOL)updateStatusInformationForCurrentTable
else if ([tableListInstance tableType] == SPTableTypeTable) {
[escapedTableName replaceOccurrencesOfRegex:@"\\\\(?=\\Z|[^\'])" withString:@"\\\\\\\\"];
tableStatusResult = [mySQLConnection queryString:[NSString stringWithFormat:@"SHOW TABLE STATUS LIKE '%@'", escapedTableName ]];
[tableStatusResult setReturnDataAsStrings:YES];
}
[tableStatusResult setReturnDataAsStrings:YES]; //TODO: workaround for #2700 (#2699)

// Check for any errors, only displaying them if the connection hasn't been terminated
if ([mySQLConnection queryErrored]) {
Expand Down
14 changes: 7 additions & 7 deletions Source/SPTableInfo.m
Expand Up @@ -134,7 +134,6 @@ - (void)updateActivities
*/
- (void)tableChanged:(NSNotification *)notification
{
NSDictionary *tableStatus;
NSNumberFormatter *numberFormatter = [[[NSNumberFormatter alloc] init] autorelease];
[numberFormatter setNumberStyle:NSNumberFormatterDecimalStyle];

Expand All @@ -160,7 +159,7 @@ - (void)tableChanged:(NSNotification *)notification
if ([tableListInstance tableName]) {

// Retrieve the table status information via the data cache
tableStatus = [tableDataInstance statusValues];
NSDictionary *tableStatus = [tableDataInstance statusValues];

// Check for errors
if (![tableStatus count]) {
Expand Down Expand Up @@ -228,7 +227,7 @@ - (void)tableChanged:(NSNotification *)notification
if ([tableListInstance tableName]) {

// Retrieve the table status information via the data cache
tableStatus = [tableDataInstance statusValues];
NSDictionary *tableStatus = [tableDataInstance statusValues];

// Check for errors
if (![tableStatus count]) {
Expand Down Expand Up @@ -282,18 +281,19 @@ - (void)tableChanged:(NSNotification *)notification
if ([tableListInstance tableName]) {

// Retrieve the table status information via the data cache
tableStatus = [tableDataInstance statusValues];
NSDictionary *tableStatus = [tableDataInstance statusValues];

// Check for errors
if (![tableStatus count]) {
[info addObject:NSLocalizedString(@"error occurred", @"error occurred")];
return;
}

// Check for 'CREATED' == NULL
if (![[tableStatus objectForKey:@"DEFINER"] isNSNull]) {
// Check for 'DEFINER' == NULL
// Note: In mysql 8.0 definer and all the other following fields are missing in the result set for information_schema system views!
if ([[tableStatus objectForKey:@"DEFINER"] unboxNull]) {

// Add the creation date to the infoTable
// Add the definer to the infoTable
[info addObject:[NSString stringWithFormat:NSLocalizedString(@"definer: %@", @"definer: %@"), [tableStatus objectForKey:@"DEFINER"]]];

// Check for 'SECURITY_TYPE'
Expand Down
2 changes: 1 addition & 1 deletion Source/SPTablesList.m
Expand Up @@ -191,7 +191,7 @@ - (IBAction)updateTables:(nullable id)sender
// 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)
[theResult setReturnDataAsStrings:YES]; // TODO: workaround for bug #2700 (#2699)
if ([theResult numberOfFields] == 1) {
for (NSArray *eachRow in theResult) {
[tables addObject:[eachRow objectAtIndex:0]];
Expand Down
10 changes: 5 additions & 5 deletions Source/SPTextView.m
Expand Up @@ -1428,12 +1428,12 @@ - (void)showCompletionListFor:(NSString*)kind atRange:(NSRange)aRange fuzzySearc

NSArray *arr = nil;
if([kind isEqualToString:@"$SP_ASLIST_ALL_TABLES"]) {
NSString *currentDb = nil;

if (tablesListInstance && [tablesListInstance selectedDatabase])
currentDb = [tablesListInstance selectedDatabase];

// TODO HansJB
// NSString *currentDb = nil;
//
// if (tablesListInstance && [tablesListInstance selectedDatabase])
// currentDb = [tablesListInstance selectedDatabase];
//
// NSDictionary *dbs = [NSDictionary dictionaryWithDictionary:[[mySQLConnection getDbStructure] objectForKey:connectionID]];
//
// if(currentDb != nil && dbs != nil && [dbs count] && [dbs objectForKey:currentDb]) {
Expand Down

0 comments on commit edd1f54

Please sign in to comment.