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

cannot connect to 11.3+ server with character-set-collations = utf8mb4=uca1400_ai_ci

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Blocker
    • Resolution: Fixed
    • 3.2.3
    • 3.3.0
    • authentication
    • None

    Description

      From https://github.com/php/php-src/issues/13452#issuecomment-1957843389

      ubuntu 22.04, Node.js v20.11.1

      var mariadb = require('mariadb');
      var pool = mariadb.createPool({
        host: "localhost",
        port:  3306,
        user: "root",
        password: "",
        database: "test"
      });
      module.exports = Object.freeze({
        pool: pool
      });
       
      pool.getConnection()
        .then(conn => {
          conn.query('SELECT  1')
            .then(res => {
              console.log('Connection successful');
              conn.release();
            })
            .catch(err => {
              console.log('Connection failed', err);
              conn.release();
            });
        })
        .catch(err => {
          console.log('Connection failed', err);
        });
       
      # node app.js 
      /root/node_modules/mariadb/lib/cmd/handshake/auth/handshake.js:93
          out.writeInt8(opts.collation && opts.collation.index < 255 ? opts.collation.index : info.collation.index);
                                                                                                             ^
       
      TypeError: Cannot read properties of undefined (reading 'index')
          at Handshake.send (/root/node_modules/mariadb/lib/cmd/handshake/auth/handshake.js:93:104)
          at Handshake.parseHandshakeInit (/root/node_modules/mariadb/lib/cmd/handshake/auth/handshake.js:57:17)
          at Authentication.onPacketReceive (/root/node_modules/mariadb/lib/cmd/handshake/authentication.js:38:17)
          at PacketInputStream.receivePacketBasic (/root/node_modules/mariadb/lib/io/packet-input-stream.js:85:9)
          at PacketInputStream.onData (/root/node_modules/mariadb/lib/io/packet-input-stream.js:135:20)
          at Socket.emit (node:events:518:28)
          at addChunk (node:internal/streams/readable:559:12)
          at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
          at Readable.push (node:internal/streams/readable:390:5)
          at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
      

      Node.js v20.11.1

      Attachments

        Issue Links

          Activity

            People

              diego dupin Diego Dupin
              danblack Daniel Black
              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.