Bug #81162 Bad lexical cast: with select * from information_schema.innodb_sys_tablespaces
Submitted: 20 Apr 2016 17:31 Modified: 5 May 2016 11:57
Reporter: Shahriyar Rzayev Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Document Store: MySQL Shell Severity:S2 (Serious)
Version:1.0.3 OS:Any
Assigned to: CPU Architecture:Any

[20 Apr 2016 17:31] Shahriyar Rzayev
Description:
As simple:

sh@percona-XPS-15:~$ mysqlsh -u root -pBaku12345# --sqlc dbtest
mysqlx: [Warning] Using a password on the command line interface can be insecure.
Creating a Classic Session to root@localhost:3306/dbtest
Default schema `dbtest` accessible through db.

mysql-sql> select * from information_schema.innodb_sys_tablespaces;
bad lexical cast: source type value could not be interpreted as target

How to repeat:
See description.

Suggested fix:
No idea.
[20 Apr 2016 17:53] MySQL Verification Team
I couldn't repeat on Windows:

c:\Program Files\MySQL\MySQL Shell 1.0\bin>mysqlsh -u root -p --sqlc test
Creating a Classic Session to root@localhost:3306/test
Enter password: ******
Default schema `test` accessible through db.

Welcome to MySQL Shell 1.0.3 Development Preview

Copyright (c) 2016, 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', '\h' or '\?' for help.

Currently in SQL mode. Use \js or \py to switch the shell to a scripting language.
mysql-sql> select * from information_schema.innodb_sys_tablespaces;
+-------+------------------------------------------------------+------+-------------+----------------------+-----------+---------------+
| SPACE | NAME                                                 | FLAG | FILE_FORMAT | ROW_FORMAT           | PAGE_SIZE | ZIP_PAGE_SIZE |
+-------+------------------------------------------------------+------+-------------+----------------------+-----------+---------------+
|     1 | mysql/innodb_table_stats                             |    0 | Antelope    | Compact or Redundant |     16384 |             0 |
|     2 | mysql/innodb_index_stats                             |    0 | Antelope    | Compact or Redundant |     16384 |             0 |
|     3 | mysql/slave_relay_log_info                           |    0 | Antelope    | Compact or Redundant |     16384 |             0 |
|     4 | mysql/slave_master_info                              |    0 | Antelope    | Compact or Redundant |     16384 |             0 |
|     5 | mysql/slave_worker_info                              |    0 | Antelope    | Compact or Redundant |     16384 |             0 |
|   293 | d/dt                                                 |    0 | Antelope    | Compact or Redundant |     16384 |             0 |
|   294 | a/a1                                                 |    0 | Antelope    | Compact or Redundant |     16384 |             0 |
|   295 | sakila/actor                                         |    0 | Antelope    | Compact or Redundant |     16384 |             0 |
|   296 | sakila/address                                       |    0 | Antelope    | Compact or Redundant |     16384 |             0 |
|   297 | sakila/category                                      |    0 | Antelope    | Compact or Redundant |     16384 |             0 |
|   298 | sakila/city                                          |    0 | Antelope    | Compact or Redundant |     16384 |             0 |
|   299 | sakila/country                                       |    0 | Antelope    | Compact or Redundant |     16384 |             0 |
|   300 | sakila/customer                                      |    0 | Antelope    | Compact or Redundant |     16384 |             0 |
|   301 | sakila/film                                          |    0 | Antelope    | Compact or Redundant |     16384 |             0 |
|   302 | sakila/film_actor                                    |    0 | Antelope    | Compact or Redundant |     16384 |             0 |
<CUT>
Antelope    | Compact or Redundant |     16384 |             0 |
+-------+------------------------------------------------------+------+-------------+----------------------+-----------+---------------+
65 rows in set (0.00 sec)

mysql-sql>
[20 Apr 2016 18:12] Shahriyar Rzayev
Sorry i forget to put correct version of MySQL Server.

From doc:
https://dev.mysql.com/doc/refman/5.7/en/mysql-shell-features.html

"MySQL Shell can also connect to MySQL Servers that do not support the X Protocol using the legacy MySQL Protocol. A minimal set of features from the X DevAPI are available for sessions created using the legacy MySQL protocol."

I have connected to MySQL server 5.7.11.
[20 Apr 2016 18:15] MySQL Verification Team
Thank you for the feedback. Please check again 5.7.12. Thanks.
[20 Apr 2016 18:15] Shahriyar Rzayev
https://dev.mysql.com/doc/refman/5.7/en/mysql-shell-sessions.html

"Classic Session Use this session type to interact with MySQL Servers that do not have the X Protocol enabled. SQL execution is available with this session type, therefore it can be used in MySQL Shell's SQL Mode."

--sqlc = --classic + --sql
[20 Apr 2016 18:25] Roel Van de Paar
Miguel, please check 5.7.11
[21 Apr 2016 8:33] MySQL Verification Team
Thank you for the feedback.
I'm still not seeing any issues with 5.6.30/5.7.11, anything else required to trigger this issue?

-- 5.6.30

[root@cluster-repo ~]# mysqlsh -hx.x.x.x -P15000 -u ushastry -p --sqlc test
Creating a Classic Session to ushastry@x.x.x.x:15000/test
Enter password:
Default schema `test` accessible through db.

Welcome to MySQL Shell 1.0.3 Development Preview

Copyright (c) 2016, 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', '\h' or '\?' for help.

Currently in SQL mode. Use \js or \py to switch the shell to a scripting language.
mysql-sql> select * from information_schema.innodb_sys_tablespaces;
+-------+----------------------------+------+-------------+----------------------+-----------+---------------+
| SPACE | NAME                       | FLAG | FILE_FORMAT | ROW_FORMAT           | PAGE_SIZE | ZIP_PAGE_SIZE |
+-------+----------------------------+------+-------------+----------------------+-----------+---------------+
|     1 | mysql/innodb_table_stats   |    0 | Antelope    | Compact or Redundant |     16384 |             0 |
|     2 | mysql/innodb_index_stats   |    0 | Antelope    | Compact or Redundant |     16384 |             0 |
|     3 | mysql/slave_relay_log_info |    0 | Antelope    | Compact or Redundant |     16384 |             0 |
|     4 | mysql/slave_master_info    |    0 | Antelope    | Compact or Redundant |     16384 |             0 |
|     5 | mysql/slave_worker_info    |    0 | Antelope    | Compact or Redundant |     16384 |             0 |
+-------+----------------------------+------+-------------+----------------------+-----------+---------------+
5 rows in set (0.27 sec)

mysql-sql> select version();
+-------------------------------------------+
| version()                                 |
+-------------------------------------------+
| 5.6.30-enterprise-commercial-advanced-log |
+-------------------------------------------+
1 row in set (0.27 sec)

mysql-sql> \q
Bye!

[root@cluster-repo ~]# mysqlsh -hx.x.x.x -P15000 -u ushastry -p --sqlc world_x
Creating a Classic Session to ushastry@x.x.x.x:15000/world_x
Enter password:
Default schema `world_x` accessible through db.

Welcome to MySQL Shell 1.0.3 Development Preview

Copyright (c) 2016, 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', '\h' or '\?' for help.

Currently in SQL mode. Use \js or \py to switch the shell to a scripting language.
mysql-sql> select * from information_schema.innodb_sys_tablespaces;
+-------+---------------------------------+------+-------------+------------+-----------+---------------+------------+---------------+-----------+----------------+
| SPACE | NAME                            | FLAG | FILE_FORMAT | ROW_FORMAT | PAGE_SIZE | ZIP_PAGE_SIZE | SPACE_TYPE | FS_BLOCK_SIZE | FILE_SIZE | ALLOCATED_SIZE |
+-------+---------------------------------+------+-------------+------------+-----------+---------------+------------+---------------+-----------+----------------+
|     2 | mysql/plugin                    |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |          4096 |     98304 |          98304 |
|     3 | mysql/servers                   |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |          4096 |     98304 |          98304 |
|     4 | mysql/help_topic                |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |          4096 |   9437184 |        9441280 |
|     5 | mysql/help_category             |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |          4096 |    114688 |         114688 |
|     6 | mysql/help_relation             |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |          4096 |    131072 |         131072 |
|     7 | mysql/help_keyword              |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |          4096 |    245760 |         245760 |
|     8 | mysql/time_zone_name            |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |          4096 |     98304 |          98304 |
|     9 | mysql/time_zone                 |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |          4096 |     98304 |          98304 |
|    10 | mysql/time_zone_transition      |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |          4096 |     98304 |          98304 |
|    11 | mysql/time_zone_transition_type |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |          4096 |     98304 |          98304 |
|    12 | mysql/time_zone_leap_second     |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |          4096 |     98304 |          98304 |
|    13 | mysql/innodb_table_stats        |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |          4096 |     98304 |          98304 |
|    14 | mysql/innodb_index_stats        |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |          4096 |     98304 |          98304 |
|    15 | mysql/slave_relay_log_info      |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |          4096 |     98304 |          98304 |
|    16 | mysql/slave_master_info         |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |          4096 |     98304 |          98304 |
|    17 | mysql/slave_worker_info         |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |          4096 |     98304 |          98304 |
|    18 | mysql/gtid_executed             |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |          4096 |     98304 |          98304 |
|    19 | mysql/server_cost               |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |          4096 |     98304 |          98304 |
|    20 | mysql/engine_cost               |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |          4096 |     98304 |          98304 |
|    21 | sys/sys_config                  |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |          4096 |     98304 |          98304 |
|    23 | world_x/City                    |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |          4096 |    589824 |         593920 |
|    24 | world_x/Country                 |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |          4096 |     98304 |          98304 |
|    25 | world_x/CountryInfo             |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |          4096 |    196608 |         196608 |
|    26 | world_x/CountryLanguage         |   33 | Barracuda   | Dynamic    |     16384 |             0 | Single     |          4096 |    229376 |         229376 |
+-------+---------------------------------+------+-------------+------------+-----------+---------------+------------+---------------+-----------+----------------+
24 rows in set (0.27 sec)

mysql-sql> select version();
+-----------+
| version() |
+-----------+
| 5.7.11    |
+-----------+
1 row in set (0.27 sec)
[5 May 2016 11:47] Shahriyar Rzayev
I am unable to reproduce with CentOS 7 using MySQL 5.7.11.
So it is not a common issue.
please close this.
Thanks.
[5 May 2016 11:57] MySQL Verification Team
Thank you for confirming.
Closing the report now.