Skip to content

Commit edd1f54

Browse files
committed
* Fix truncation behavior of lines in Console
* Workaround view info being displayed as hex data in mysql 8.0
1 parent 879817c commit edd1f54

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

Interfaces/English.lproj/Console.xib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
109109
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
110110
</tableHeaderCell>
111-
<textFieldCell key="dataCell" controlSize="small" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="g2D-wF-fcB">
111+
<textFieldCell key="dataCell" controlSize="small" lineBreakMode="truncatingTail" truncatesLastVisibleLine="YES" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="g2D-wF-fcB">
112112
<font key="font" metaFont="smallSystem"/>
113113
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
114114
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>

Source/SPTableData.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,8 +1007,8 @@ - (BOOL)updateStatusInformationForCurrentTable
10071007
else if ([tableListInstance tableType] == SPTableTypeTable) {
10081008
[escapedTableName replaceOccurrencesOfRegex:@"\\\\(?=\\Z|[^\'])" withString:@"\\\\\\\\"];
10091009
tableStatusResult = [mySQLConnection queryString:[NSString stringWithFormat:@"SHOW TABLE STATUS LIKE '%@'", escapedTableName ]];
1010-
[tableStatusResult setReturnDataAsStrings:YES];
10111010
}
1011+
[tableStatusResult setReturnDataAsStrings:YES]; //TODO: workaround for #2700 (#2699)
10121012

10131013
// Check for any errors, only displaying them if the connection hasn't been terminated
10141014
if ([mySQLConnection queryErrored]) {

Source/SPTableInfo.m

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ - (void)updateActivities
134134
*/
135135
- (void)tableChanged:(NSNotification *)notification
136136
{
137-
NSDictionary *tableStatus;
138137
NSNumberFormatter *numberFormatter = [[[NSNumberFormatter alloc] init] autorelease];
139138
[numberFormatter setNumberStyle:NSNumberFormatterDecimalStyle];
140139

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

162161
// Retrieve the table status information via the data cache
163-
tableStatus = [tableDataInstance statusValues];
162+
NSDictionary *tableStatus = [tableDataInstance statusValues];
164163

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

230229
// Retrieve the table status information via the data cache
231-
tableStatus = [tableDataInstance statusValues];
230+
NSDictionary *tableStatus = [tableDataInstance statusValues];
232231

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

284283
// Retrieve the table status information via the data cache
285-
tableStatus = [tableDataInstance statusValues];
284+
NSDictionary *tableStatus = [tableDataInstance statusValues];
286285

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

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

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

299299
// Check for 'SECURITY_TYPE'

Source/SPTablesList.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ - (IBAction)updateTables:(nullable id)sender
191191
// views; on MySQL versions >= 5.0.02 select the "full" list to also select the table type column.
192192
theResult = [mySQLConnection queryString:@"SHOW /*!50002 FULL*/ TABLES"];
193193
[theResult setDefaultRowReturnType:SPMySQLResultRowAsArray];
194-
[theResult setReturnDataAsStrings:YES]; // MySQL 5.8 (beta) seems to return Table_type as data (see PR #2606)
194+
[theResult setReturnDataAsStrings:YES]; // TODO: workaround for bug #2700 (#2699)
195195
if ([theResult numberOfFields] == 1) {
196196
for (NSArray *eachRow in theResult) {
197197
[tables addObject:[eachRow objectAtIndex:0]];

Source/SPTextView.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,12 +1428,12 @@ - (void)showCompletionListFor:(NSString*)kind atRange:(NSRange)aRange fuzzySearc
14281428

14291429
NSArray *arr = nil;
14301430
if([kind isEqualToString:@"$SP_ASLIST_ALL_TABLES"]) {
1431-
NSString *currentDb = nil;
1432-
1433-
if (tablesListInstance && [tablesListInstance selectedDatabase])
1434-
currentDb = [tablesListInstance selectedDatabase];
1435-
14361431
// TODO HansJB
1432+
// NSString *currentDb = nil;
1433+
//
1434+
// if (tablesListInstance && [tablesListInstance selectedDatabase])
1435+
// currentDb = [tablesListInstance selectedDatabase];
1436+
//
14371437
// NSDictionary *dbs = [NSDictionary dictionaryWithDictionary:[[mySQLConnection getDbStructure] objectForKey:connectionID]];
14381438
//
14391439
// if(currentDb != nil && dbs != nil && [dbs count] && [dbs objectForKey:currentDb]) {

0 commit comments

Comments
 (0)