Bug #13760 column width changes in resultset display area cannot be retained
Submitted: 5 Oct 2005 6:05 Modified: 6 Oct 2005 14:50
Reporter: Kenneth Wagner Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Query Browser Severity:S2 (Serious)
Version:1.1.15 OS:Windows (Window XP Pro)
Assigned to: Mike Lischke CPU Architecture:Any

[5 Oct 2005 6:05] Kenneth Wagner
Description:
Using Query Browser v. 1.1.15, Windows XP Pro, MySQL 4.1.11-nt.

Create a query on table with ten or more fields. Use "Select * from table_name;"

1. The resultset display runs off the screen to the right.
2. The column width is 2-4 times as long as the data displayed.
3. Adjust the column widths so all display nicely on the screen. Little or no empty space.
4. Re-execute the query.
5. The resultset display is now spread out again.

Must be a bug because the table editor remembers its screen column widths after the table editor window is resized and the columns have their display widths changed.

So frustrating to re-set the column widths after each execute.

How to work around? Fix?

All display options are on except "field overlay."

Changing fonts does not help.

Thanks,

Ken Wagner

How to repeat:
Use a table with 10 columns.
Make most of the fields varchar(nn). nn=45 is fine.

Build query "select * from table_name". Execute it. 
Most of the columns run off the screen to the right.
Adjust all the columns so you can see all (or most) the data in the columns.

Now execute the query again.

Once again the columns run off the screen to the right.

This is not true for the table editor. It remembers its column width changes for the QB session.

Suggested fix:
1. Have a toggle or setting for saving the screen layout to the saved query. 
2. Allow screen changes to remain for the same columns when re-running the query or editing the query and re-running. 

3. BEST OF ALL:  Have an "auto-fit" setting for the data columns. The screen then adjusts to the widest amount of data in each column.

Which is what ancient old DOS and the SQL Console in DOS do!!
[6 Oct 2005 14:50] Mike Lischke
This behavior is actually as designed, although it does not work well. What happens is that QB tries to find a good column width for the result set based on the column data type. Of course this will lead to large RS columns if the data type contains varchars with a large number of (possible) characters. Basing this width on the data which is displayed currently is not a good solution at all, as it would make the column width jump all the time when navigating the RS. A possible solution would be to store the settings of the user and apply it every time a column with the same characteristics is encountered. 

However this is a feature wishs that might be implemented at a later date.
[25 Sep 2007 12:23] media forest
This feature would be really great, it's the biggest problem I found using querybrowser, and the reason why I now use openoffice for querying Mysql...
[2 Oct 2007 13:46] media forest
An easy first path would be to set the width  of column to the width of datas it contains or to the number of chars of the field name when the field is shorter :
If a field is defined as a varchar(12) it's ridiculous to dim the column for 50 chars or so as query-browser does actually.
[3 Dec 2007 1:27] Garth Snyder
I was just about to resubmit this, but the original submitter has it exactly right. I agree that it's a constant nuisance and I more or less agree with the submitter's preferred solution: an "auto-size" setting that would size the columns based on data actually retrieved.

However, I don't think this should be an option; it should be the standard behavior. Mike, you seem to be interpreting the suggestion as "size to displayed data". But in fact, "size to retrieved data" is even better and would eliminate the possibilty of column width shifts as the RS is reviewed.

While a recordset is being retrieved, it is fine to size columns according to their datatypes. But once the query has completed, the columns should autoresize. There will be a single visual jump, but that is perfectly acceptable and preferable to the current behavior.

I'm a bit skeptical of the concept of storing user preferences for column widths. What would you associate them to? The text of a specific query? The specific set and order of column headings? Individual column headings?

If the query text, it's a relatively pointless feature since you're usually tweaking the queries interactively and they'll rarely look identical. If the individual column headings, it's not really correct, since column names are not necessarily defined identically among queries and many column titles are frequently reused (e.g., n, last, succ, pred, id...). Column title sets may be more useful, but again, they suffer from the query modification problem: add another column, and you lose all your formatting.

Autosize FTW! :-)
[10 Apr 2008 20:38] Christopher Paolini
This shouldn't be that hard to fix, I'd love to see it fixed. This could become a very nice tool. Actually it already is, this is one of the only things I seem to find wrong with it.
[15 May 2008 3:24] Charles Thompson
I want to add my voice to the list of those desiring this fix. I really would like to see column size adjustments stick. Thanks, and keep up the good work!
[18 Jun 2008 15:27] Harald Groven
This bug/feature is one of the two reasons that makes me prefer PhpMyAdmin to Mysql Query Browser. HTML-tables auto fits and autowraps nicely. The other reason is the lack access to an easlily accessible table of table metadata.
[5 Mar 2009 4:35] Howard Bayne
I came here looking for an answer to this issue and instead I found out it's a known issue that's been on the table for over three years. It seems the developers and the users of this tool have differing views on usability. :-(

For the (apparently pointless) record, I agree that the column widths in the result window should be determined by the maximum width of the data in the result set not the definition of the field.
[18 Mar 2009 16:30] Andrew Roe
This is honestly a real nuisance. As developeres and DBAs, we are in the business of streamlining diagnostic processes wherever possible and the lack of response to this all too common request this is highly frustrating.
[24 Jan 2010 21:46] David P
Is anyone working on this?

It would be great to finally have this feature after all these years.... 

c'mon guys!
[14 Feb 2010 18:41] Marcus Eting
Yes, please! Even an option to set all the column widths to a smaller, fixed width would be so helpful. Even on a 24" monitor these column widths are still frustrating. It is frustrating because the Query Browser is such a great tool.
[13 Mar 2014 13:34] Omer Barnir
This bug is not scheduled to be fixed at this time.