<commit_before>#!/bin/bash -e

export MARIADB_JOB_DIR=/var/vcap/jobs/mysql
RUN_DIR=/var/vcap/sys/run/mysql
datadir=/var/vcap/store/mysql
LOG_DIR=/var/vcap/sys/log/mysql
LOG_FILE=$LOG_DIR/maria-ctl.log

case $1 in

  start)

    # It is surprisingly hard to get the config file location passed in
    # on the command line to the mysql.server script. This is easier.
    ln -sf $MARIADB_JOB_DIR/config/my.cnf /etc/my.cnf
    mkdir -p $LOG_DIR

    if ! test -d ${datadir}; then
      mkdir -p ${datadir}
      /var/vcap/packages/mariadb/scripts/mysql_install_db \
             --basedir=/var/vcap/packages/mariadb --user=vcap \
             --datadir=${datadir} >> $LOG_FILE 2>> $LOG_FILE
    fi
    chown -R vcap:vcap ${datadir}

    /var/vcap/packages/mariadb/support-files/mysql.server start >> $LOG_FILE 2>> $LOG_FILE
    ;;

  stop)
    /var/vcap/packages/mariadb/support-files/mysql.server stop >> $LOG_FILE 2>> $LOG_FILE
    ;;

  *)
    echo "Usage: mysql_ctl {start|stop}"
    ;;

esac
<commit_msg>Replacing MySQL default config with our my.cnf<commit_after>#!/bin/bash -e

export MARIADB_JOB_DIR=/var/vcap/jobs/mysql
RUN_DIR=/var/vcap/sys/run/mysql
datadir=/var/vcap/store/mysql
LOG_DIR=/var/vcap/sys/log/mysql
LOG_FILE=$LOG_DIR/maria-ctl.log
CONFIG_DIR=/etc/mysql

case $1 in

  start)

    # It is surprisingly hard to get the config file location passed in
    # on the command line to the mysql.server script. This is easier.
    mkdir -p $CONFIG_DIR
    rm -f $CONFIG_DIR/my.cnf
    ln -sf $MYSQL_JOB_DIR/config/my.cnf $CONFIG_DIR/my.cnf

    mkdir -p $LOG_DIR

    if ! test -d ${datadir}; then
      mkdir -p ${datadir}
      /var/vcap/packages/mariadb/scripts/mysql_install_db \
             --basedir=/var/vcap/packages/mariadb --user=vcap \
             --datadir=${datadir} >> $LOG_FILE 2>> $LOG_FILE
    fi
    chown -R vcap:vcap ${datadir}

    /var/vcap/packages/mariadb/support-files/mysql.server start >> $LOG_FILE 2>> $LOG_FILE
    ;;

  stop)
    /var/vcap/packages/mariadb/support-files/mysql.server stop >> $LOG_FILE 2>> $LOG_FILE
    ;;

  *)
    echo "Usage: mysql_ctl {start|stop}"
    ;;

esac

{'fraction_non_alphanumeric': 0.13634226610249178, 'fraction_numerical': 0.0037611659614480487, 'mean_word_length': 2.7797513321492007, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 27, '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': '1064358', 'n_tokens_mistral': 872, 'n_tokens_neox': 818, 'n_words': 169}