Bug #104160 mysql -q option wrong result
Description:
the mysql command client -q option have a problem
How to repeat:
without -q option
/usr/local/mysql/bin/mysql -S /tmp/mysql3306.sock -uroot -p --prompt "\u@\p>[\d]>" --database employees
[root@yejr mysql_shell]# /usr/local/mysql/bin/mysql -S /tmp/mysql3306.sock -uroot -poracle --prompt "\u@\p>[\d]>" --database employees
mysql: [Warning] Using a password on the command line interface can be insecure.
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 84
Server version: 8.0.25 MySQL Community Server - GPL
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
root@mysql3306.sock>[employees]>select '123456789987654321' +0 a ;
+-----------------------+
| a |
+-----------------------+
| 1.2345678998765432e17 |
+-----------------------+
1 row in set (0.00 sec)
root@mysql3306.sock>[employees]>desc select '123456789987654321' +0 a ;
+----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+----------------+
| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+----------------+
| 1 | SIMPLE | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | No tables used |
+----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+----------------+
1 row in set, 1 warning (0.00 sec)
root@mysql3306.sock>[employees]>desc select '123456789987654321' +0 a \G
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: NULL
partitions: NULL
type: NULL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: NULL
filtered: NULL
Extra: No tables used
1 row in set, 1 warning (0.00 sec)
with -q option
[root@yejr mysql_shell]# /usr/local/mysql/bin/mysql -S /tmp/mysql3306.sock -uroot -p -q --prompt "\u@\p>[\d]>" --database employees
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 85
Server version: 8.0.25 MySQL Community Server - GPL
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
root@mysql3306.sock>[employees]>select '123456789987654321' +0 a ;
+-------------------------+
| a |
+-------------------------+
| 1.2345678998765432e17 |
+-------------------------+
1 row in set (0.00 sec)
root@mysql3306.sock>[employees]>desc select '123456789987654321' +0 a \G
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: NULL
partitions: NULL
type: NULL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: NULL
filtered: NULL
Extra: No tables used
1 row in set, 1 warning (0.00 sec)
root@mysql3306.sock>[employees]>desc select '123456789987654321' +0 a ;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
^Z[2]+ Stopped /usr/local/mysql/bin/mysql -S /tmp/mysql3306.sock -uroot -p -q --prompt "\u@\p>[\d]>" --database employees
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.042 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.
Description: the mysql command client -q option have a problem How to repeat: without -q option /usr/local/mysql/bin/mysql -S /tmp/mysql3306.sock -uroot -p --prompt "\u@\p>[\d]>" --database employees [root@yejr mysql_shell]# /usr/local/mysql/bin/mysql -S /tmp/mysql3306.sock -uroot -poracle --prompt "\u@\p>[\d]>" --database employees mysql: [Warning] Using a password on the command line interface can be insecure. Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 84 Server version: 8.0.25 MySQL Community Server - GPL Copyright (c) 2000, 2021, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. root@mysql3306.sock>[employees]>select '123456789987654321' +0 a ; +-----------------------+ | a | +-----------------------+ | 1.2345678998765432e17 | +-----------------------+ 1 row in set (0.00 sec) root@mysql3306.sock>[employees]>desc select '123456789987654321' +0 a ; +----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+----------------+ | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | +----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+----------------+ | 1 | SIMPLE | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | No tables used | +----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+----------------+ 1 row in set, 1 warning (0.00 sec) root@mysql3306.sock>[employees]>desc select '123456789987654321' +0 a \G *************************** 1. row *************************** id: 1 select_type: SIMPLE table: NULL partitions: NULL type: NULL possible_keys: NULL key: NULL key_len: NULL ref: NULL rows: NULL filtered: NULL Extra: No tables used 1 row in set, 1 warning (0.00 sec) with -q option [root@yejr mysql_shell]# /usr/local/mysql/bin/mysql -S /tmp/mysql3306.sock -uroot -p -q --prompt "\u@\p>[\d]>" --database employees mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 85 Server version: 8.0.25 MySQL Community Server - GPL Copyright (c) 2000, 2021, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. root@mysql3306.sock>[employees]>select '123456789987654321' +0 a ; +-------------------------+ | a | +-------------------------+ | 1.2345678998765432e17 | +-------------------------+ 1 row in set (0.00 sec) root@mysql3306.sock>[employees]>desc select '123456789987654321' +0 a \G *************************** 1. row *************************** id: 1 select_type: SIMPLE table: NULL partitions: NULL type: NULL possible_keys: NULL key: NULL key_len: NULL ref: NULL rows: NULL filtered: NULL Extra: No tables used 1 row in set, 1 warning (0.00 sec) root@mysql3306.sock>[employees]>desc select '123456789987654321' +0 a ; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ^Z[2]+ Stopped /usr/local/mysql/bin/mysql -S /tmp/mysql3306.sock -uroot -p -q --prompt "\u@\p>[\d]>" --database employees