Bug #4760 VT102 appears at prompt after some queries
Submitted: 26 Jul 2004 21:20 Modified: 29 Jul 2004 21:45
Reporter: Dave Hull Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.2-alpha-standard-log OS:Linux (Red Hat AS 3 (update 2))
Assigned to: Matthew Lord CPU Architecture:Any

[26 Jul 2004 21:20] Dave Hull
Description:
I have the following innodb table:

mysql> desc nts_staff;
+--------------+-------------+------+-----+---------+----------------+
| Field        | Type        | Null | Key | Default | Extra          |
+--------------+-------------+------+-----+---------+----------------+
| nts_staff_id | int(11)     |      | PRI | NULL    | auto_increment |
| online_id    | varchar(16) |      | UNI |         |                |
| lname        | varchar(30) |      |     |         |                |
| fname        | varchar(30) |      |     |         |                |
+--------------+-------------+------+-----+---------+----------------+
4 rows in set (0.00 sec)

If I run select * from nts_staff, I get the following output:

mysql> select * from nts_staff;
+------+--------+-------+------+
| B   | @     |      |     |
+------+--------+-------+------+
| 1    | rlytle | Lytle |  Roy |
+------+--------+-------+------+
1 row in set (0.00 sec)

mysql> VT102

Notice the column names and the 'VT102' that appear? Where is this coming from? How do I fix it? It's not too bad as long as you see it happen, if you don't see it and you enter another query an error occurs because the VT102 is not a valid SQL keyword or MySQL function, etc.

I know it's a terminal type, but I'm not running anything funky. I'm using Secure Shell from SSH Communications Security Corp. Version 3.2.2 with a terminal type set to vt100. My TERM environment variable on the Linux server is also set to vt100.

I have tried setting my terminal type to VT102 in SSH, but this has not made any difference.

How to repeat:
This problem seems to be sporadic. It comes and goes from one session to the next and effects different tables at different times.
[26 Jul 2004 22:42] Dave Hull
After inserting another row of data into the table, the column names appear normal and there's no VT102 appearing on the prompt. Deleting the additional row from the table and querying it again, does not cause the error to recurr. Go figure.

mysql> select * from nts_staff;
+------+--------+-------+------+
| B   | @     |      |     |
+------+--------+-------+------+
| 1    | rlytle | Lytle | Roy  |
+------+--------+-------+------+
1 row in set (0.00 sec)

mysql> insert into nts_staff values (0, 'dphull', 'Hull', 'Dave');
Query OK, 1 row affected (0.00 sec)

mysql> select * from nts_staff;
+--------------+-----------+-------+-------+
| nts_staff_id | online_id | lname | fname |
+--------------+-----------+-------+-------+
|            1 | rlytle    | Lytle | Roy   |
|            2 | dphull    | Hull  | Dave  |
+--------------+-----------+-------+-------+
2 rows in set (0.00 sec)

mysql> delete from nts_staff where online_id = 'dphull';
Query OK, 1 row affected (0.00 sec)

mysql> select * from nts_staff;
+--------------+-----------+-------+-------+
| nts_staff_id | online_id | lname | fname |
+--------------+-----------+-------+-------+
|            1 | rlytle    | Lytle | Roy   |
+--------------+-----------+-------+-------+
1 row in set (0.00 sec)
[27 Jul 2004 2:21] Matthew Lord
Hi Sir,

Thank you for your bug report but I think this should be filed with secure shell as "VT102" is not a 
possible output from any mysql programs as the string is nowhere in the source tree.

Best Regards
[27 Jul 2004 11:19] Marko Mäkelä
Does the data contain control codes? ENQ (ctrl-e, 0x05) in the data could make the terminal emulator to send an identification string. Try SELECT hex(col) FROM tbl instead of SELECT col FROM tbl.
[29 Jul 2004 21:18] Dave Hull
Here's another instance of this bug where my terminal type was not appended to the mysql> prompt:

mysql> select * from ip;
+-----+----------------+
| @  | @             |
+-----+----------------+
| 9   | 129.237.181.13 |
+-----+----------------+
1 row in set (0.00 sec)

mysql> desc ip;
+-----------+-------------+------+-----+---------+-------+
| Field     | Type        | Null | Key | Default | Extra |
+-----------+-------------+------+-----+---------+-------+
| rings_id  | int(11)     |      | PRI | 0       |       |
| ipAddress | varchar(15) |      | PRI |         |       |
+-----------+-------------+------+-----+---------+-------+
2 rows in set (0.00 sec)

After inserting another row:

mysql> insert into ip values (10, '129.237.234.69');
Query OK, 1 row affected (0.00 sec)

The strange column names go away:

mysql> select * from ip;
+----------+----------------+
| rings_id | ipAddress      |
+----------+----------------+
|        9 | 129.237.181.13 |
|       10 | 129.237.234.69 |
+----------+----------------+
2 rows in set (0.00 sec)
[29 Jul 2004 21:45] Matthew Lord
Dear Dave,

I could not repeat this behavior on any machine using the table structure I saw in the desc
output and creating the first row.

If you have console access to the machine you should see if the same behavior exhibits itself 
when using the system console.  You should also try another shell, putty is a good and free client
for windows.

Please let me know if this still happens when working directly on the machine.

Best Regards