Skip to content
Permalink
Browse files

* Fix truncation behavior of lines in Console

* Workaround view info being displayed as hex data in mysql 8.0
  • Loading branch information...
dmoagx committed Jul 22, 2018
1 parent 879817c commit edd1f54a3bd1fc85a9218ec3c2fd3233a97ba972
Showing with 15 additions and 15 deletions.
  1. +1 −1 Interfaces/English.lproj/Console.xib
  2. +1 −1 Source/SPTableData.m
  3. +7 −7 Source/SPTableInfo.m
  4. +1 −1 Source/SPTablesList.m
  5. +5 −5 Source/SPTextView.m
@@ -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"/>
@@ -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]) {
@@ -134,7 +134,6 @@ - (void)updateActivities
*/
- (void)tableChanged:(NSNotification *)notification
{
NSDictionary *tableStatus;
NSNumberFormatter *numberFormatter = [[[NSNumberFormatter alloc] init] autorelease];
[numberFormatter setNumberStyle:NSNumberFormatterDecimalStyle];

@@ -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]) {
@@ -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]) {
@@ -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'
@@ -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]];
@@ -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]) {

0 comments on commit edd1f54

Please sign in to comment.
You can’t perform that action at this time.