Bug #112817 DB Notebook: runSql() complains function could not be cloned
Submitted: 24 Oct 2023 17:47 Modified: 25 Oct 2023 6:02
Reporter: Kaiwang CHen (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:Shell VSCode Extension Severity:S3 (Non-critical)
Version:1.13.5 OS:MacOS
Assigned to: CPU Architecture:Any

[24 Oct 2023 17:47] Kaiwang CHen
Description:
Example from manual does not work.

doc link: https://dev.mysql.com/doc/mysql-shell-gui/en/mysql-shell-vscode-notebook-select-javascript...

Example code:

runSql(
  "SELECT Name as name," +
  "District as district, Population as pop FROM world.city WHERE Name = 'Kabul' ",
  (ResultSetRows) => {
    print(ResultSetRows);
  }
);
ERROR: Failed to execute 'postMessage' on 'DedicatedWorkerGlobalScope': (ResultSetRows) => {
    print(ResultSetRows);
  } could not be cloned. (Ln 1, Col 2)

How to repeat:
1. Open the Database Connections Browser
2. Connect to a MySQL instance (8.0.34) with world database installed
3. In the DB Notebook editor, switch to js mode
sql> \js
4. type
js> runSql("select name from world.city", function (rs) {});

ERROR: Failed to execute 'postMessage' on 'DedicatedWorkerGlobalScope': function (rs) {} could not be cloned. (Ln 1, Col 2)
[25 Oct 2023 6:02] MySQL Verification Team
Hello Kaiwang,

Thank you for the report and feedback.

regards,
Umesh