<commit_before><?
class dbMysql extends dbSql {
	/**
	 * @var PDO $connection
	 */
	protected $connection;

	/**
	 * @param string $sql
	 * @param array $params
	 * @return PDOStatement
	 * @throws Exception
	 */
	public function directQuery($sql, array $params = [], $autocreate = true) {
		$query = $this->connection->prepare($sql);
		$this->timer->start();

		try {
			#print $sql; print_r($params);
			$result = $query->execute($params);
		} catch ( PDOException $e ) {
			if(!$autocreate) {
				throw $e;
			}

			if($e->getCode() == '42S02') {
				$matches = [];
				preg_match("/Table '[^\\.]+\\.([^\\']+)' doesn't exist/", $e->getMessage(), $matches);
				if(isset($matches[1]) && $matches[1]) {
					$e = new sqlException($e->getMessage(), sqlException::CODE_TABLE_NF, $e);
					$e->setData($matches[1]);
				}
				throw $e;
			}
			if($e->getCode() == '42S22') {
				$matches = [];
				preg_match("/Unknown column '([^\\']+)' in /", $e->getMessage(), $matches);
				$field = isset($matches[1]) ? $matches[1] : null;

				$matches = [];
				preg_match("/^insert( |\\t)+into( |\\t)+([^ \\t\\(]+)/i", $sql, $matches);
				if(isset($matches[3]) && $matches[3]) {
					$table = $matches[3];
				} else {
					preg_match("/^UPDATE( |\\t)+([^ \\t\\(]+)/i", $sql, $matches);
					$table = (isset($matches[2]) && $matches[2]) ? $matches[2] : null;
				}
				if(!$table) {
					preg_match("/FROM( |\\t)+([^ \\t\\(]+)( |\\t)+WHERE/i", $sql, $matches);
					$table = (isset($matches[2]) && $matches[2]) ? $matches[2] : null;
				}

				$e = new sqlException($e->getMessage(), sqlException::CODE_FIELD_NF, $e);
				$e->setData([$table, $field]);
				throw $e;
			}

			throw $e;
		}<commit_msg>Fix compatibility with new version of mysql client<commit_after><?
class dbMysql extends dbSql {
	/**
	 * @var PDO $connection
	 */
	protected $connection;

	/**
	 * @param string $sql
	 * @param array $params
	 * @return PDOStatement
	 * @throws Exception
	 */
	public function directQuery($sql, array $params = [], $autocreate = true) {
		$query = $this->connection->prepare($sql);
		$this->timer->start();

		try {
			#print $sql; print_r($params);
			$result = $query->execute($params);
		} catch ( PDOException $e ) {
			if(!$autocreate) {
				throw $e;
			}

			if(in_array($e->getCode(), ['42S02', '42S22', 42])) {
				$matches = [];
				preg_match("/Table '[^\\.]+\\.([^\\']+)' doesn't exist/", $e->getMessage(), $matches);
				if(isset($matches[1]) && $matches[1]) {
					$e = new sqlException($e->getMessage(), sqlException::CODE_TABLE_NF, $e);
					$e->setData($matches[1]);
				}

				$matches = [];
				preg_match("/Unknown column '([^\\']+)' in /", $e->getMessage(), $matches);
				$field = isset($matches[1]) ? $matches[1] : null;

				$matches = [];
				preg_match("/^insert( |\\t)+into( |\\t)+([^ \\t\\(]+)/i", $sql, $matches);
				if(isset($matches[3]) && $matches[3]) {
					$table = $matches[3];
				} else {
					preg_match("/^UPDATE( |\\t)+([^ \\t\\(]+)/i", $sql, $matches);
					$table = (isset($matches[2]) && $matches[2]) ? $matches[2] : null;
				}
				if(!$table) {
					preg_match("/FROM( |\\t)+([^ \\t\\(]+)( |\\t)+WHERE/i", $sql, $matches);
					$table = (isset($matches[2]) && $matches[2]) ? $matches[2] : null;
				}

				$e = new sqlException($e->getMessage(), sqlException::CODE_FIELD_NF, $e);
				$e->setData([$table, $field]);
				throw $e;
			}

			throw $e;
		}
{'fraction_non_alphanumeric': 0.26076696165191743, 'fraction_numerical': 0.013569321533923304, 'mean_word_length': 3.1761083743842367, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 28, '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': '1502756', 'n_tokens_mistral': 1499, 'n_tokens_neox': 1251, 'n_words': 239}