<commit_before>/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007 Tokutek Inc.  All rights reserved."
#include "test.h"

/* Test to see if the set_lk_max_locks works. */
/* This is very specific to TokuDB.  It won't work with Berkeley DB. */


#include <db.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <memory.h>

// ENVDIR is defined in the Makefile

#if TOKUDB
#define EXTRA_LOCK_NEEDED 2
#else
#define EXTRA_LOCK_NEEDED 0
#endif

static void make_db (int n_locks) {
    DB_ENV *env;
    DB *db;
    DB_TXN *tid, *tid2;
    int r;
    int i;
    u_int32_t actual_n_locks;

    r = system("rm -rf " ENVDIR);
    CKERR(r);
    r = toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);       assert(r == 0);
    r = db_env_create(&env, 0); assert(r == 0);<commit_msg>[t:4501], fix test as result of changes for #4472<commit_after>/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007 Tokutek Inc.  All rights reserved."
#include "test.h"

/* Test to see if the set_lk_max_locks works. */
/* This is very specific to TokuDB.  It won't work with Berkeley DB. */


#include <db.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <memory.h>

// ENVDIR is defined in the Makefile

#define EXTRA_LOCK_NEEDED 0 // pre #4472, TokuDB needed some extra locks due to grabbing of directory lock for some operations

static void make_db (int n_locks) {
    DB_ENV *env;
    DB *db;
    DB_TXN *tid, *tid2;
    int r;
    int i;
    u_int32_t actual_n_locks;

    r = system("rm -rf " ENVDIR);
    CKERR(r);
    r = toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);       assert(r == 0);
    r = db_env_create(&env, 0); assert(r == 0);
{'fraction_non_alphanumeric': 0.14203565267395055, 'fraction_numerical': 0.02127659574468085, 'mean_word_length': 3.254278728606357, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '226981', 'n_tokens_mistral': 741, 'n_tokens_neox': 693, 'n_words': 208}