<commit_before>const h = require('../helper');
const async = require('async');
const mysql = require('mysql');
const connection = mysql.createConnection({
  host     : 'TFB-database',
  user     : 'benchmarkdbuser',
  password : '<PASSWORD>',
  database : 'hello_world'
});

connection.connect();

const queries = {
  RANDOM_WORLD: "SELECT * FROM world WHERE id = " + h.randomTfbNumber(),
  ALL_FORTUNES: "SELECT * FROM fortune",
  UPDATE_WORLD: (rows) => {
    return [
      "UPDATE world SET randomNumber = ", rows[0].randomNumber,
      " WHERE id = ", rows[0]['id']
    ].join('');
  }
};

const mysqlRandomWorld = (callback) =>
  connection.query(queries.RANDOM_WORLD, (err, rows, fields) => {
    callback(err, rows[0]);
  });

const mysqlGetAllFortunes = (callback) =>
  connection.query(queries.ALL_FORTUNES, (err, rows, fields) => {
    callback(err, rows);
  });

const mysqlUpdateQuery = (callback) =>
  connection.query(queries.RANDOM_WORLD, (err, rows, fields) => {<commit_msg>fix query (#2689)<commit_after>const h = require('../helper');
const async = require('async');
const mysql = require('mysql');
const connection = mysql.createConnection({
  host     : 'TFB-database',
  user     : 'benchmarkdbuser',
  password : '<PASSWORD>',
  database : 'hello_world'
});

connection.connect();

const queries = {
  GET_RANDOM_WORLD: () => "SELECT * FROM world WHERE id = " + h.randomTfbNumber(),
  ALL_FORTUNES: "SELECT * FROM fortune",
  UPDATE_WORLD: (rows) => {
    return [
      "UPDATE world SET randomNumber = ", rows[0].randomNumber,
      " WHERE id = ", rows[0]['id']
    ].join('');
  }
};

const mysqlRandomWorld = (callback) =>
  connection.query(queries.GET_RANDOM_WORLD(), (err, rows, fields) => {
    callback(err, rows[0]);
  });

const mysqlGetAllFortunes = (callback) =>
  connection.query(queries.ALL_FORTUNES, (err, rows, fields) => {
    callback(err, rows);
  });

const mysqlUpdateQuery = (callback) =>
  connection.query(queries.GET_RANDOM_WORLD(), (err, rows, fields) => {
{'fraction_non_alphanumeric': 0.17380478087649404, 'fraction_numerical': 0.0049800796812749, 'mean_word_length': 4.16452442159383, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 20, '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': '129362', 'n_tokens_mistral': 678, 'n_tokens_neox': 668, 'n_words': 144}