Bug #43153 Version comment is too long
Submitted: 24 Feb 16:24 Modified: 13 Apr 21:26
Reporter: Elena Stepanova
Status: Closed
Category:Server: Packaging Severity:S3 (Non-critical)
Version:5.1.31, 5.1.32 OS:Linux
Assigned to: Tatjana A. Nuernberg Target Version:5.1.34
Triage: Triaged: D4 (Minor)

[24 Feb 16:24] Elena Stepanova
Description:
MySQL-client-5.1.31-0.glibc23.i386.rpm and alike

version_comment value in generic server package is too long:

MySQL Community Server (Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.  All
rights reserved.  Use is subject to license terms.  Under GPL license as shown in the
Description field.)

As a result, it does not fit into the welcome line when a client connects, and the
sentence breaks in the middle:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.1.32 MySQL Community Server (Copyright 2000-2008 MySQL AB, 2008 Sun
Microsystems, Inc.  All rights reserved.  Use is subject

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

Also, the year in copyright probably needs to be updated.

How to repeat:
- Install MySQL-server-5.1.32-0.glibc23.x86_64.rpm (or 32 bit, or 5.1.31)
- connect to the server
- see the welcome text
- show variables like 'version_comment'

Suggested fix:
Modify the line
[24 Feb 16:28] Elena Stepanova
Note: the line looks all right in 5.1.30
[19 Mar 18:51] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/69854

2757 Tatiana A. Nurnberg	2009-03-19
      Bug#43153: Version comment is too long
      
      mysql-client used static buffer to concatenate server-
      version and version_comment. Sufficiently long comments
      could get cut off. This was harmless, but looked daft.
      
      Now using a dynamic buffer instead.
     @ client/mysql.cc
        Use dynamic rather than static buffer for server
        information. If we can get both version and comment,
        concat them and use that. Otherwise, try to use just
        version. If that fails too, return empty string so
        overly trusting callers do not crash. Release memory
        as needed.
[19 Mar 19:20] Tatjana A. Nuernberg
So the complete assessment is this:

- current packages should not show this issue thanks to fixed spec-file

- older packages should not show this issue thanks to shorter string

- some packages in between have this issue, but only in mysql command-line client. This
is because mysql shows version+version_comment and uses a static buffer to concatenate
them; everybody else just uses version as-is.

- so for now, patch mostly affects the scenario of, "new mysql command-line client
connecting to semi-old mysqld". Almost doesn't seem worth the effort, but at least now
we're doing The Right Thing, plus, it's future proof in case we have a regression, or
some distributor sets a really long string. I think this last bit, not knowing what
distributors may come up with, is what makes putting the CS in all the same worthwhile.
[20 Mar 19:25] Tatjana A. Nuernberg
queued for 5.1.34, 6.0.11 in -bugteam
[27 Mar 15:57] Bugs System
Pushed into 5.1.34 (revid:joro@sun.com-20090327143448-wuuuycetc562ty6o) (version source
revid:azundris@mysql.com-20090320181012-j7uuft90860yjc3i) (merge vers: 5.1.34) (pib:6)
[3 Apr 4:57] Paul DuBois
Noted in 5.1.34 changelog.

If the value of the version_comment system variable was too long, the
mysql client displayed a truncated startup message.

Setting report to NDI pending push into 6.0.x.
[13 Apr 11:21] Bugs System
Pushed into 6.0.11-alpha (revid:alik@sun.com-20090413084402-snnrocwzktcl88ny) (version
source revid:azundris@mysql.com-20090320181129-9d3e6ljbzeu4qx3n) (merge vers:
6.0.11-alpha) (pib:6)
[13 Apr 21:26] Paul DuBois
Noted in 6.0.11 changelog.
[9 May 18:46] Bugs System
Pushed into 5.1.34-ndb-6.2.18 (revid:jonas@mysql.com-20090508185236-p9b3as7qyauybefl)
(version source revid:jonas@mysql.com-20090508185236-p9b3as7qyauybefl) (merge vers:
5.1.34-ndb-6.2.18) (pib:6)
[9 May 19:43] Bugs System
Pushed into 5.1.34-ndb-6.3.25 (revid:jonas@mysql.com-20090509063138-1u3q3v09wnn2txyt)
(version source revid:jonas@mysql.com-20090509063138-1u3q3v09wnn2txyt) (merge vers:
5.1.34-ndb-6.3.25) (pib:6)
[9 May 20:40] Bugs System
Pushed into 5.1.34-ndb-7.0.6 (revid:jonas@mysql.com-20090509154927-im9a7g846c6u1hzc)
(version source revid:jonas@mysql.com-20090509154927-im9a7g846c6u1hzc) (merge vers:
5.1.34-ndb-7.0.6) (pib:6)