Bug #81044 It is possible to drop relational table from mysqlsh using dropCollection()
Submitted: 12 Apr 2016 9:13 Modified: 12 Oct 2018 7:38
Reporter: Shahriyar Rzayev Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Document Store: X Plugin Severity:S3 (Non-critical)
Version:5.7.12 OS:Any
Assigned to: CPU Architecture:Any

[12 Apr 2016 9:13] Shahriyar Rzayev
Description:
Reading about operations on collections:

http://dev.mysql.com/doc/refman/5.7/en/mysql-shell-tutorial-python-collections-operations....

"To drop an existing collection from a database, use the dropCollection() method on the session object"

And there is a link for operations on relational tables:

http://dev.mysql.com/doc/refman/5.7/en/mysql-shell-tutorial-python-relational-tables.html

There is no option to drop table.

But if you try to drop table as collection:

mysql-py>db.tables
{
    "t1": <Table:t1>
}
mysql-py>session.dropCollection("dbtest","t1")
Query OK (0.00 sec)

mysql> show tables;
Empty set (0,00 sec)

How to repeat:
See description

Suggested fix:
If it is possible way, please update doc, if it is not an intended way prevent running dropCollection() on "tables"
[12 Apr 2016 13:14] MySQL Verification Team
Hello Shahriyar,

Thank you for the report.

Thanks,
Umesh
[14 Aug 2017 18:26] Alfredo Kojima
Posted by developer:
 
Documentation must be updated explaining that dropCollection() will work on both collections and tables and is provided for orthogonality and is not functionally unique.
[12 Oct 2018 7:38] Margaret Fisher
Posted by developer:
 
Thanks again for the information. Now documented in:

https://dev.mysql.com/doc/refman/5.7/en/mysql-shell-tutorial-javascript-collections-operat...
https://dev.mysql.com/doc/refman/5.7/en/mysql-shell-tutorial-javascript-table-delete.html
https://dev.mysql.com/doc/refman/5.7/en/mysql-shell-tutorial-python-collections-operations...
https://dev.mysql.com/doc/refman/5.7/en/mysql-shell-tutorial-python-table-delete.html

and 8.0 versions.