Uploaded image for project: 'MariaDB Connector/node.js'
  1. MariaDB Connector/node.js
  2. CONJS-103

Collation changes after 10 times using MariaDb.createPool().query()

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Won't Do
    • None
    • N/A
    • pool
    • None

    Description

      Hello,

      I am using mariadb package to query my database, which is set in UTF8MB4_GENERAL_CI charset: utf8

      But after 10 times I query my database, the collation somehow changes to LATIN1_SWEDISH_CI, charset: latin1, and then the german umlauts (ä ö ü) and ß characters get replaced by question marks.

      I could see this happening in /lib/cmd/common-text-cmd.js, and console.log column.collation and string from packet.readStringLength().

      Any help I would much appreciate!

      Ah yes, I tried with 2.1.0 version this week, and today I tried with the latest 2.1.2 version.

      Attachments

        Activity

          brunoheitzmannalmada Bruno Heitzmann Almada created issue -
          brunoheitzmannalmada Bruno Heitzmann Almada made changes -
          Field Original Value New Value
          Description Hello,

          I am using mariadb package to query my database, which is set in UTF8MB4_GENERAL_CI charset: utf8

          But after 10 times I query my database, the collation somehow changes to LATIN1_SWEDISH_CI, charset: latin1, and then the german umlauts (ä ö ü) and ß characters get replaced by question marks.

          I could see this happening in /lib/cmd/common-text-cmd.js, and console.log column.collation and string from packet.readStringLength().

          Any help I would much appreciate! :)
          Hello,

          I am using mariadb package to query my database, which is set in UTF8MB4_GENERAL_CI charset: utf8

          But after 10 times I query my database, the collation somehow changes to LATIN1_SWEDISH_CI, charset: latin1, and then the german umlauts (ä ö ü) and ß characters get replaced by question marks.

          I could see this happening in /lib/cmd/common-text-cmd.js, and console.log column.collation and string from packet.readStringLength().

          Any help I would much appreciate! :)

          Ah yes, I tried with 2.1.0 version this week, and today I tried with the latest 2.1.2 version.
          diego dupin Diego Dupin made changes -
          Fix Version/s 2.1.2 [ 23921 ]
          diego dupin Diego Dupin added a comment -

          Could you indicate that the server version is less than 10.2.22, 10.3.13 ? This seems to correspond to MDEV-18281
          If this is the case, disable option `resetAfterUse` so when connection from pool is given back to pool, only commit/roolback will be executed if needed.

          diego dupin Diego Dupin added a comment - Could you indicate that the server version is less than 10.2.22, 10.3.13 ? This seems to correspond to MDEV-18281 If this is the case, disable option `resetAfterUse` so when connection from pool is given back to pool, only commit/roolback will be executed if needed.
          diego dupin Diego Dupin made changes -
          Fix Version/s 2.1.2 [ 23921 ]

          Hi Diego, thank you very much for your reply. The Server version is 10.3.12, and my local machine is 10.4.8.

          brunoheitzmannalmada Bruno Heitzmann Almada added a comment - Hi Diego, thank you very much for your reply. The Server version is 10.3.12, and my local machine is 10.4.8.
          diego dupin Diego Dupin added a comment -

          This is now corrected with MDEV-18281. So either upgrade server, or on connector level, change pool configuration to add `resetAfterUse: false`.

          By default, when the connection is released to pool, pool ensures connection good state (reset transaction isolation level, reset session variables, delete user variables, remove temporary tables, ...). That use COM_RESET_CONNECTION indicate in MDEV-18281.
          Disabling `resetAfterUse` then the connector will only rollback any open transaction not using COM_RESET_CONNECTION.

          diego dupin Diego Dupin added a comment - This is now corrected with MDEV-18281 . So either upgrade server, or on connector level, change pool configuration to add `resetAfterUse: false`. By default, when the connection is released to pool, pool ensures connection good state (reset transaction isolation level, reset session variables, delete user variables, remove temporary tables, ...). That use COM_RESET_CONNECTION indicate in MDEV-18281 . Disabling `resetAfterUse` then the connector will only rollback any open transaction not using COM_RESET_CONNECTION.
          diego dupin Diego Dupin made changes -
          issue.field.resolutiondate 2019-11-14 09:30:09.0 2019-11-14 09:30:09.095
          diego dupin Diego Dupin made changes -
          Component/s pool [ 14406 ]
          Fix Version/s 0.0.0 [ 23129 ]
          Resolution Won't Do [ 10201 ]
          Status Open [ 1 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 100506 ] MariaDB v4 [ 135270 ]

          People

            diego dupin Diego Dupin
            brunoheitzmannalmada Bruno Heitzmann Almada
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.