Bug #2798 | Differing query results in command line than in control centre | ||
---|---|---|---|
Submitted: | 14 Feb 2004 14:00 | Modified: | 16 Feb 2004 9:28 |
Reporter: | Nicola Dunn | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Command-line Clients | Severity: | S3 (Non-critical) |
Version: | 4.0.18-max-debug | OS: | Windows (Windows 2K Advanced Server Editi) |
Assigned to: | CPU Architecture: | Any |
[14 Feb 2004 14:00]
Nicola Dunn
[16 Feb 2004 9:06]
MySQL Verification Team
This happens generally when the script or the string value inserted has \n or \r characters: C:\mysql\bin>mysql -uroot test Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 to server version: 4.0.18-max-nt-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> create table centres (name char(25), town char(25), country char(25)); Query OK, 0 rows affected (0.20 sec) mysql> insert into centres values ("Kagyu Ling","Manchester","UK"); Query OK, 1 row affected (0.05 sec) mysql> SELECT * FROM centres WHERE town = "Manchester"; +------------+------------+---------+ | name | town | country | +------------+------------+---------+ | Kagyu Ling | Manchester | UK | +------------+------------+---------+ 1 row in set (0.01 sec) mysql> insert into centres values ("Kagyu Ling\n","Manchester","UK"); Query OK, 1 row affected (0.00 sec) mysql> SELECT * FROM centres WHERE town = "Manchester"; +-------------+------------+---------+ | name | town | country | +-------------+------------+---------+ | Kagyu Ling | Manchester | UK | | Kagyu Ling | Manchester | UK | +-------------+------------+---------+ 2 rows in set (0.03 sec) Both clients behaves in different ways because the GUI client uses a grid control with text boxes and the console client just prints the rows instead.
[16 Feb 2004 9:28]
Brian Aker
Just a behavior question, not a bug. In the future we could perhaps make an option so that line feeds are stripped from rows (aka we clean up the way this looks).