Description:
[root@misc01 MID2016]# mysqlsh --version;
MySQL Shell Version 1.0.3 Development Preview
[root@misc01 MID2016]#
If I tried to input Japanese character through MySQL Shell,
I can't input or paste Japanese character.
How to repeat:
【Test Commands】
db.x_posts.add({"charactor":"ASCII", "text":"This text is inputted through mysql shell"});
db.x_posts.add({"charactor":"UNICODE", "text":"これはmysql shell経由の入力です"});
db.x_posts.find("charactor = 'ASCII'").sort(["charactor"]);
db.x_posts.find("charactor = 'UNICODE'").sort(["charactor"]);
【Actual Test in JavaScript mode】
Japanese character can't possible to paste in MySQL Shell.
Before Past
db.x_posts.add({"charactor":"UNICODE", "text":"これはmysql shell経由の入力です"});
After Paste
db.x_posts.add({"charactor":"UNICODE", "text":"mysql shell"});
Detail
------------------
[root@misc01 MID2016]# mysqlsh --uri demo_user@localhost/NEW57 -ppassword
mysqlx: [Warning] Using a password on the command line interface can be insecure.
Creating an X Session to demo_user@localhost:33060/NEW57
Default schema `NEW57` 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 JavaScript mode. Use \sql to switch to SQL mode and execute queries.
mysql-js> db.createCollection("x_posts");
<Collection:x_posts>
mysql-js> db.x_posts.add({"charactor":"ASCII", "text":"This text is inputted through mysql shell"});
Query OK, 1 item affected (0.01 sec)
mysql-js> db.x_posts.add({"charactor":"UNICODE", "text":"mysql shell"});
Query OK, 1 item affected (0.00 sec)
mysql-js> db.x_posts.find("charactor = 'ASCII'").sort(["charactor"]);
[
{
"_id": "5416d8b54e08e611181a0800279cea3c",
"charactor": "ASCII",
"text": "This text is inputted through mysql shell"
}
]
1 document in set (0.00 sec)
mysql-js> db.x_posts.find("charactor = 'UNICODE'").sort(["charactor"]);
[
{
"_id": "36f49ebb4e08e611181a0800279cea3c",
"charactor": "UNICODE",
"text": "mysql shell"
}
]
1 document in set (0.00 sec)
mysql-js>
admin@192.168.56.113 [NEW57]> select * from x_posts;
+------------------------------------------------------------------------------------------------------------------------+----------------------------------+
| doc | _id |
+------------------------------------------------------------------------------------------------------------------------+----------------------------------+
| {"_id": "36f49ebb4e08e611181a0800279cea3c", "text": "mysql shell", "charactor": "UNICODE"} | 36f49ebb4e08e611181a0800279cea3c |
| {"_id": "5416d8b54e08e611181a0800279cea3c", "text": "This text is inputted through mysql shell", "charactor": "ASCII"} | 5416d8b54e08e611181a0800279cea3c |
+------------------------------------------------------------------------------------------------------------------------+----------------------------------+
2 rows in set (0.01 sec)
admin@192.168.56.113 [NEW57]>
【Actual Test in SQL mode】
[root@misc01 MID2016]# mysqlsh -u demo_user -ppassword --sql --schema=world_x2
mysqlx: [Warning] Using a password on the command line interface can be insecure.
Creating a Node Session to demo_user@localhost:33060/world_x2
Default schema `world_x2` 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> INSERT INTO T_UC01 VALUES (1,'Repli Test'),(2,'');
Query OK, 2 rows affected (0.00 sec)
mysql-sql>
[root@misc01 MID2016]# echo "select * from T_UC01;" | mysqlsh -u demo_user -ppassword --sql --schema=world_x2
mysqlx: [Warning] Using a password on the command line interface can be insecure.
+----+------------+
| id | text |
+----+------------+
| 1 | Repli Test |
| 2 | |
+----+------------+
[root@misc01 MID2016]#
【It is working fine with Unicode outside of shell】
[root@misc01 MID2016]# echo "INSERT INTO T_UC01 VALUES (1,'Repli Test'),(2,'日本語の入力');" | mysqlsh -u demo_user -ppassword --sql --schema=world_x2
mysqlx: [Warning] Using a password on the command line interface can be insecure.
[root@misc01 MID2016]# echo "select * from T_UC01;" | mysqlsh -u demo_user -ppassword --sql --schema=world_x2
mysqlx: [Warning] Using a password on the command line interface can be insecure.
+----+--------------------+
| id | text |
+----+--------------------+
| 1 | Repli Test |
| 2 | 日本語の入力 |
+----+--------------------+
[root@misc01 MID2016]#
Suggested fix:
Enable to Input Unicode Character inside of MySQL Shell.