Bug #91811 mysql shell doesn't return the results
Submitted: 27 Jul 2018 2:19 Modified: 26 Sep 2018 21:23
Reporter: yitao Xu Email Updates:
Status: Closed Impact on me:
None 
Category:Shell General / Core Client Severity:S1 (Critical)
Version:8.0.11 OS:Windows
Assigned to: CPU Architecture:Any

[27 Jul 2018 2:19] yitao Xu
Description:
when using mysql shell execute SQL query with windows function, query like below "select name,countrycode,population,sum(population) over (partition by countrycode) as sum from city;"
mysqlshell cann't display the fully result, then re-execute the query, there is no any result back. Even execute "select 1;"

----------------------------------------------------------------------------
 MySQL  localhost:33060+ ssl  test  SQL > use world;
Default schema set to `world`.
Fetching table and column names from `world` for auto-completion... Press ^C to stop.
                                           select name,countrycode,population,sum(population) over (partition by countrycode) as sum from city;+ ssl  world  SQL > select name,countrycode,population,sum(population) over (partition by country
+-----------------------------------+-------------+------------+-----------+
| name                              | countrycode | population | sum       |
+-----------------------------------+-------------+------------+-----------+
| Oranjestad                        | ABW         |      29034 |     29034 |
| Kabul                             | AFG         |    1780000 |   2332100 |
| Qandahar                          | AFG         |     237500 |   2332100 |
| Herat                             | AFG         |     186800 |   2332100 |
| Mazar-e-Sharif                    | AFG         |     127800 |   2332100 |
| Luanda                            | AGO         |    2022000 |   2561600 |
| Huambo                            | AGO         |     163100 |   2561600 |
| Lobito                            | AGO         |     130000 |   2561600 |
| Benguela                          | AGO         |     128300 |   2561600 |
| Namibe                            | AGO         |     118200 |   2561600 |
| South Hill                        | AIA         |        961 |      1556 |
| The Valley                        | AIA         |        595 |      1556 |
| Tirana                            | ALB         |     270000 |    270000 |
| Andorra la Vella                  | AND         |      21189 |     21189 |
| Willemstad                        | ANT         |       2345 |      2345 |
| Dubai                             | ARE         |     669181 |   1728336 |
| Abu Dhabi                         | ARE         |     398695 |   1728336 |
| Sharja                            | ARE         |     320095 |   1728336 |
| al-Ayn                            | ARE         |     225970 |   1728336 |
| Ajman                             | ARE         |     114395 |   1728336 |
| Buenos Aires                      | ARG         |    2982146 |  19996563 |
| La Matanza                        | ARG         |    1266461 |  19996563 |
| C MySQL  localhost:33060+ ssl  world  SQL >
 MySQL  localhost:33060+ ssl  world  SQL > select 1;
 MySQL  localhost:33060+ ssl  world  SQL >

How to repeat:
create a table 'city'
| city  | CREATE TABLE `city` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `Name` char(35) NOT NULL DEFAULT '',
  `CountryCode` char(3) NOT NULL DEFAULT '',
  `District` char(20) NOT NULL DEFAULT '',
  `Population` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`ID`),
  KEY `CountryCode` (`CountryCode`),
  CONSTRAINT `city_ibfk_1` FOREIGN KEY (`CountryCode`) REFERENCES `country` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=4080 DEFAULT CHARSET=latin1 |

using the data of word.sql to insert the table.

execute the sql query 
"select name,countrycode,population,sum(population) over (partition by countrycode) as sum from city;"

you will find the issue. This problem will no longer appear on mysql clients.
[27 Jul 2018 2:19] yitao Xu
test data

Attachment: world.sql.zip (application/x-zip-compressed, text), 90.08 KiB.

[27 Jul 2018 9:42] MySQL Verification Team
Hello Yitao Xu,

Thank you for the report.
I'm not seeing this issue at my end while using MySQL Shell 8.0.11 and connecting MySQL Server 8.0.11 from Windows, OL7 and Ubuntu. Could you please confirm server version and any other missing details such as OS etc which is triggering the issue? 

Thanks,
Umesh
[27 Jul 2018 9:44] MySQL Verification Team
test results

Attachment: 91811.results (application/octet-stream, text), 22.78 KiB.

[27 Jul 2018 11:37] yitao Xu
mysql shell is mysql-shell-8.0.11-windows-x86-64bit.zip
mysql server windows 64bit 
 MySQL  localhost:33060+ ssl  SQL > select version();
+-----------+
| version() |
+-----------+
| 8.0.11    |
+-----------+
1 row in set (0.0003 sec)

 MySQL  localhost:33060+ ssl  SQL >

mysqld and mysqlshell on the same host

OS is Windows 10.0.01.00 64bit
[27 Jul 2018 11:45] yitao Xu
Hi Umesh,
Your result is good,but it on linux 7, please try the windows zip version on windows10.
Thanks!
[27 Jul 2018 12:34] MySQL Verification Team
Downloaded and tried using mysql-shell-8.0.11-windows-x86-64bit.zip on win7 - no issues noticed

D:\>cd D:\MySQL\mysql-shell-8.0.11-windows-x86-64bit

D:\MySQL\mysql-shell-8.0.11-windows-x86-64bit>bin\mysqlsh --log-level=debug3
MySQL Shell 8.0.11

Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type '\help' or '\?' for help; '\quit' to exit.

MySQL JS> \sql
Switching to SQL mode... Commands end with ;

MySQL SQL> \c ushastry@hod03.no.oracle.com
Creating a session to 'ushastry@hod03.no.oracle.com'
Enter password:
Fetching schema names for autocompletion... Press ^C to stop.
Your MySQL connection id is 8 (X protocol)
Server version: 8.0.11 MySQL Community Server - GPL
No default schema selected; type \use <schema> to set one.

MySQL [hod03.no.oracle.com+ ssl] SQL> use world
Default schema set to `world`.
Fetching table and column names from `world` for auto-completion... Press ^C to stop.

MySQL [hod03.no.oracle.com+ ssl/world] SQL> select name,countrycode,population,sum(population) over (partition by countr
ycode) as sum from city;
+-----------------------------------+-------------+------------+-----------+
| name                              | countrycode | population | sum       |
+-----------------------------------+-------------+------------+-----------+
| Oranjestad                        | ABW         |      29034 |     29034 |
| Kabul                             | AFG         |    1780000 |   2332100 |
[...]
| Luanshya                          | ZMB         |     118100 |   2473500 |
| Harare                            | ZWE         |    1410000 |   2730420 |
| Bulawayo                          | ZWE         |     621742 |   2730420 |
| Chitungwiza                       | ZWE         |     274912 |   2730420 |
| Mount Darwin                      | ZWE         |     164362 |   2730420 |
| Mutare                            | ZWE         |     131367 |   2730420 |
| Gweru                             | ZWE         |     128037 |   2730420 |
+-----------------------------------+-------------+------------+-----------+
4079 rows in set (1.0974 sec)

MySQL [hod03.no.oracle.com+ ssl/world] SQL>

MySQL [hod03.no.oracle.com+ ssl/world] SQL> select 1;
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (0.2096 sec)

MySQL [hod03.no.oracle.com+ ssl/world] SQL>

- On win10 - issue observed as reported

- Confirmed with colleague, issue is observed on Win10
- Shall attach screenshot shortly
[26 Sep 2018 19:41] Krzysztof Grzadziel
Posted by developer:
 
This issue is fixed under BUG#28596692. Thanks for bug report.
[26 Sep 2018 21:15] Krzysztof Grzadziel
Posted by developer:
 
This issue is fixed under BUG#28596692. Thanks for bug report.
[26 Sep 2018 21:23] Krzysztof Grzadziel
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.