Skip to content

πŸ› SQL import fails on Japanese Windows due to MariaDB 11.4 sandbox mode commentΒ #9224

@eyes-and-brain

Description

@eyes-and-brain

I affirm:

  • I understand that if I do not agree to the following points by completing the checkboxes my issue will be ignored.
  • I have read and understood the Contributing Guide and the Code of Conduct.
  • I have searched existing issues to see if the issue has already been opened, and I have checked the commit log to see if the issue has been resolved since my server was last updated.

OS / platform the server is running (if known)

Windows11

Branch affected by issue

base

Steps to reproduce

Describe the bug
Restoring or importing a database backup created with MariaDB 11.4.1 or later using dbtool.py fails on Japanese Windows environments.

The failure is caused by the new security comment line automatically inserted by mariadb-dump: /*!999999- enable the sandbox mode */

In a Japanese Windows environment (Code Page 932 / Shift-JIS), the backslash () is treated as the Yen symbol (0x5C). When dbtool.py executes the import command through subprocess.Popen(shell=True), this specific sequence - is misinterpreted as an invalid escape character or a broken string, which causes the MySQL client to terminate with a syntax error at the very first line of the file.

To Reproduce

  1. Use a Windows OS set to Japanese locale (CP932).
  2. Create a database dump using MariaDB 11.4.1 or later.
  3. Attempt to restore this dump using dbtool.py (Option 4).
  4. The process fails immediately with a SQL syntax error.

Expected behavior
The SQL backup should be imported successfully regardless of the MariaDB version used to create the dump or the system's regional settings.

Workaround
Manually deleting the first line /*!999999- enable the sandbox mode */ from the SQL file allows the import to proceed without errors.

Suggested Fix

  • Add the --skip-sandbox-mode option to the mysqldump command within dbtool.py.
  • Alternatively, add a routine in dbtool.py to automatically detect and strip this specific comment line from the SQL file before starting the import process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions