<commit_before>'use strict'

module.exports = pluginOptions => ({ connection, command }) => {
  const password =
    command.password || pluginOptions.password || connection.config.password;

  const cleartextPassword = function(password) {
    return Buffer.from(`${password}\0`)
  };

  return cleartextPassword(password)
};<commit_msg>To fix connection._authPlugin is not a function<commit_after>'use strict';

function bufferFromStr(str) {
  return Buffer.from(`${str}\0`);
}

const create_mysql_clear_password_plugin = pluginOptions => {
  return function mysql_clear_password_plugin({ connection, command }) {
    const password = command.password || pluginOptions.password || connection.config.password;

    return function(pluginData) {
      return bufferFromStr(password);
    };
  };
};

module.exports = create_mysql_clear_password_plugin;
{'fraction_non_alphanumeric': 0.11971830985915492, 'fraction_numerical': 0.002347417840375587, 'mean_word_length': 5.181159420289855, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6188706', 'n_tokens_mistral': 231, 'n_tokens_neox': 230, 'n_words': 49}