-7

I have a question about my Stack Overflow post: Truncate column names in SELECT (MySQL client)

The OP for a MySQL query (Truncate column names in SELECT (MySQL client)) had a problem with the formatting of MySQL output, and needed a genuine solution.

The actual issue as stated was: "I see a unformatted output which is hard to standard, specially when you search for little clues like fields that aren't being used and so on."

One @Barmar did provide a good solution, but in the interim, some helpful souls decided to format the MySQL output in OP's question by formatting and making it 'readable' which made the question meaningless as there was no confusion anymore on the readability and the formatted code was no longer "hard to understand".

OP protested twice on the edits to his question:

  1. Why have you rollbacked my edition? The question could not be understood if the output isn't shown unformatted. – Peregring-lk Nov 9 '16 at 19:35
  2. Did you look at it? It was completely unreadable because it performed wrapping. – Barmar Nov 9 '16 at 19:57 (+1)
  3. And that exactly the intended question, to show that it's pretty hard to know which column headers the column contents refers to. – Peregring-lk Nov 9 '16 at 20:12
  4. Now I understand better, see my new option 3. – Barmar Nov 9 '16 at 20:26

After this Barmar did revert his changes, but instead of reverting to the original, it reverted to rev. 2 which was a similar readability/formatting change done by scaisEdge (edited Nov 9 '16 at 18:43).

When I came to the question, I ignored the answer and went back to google search as in the first glance, the output was no where like what I was getting, and hence I thought that it was not a pertinent answer.

Only when Google threw me back to the page that I realized that someone had prettified the MySQL output leading to the confusion.

On pointing the same out and trying to revert the same to OP's post, two people rejected it citing readability.

Rejected Aug 13 at 11:03: <> reviewed this Aug 13 at 11:03: Reject This edit defaces the post in order to promote a product or service, or is deliberately destructive.

<> reviewed this Aug 13 at 7:40: Reject This edit does not make the post even a little bit easier to read, easier to find, more accurate or more accessible. Changes are either completely superfluous or actively harm readability.

<> reviewed this Aug 12 at 19:27: Approved

Since there was no way to let these peers/moderators know that readability was the exact problem that is to be solved, I pasted the original output as an answer, so that the next person who comes to the page can directly see the offending, but the actual output one gets when running the command.

However, another moderator deleted the post itself without assigning any reason, and now the next person who comes to the answer is likely to ignore it and start searching elsewhere.

One potential solution that I can think of is to allow the poster to point out the error in review/moderation so that someone can take a look. (It can be a can of worms if there is abuse, but now machines can easily read if some post is abusive).

6
  • 7
    You basically want to make that question more unreadable? And you wrote an answer to rectify that and suggested an edit to make the question look worse? I don't get it. Could it be you are confused how markdown and code layout work here? For less <10K users: i.sstatic.net/UIWvW.png
    – rene
    Commented Aug 20, 2020 at 16:11
  • 6
    And this is the suggested edit: i.sstatic.net/9jz2H.png where you remove the code markup.
    – rene
    Commented Aug 20, 2020 at 16:17
  • 1
    Maybe they should have used a screenshot in that question
    – rene
    Commented Aug 20, 2020 at 16:23
  • 4
    I'm not sure if you realise, but itchydon actually voted to approve your edit, only to be overruled by the other two voters. Tarring all three with the same brush is not fair to itchydon; they were on your side and you appear to be attacking them in the belief that they weren't.
    – F1Krazy
    Commented Aug 20, 2020 at 16:29
  • @rene: It is about presenting the output as it is. The unreadableness of the output is what gives rise to the question. By using markdown, the question has been rendered meaningless as the columns are easily readable. F1Krazy: You are right. I did not mean to include itchydon. My bad. Editing the question.
    – justabot
    Commented Aug 20, 2020 at 17:16
  • 5
    None of those edits were approved by a Stack Overflow moderator. Commented Aug 21, 2020 at 1:37

2 Answers 2

7

When reviewers look at that suggested edit it is not clear at all that you are improving the question, no matter what you say in the edit comment.

I understand the question is about layout issues of output of a MySQL statement. I doubt it becomes much clearer when the output is kept unformatted. In general, output of an SQL statement is done in a code layout. Removing such code layout is counter productive as you've seen.

It isn't advisable to resort to posting an answer to raise a complaint (I use complaint mildly here. We don't call people out as that is not nice, no matter how wrong it is what they have done and how right you are.)

Let me suggest a better solution here for the layout issue in that question you perceive as troublesome. I tend to agree a tiny bit (after I looked at the source of the first revision), so let’s get some feedback on some options to resolve that in an acceptable way for all involved. I propose to change that code block to include a quote markup to indicate its special nature:

Output on screen

mysql> select * from Seat limit 2;
+---------+---------------------+---------------+------------------+--------------+-----
----------+--------------+-------------+--------------+-------------+---------+---------
+----------+------------+---------------+------------------+-----------+-------------+--
-------------+-----------------+---------------------+-------------------+--------------
---+
| seat_id | seat_created        | seat_event_id | seat_category_id |
seat_user_id | seat_order_id | seat_item_id | seat_row_nr |
seat_zone_id | seat_pmp_id | seat_nr | seat_ts | seat_sid | seat_price
| seat_discount | seat_discount_id | seat_code | seat_status |
seat_sales_id | seat_checked_by | seat_checked_date   |
seat_old_order_id | seat_old_status |
+---------+---------------------+---------------+------------------+--------------+-----
----------+--------------+-------------+--------------+-------------+---------+---------
+----------+------------+---------------+------------------+-----------+-------------+--
-------------+-----------------+---------------------+-------------------+--------------
---+
|    4897 | 2016-09-01 00:05:54 |           330 |              331 |
NULL |          NULL |         NULL | 0           |         NULL |
NULL | 0       |    NULL | NULL     |       NULL |          0.00 |
NULL | NULL      | free        |          NULL |            NULL |
0000-00-00 00:00:00 |              NULL | NULL            |
|    4898| 2016-09-01 00:05:54 |           330 |              331 |
NULL |          NULL |         NULL | 0           |         NULL |
NULL | 0       |    NULL | NULL     |       NULL |          0.00 |
NULL | NULL      | free        |          NULL |            NULL |
0000-00-00 00:00:00 |              NULL | NULL            |
+---------+---------------------+---------------+------------------+--------------+-----
----------+--------------+-------------+--------------+-------------+---------+---------
+----------+------------+---------------+------------------+-----------+-------------+--
-------------+-----------------+---------------------+-------------------+--------------
---+

Alternatively, a screenshot could be provided to overcome the tricky layout altogether:

Enter image description here

But I'm not a fan of that solution.

Another option surely is the complete deletion of that example output and only rely on the description of the problem being sufficient for future visitors to relate to the problem.

Either way, it doesn't look like this is clear how to resolve, if it needs to be resolved at all. With some brain gymnastics visitors might still be able to understand what is asked.

Open for further suggestions.

General advice: Sometimes suggested edits are not the best method to get changes made to a post. This is one such example. It isn't obvious at all that the rollback is the correct thing to do. If you have the privilege to comment or post on meta that are much better venues. There you'll find users that have both the needed privileges, insight and experience to make the best judgement call.

4
  • Use quote blocks. Also, the output may not be as important. If you know that your terminal is smaller than the output it would either truncate the output or wrap around. Either way, the question may still be valid without the output, just describing that the text isn't readable at all, due wraparound (which is what I presume it is happening) and people should be able to find it.
    – Braiam
    Commented Aug 20, 2020 at 17:14
  • Thanks, that does make it readable as well as in line with original.
    – justabot
    Commented Aug 20, 2020 at 17:19
  • As suggested, I have updated the edit to the original post (stackoverflow.com/questions/40513764/…) in block-quotes (first option mentioned by @rene). Thanks again.
    – justabot
    Commented Aug 20, 2020 at 17:32
  • When I said quotes blocks I meant "quotes blocks instead of code blocks"
    – Braiam
    Commented Aug 20, 2020 at 17:36
-7

I'm going to say something that may not be the usual Stack Overflow jam, but... is the output important? If you know how terminal works you must know that when the horizontal length of a line is greater than the horizontal length of the terminal, it either wraps around or truncates it (usually the former, and there's the possibility that some terminal emulator decides to reduce the font size for that line... daemon forbid it!). The text of the question is descriptive enough to know what problem the user is facing:

  • Typing a query with too many/long columns
  • Output to a terminal that can't fit all those columns
  • ...
  • Asks a Stack Overflow question

That problem isn't peculiar of MySQL clients, if you are used to the terminal emulator and system administrator roles (dmesg output of a kernel oops without a pager, or cat'ing a file, etc.). Most users of MySQL should know about this that with a short description would be able to figure out the problem.

The perfect example would be something like this:

But even then, that image wouldn't help the users to find the question.

5
  • I can see that you have deleted the MySQL output: If we agree that an expert in MySQL may not have that question, or a proficient coder may be able to do the 'brain gymnastics' (as @rene mentioned) to understand a problem without the output - we may be ignoring the novice users. Such users would be the ones who will need such a question answered and having the output in the question makes it immensely helpful for users to correlate their own problem with that of the OP. Would request that you reconsider removing the output as it helps the seekers.
    – justabot
    Commented Aug 20, 2020 at 17:36
  • @justabot nope. It's not important since the output is irrelevant to the question asked. We know that the output is longer horizontally than the terminal output. Do this exercise: if the columns were about characteristics of a bunch of ponies, would the answer vary?
    – Braiam
    Commented Aug 20, 2020 at 17:40
  • @justabot novice users wouldn't be helped by the output, since the output doesn't include any iota of a search term that would help them find the question.
    – Braiam
    Commented Aug 20, 2020 at 17:45
  • 4
    I agree with you that the characteristics of ponies are not important - however, having a bunch of pony characteristics which overflow and make it difficult to keep track of what column header corresponds to which value, makes the question 'understandable' as well as relatable for novices as they see something similar to their own problem.
    – justabot
    Commented Aug 20, 2020 at 17:46
  • @justabot again, that's not important. If I could replace the output with any output, it means that the output is not important for the question. It doesn't help that it is there from the PoV of the search engines either.
    – Braiam
    Commented Aug 20, 2020 at 18:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .