Bug #82756 Documentation unclear about script contents in example
Submitted: 28 Aug 2016 12:01 Modified: 12 Apr 2018 10:29
Reporter: Daniël van Eeden (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Document Store: MySQL Shell Severity:S3 (Non-critical)
Version:1.0.4 OS:Any
Assigned to: CPU Architecture:Any

[28 Aug 2016 12:01] Daniël van Eeden
Description:
Page: https://dev.mysql.com/doc/refman/5.7/en/mysql-shell-batch-code-execution.html

-------------------
Loading SQL code from a file for batch processing.

shell> mysqlsh --file code.js
-------------------

SQL code with a .js extension?

How to repeat:
Read docs

Suggested fix:
I guess SQL here should be replace by Javascript
OR
The --sql option should be added and the extension should be changed to .sql
[28 Aug 2016 15:22] Miguel Solorzano
Thank you for the bug report.
[19 Oct 2017 5:31] Juan Rene Ramirez Monarrez
Posted by developer:
 
Hi Godofredo

The example you are talking about is indeed correct, by default the shell starts in JavaScript mode, if you pass a file right away it will expect that it is a JavaScript file, for python or SQL you need to specify a flag, look at:

https://dev.mysql.com/doc/refman/5.7/en/mysql-shell-active-language.html

Now, the fact that you raised this issue clearly indicates that we can improve in explaining this on the documentation, this ticket will be attended by the documentation guys.

Thanks for creating this report!
[12 Apr 2018 10:33] Pawel Andruszkiewicz
https://dev.mysql.com/doc/refman/5.7/en/mysql-shell-batch-code-execution.html

Problem is not there anymore:

Loading JavaScript code from a file for batch processing.

shell> mysqlsh --file code.js