Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-1317

Reject runtime switch of the connection character set to a non-UTF-8 charset

    XMLWordPrintable

Details

    Description

      The driver always encodes/decodes protocol text, and performs client-side escaping, assuming the session character set is UTF-8 (utf8mb3/utf8mb4).
      The server character set can, however, be changed at runtime (e.g. the application issues SET NAMES latin1, SET character_set_client=…), and the server reports the new value back through session-state tracking, which the driver records.

      Reported by fg0x0.

      Fix: Once the connection is initialized, reject any server-reported character-set change to a value that isn't UTF-8 (only utf8 / utf8mb3 / utf8mb4 are allowed). On such a change the driver closes the connection and throws SQLNonTransientConnectionException (SQLState 08000), so no further statements can run against a session whose charset is out of sync with the driver's assumptions.

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            diego dupin Diego Dupin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.