Skip to content

Commit bbca620

Browse files
author
Morri77
committed
drop tables
1 parent 8a2335c commit bbca620

29 files changed

+2146
-337
lines changed

.vscode/tasks.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{
77
"label": "init",
88
"type": "shell",
9-
"command": "sudo -E env PATH=$PATH bash ${workspaceFolder}/build.sh init",
9+
"command": "env PATH=$PATH bash ${workspaceFolder}/build.sh init",
1010
"problemMatcher": [],
1111
"presentation": {
1212
"focus": true,
@@ -101,6 +101,16 @@
101101
"focus": true,
102102
},
103103
},
104+
{
105+
"label": "Run observer",
106+
"type": "shell",
107+
"command": "/root/miniob/build/bin/observer -s/root/miniob-test.sock -f /root/miniob/etc/observer.ini"
108+
},
109+
{
110+
"label": "Run obclient",
111+
"type": "shell",
112+
"command": "/root/miniob/build/bin/obclient -s/root/miniob-test.sock"
113+
},
104114
],
105115
"inputs": [
106116
{
@@ -136,4 +146,4 @@
136146
"default": "basic,primary-select-meta"
137147
}
138148
]
139-
}
149+
}

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
add_definitions("-Wall -g")
12
cmake_minimum_required(VERSION 3.10)
23
set(CMAKE_CXX_STANDARD 20)
34

build.sh

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ CMAKE_COMMAND="cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 --log-level=STATUS"
99

1010
ALL_ARGS=("$@")
1111
BUILD_ARGS=()
12-
MAKE_ARGS=()
12+
MAKE_ARGS=(-j $CPU_CORES)
1313
MAKE=make
1414

1515
echo "$0 ${ALL_ARGS[@]}"
@@ -20,17 +20,17 @@ function usage
2020
echo "./build.sh -h"
2121
echo "./build.sh init # install dependence"
2222
echo "./build.sh clean"
23-
echo "./build.sh make" #添加常用命令
23+
echo "./build.sh make"
2424
echo "./build.sh unittest"
2525
echo "./build.sh test [TestCases] [TestOptions]"
26-
echo "./build.sh dif SingleTestCaseName [DiffOptions]"
26+
echo "./build.sh diff SingleTestCaseName [DiffOptions]"
2727
echo "./build.sh [BuildType] [--make [MakeOptions]]"
2828
echo ""
2929
echo "OPTIONS:"
3030
echo "BuildType => debug(default), release"
3131
echo "MakeOptions => Options to make command, default: -j N"
32-
echo "DiffOptions => Options to diff command, e.g. -u|-c|-y" # -u: unified, -c: context, -y: side by side
33-
echo "TestOptions => Options to /test/case/miniob_test.py"
32+
echo "DiffOptions => Options to diff command, e.g. -u|-c|-y"
33+
echo "TestOptions => Options to ./test/case/miniob_test.py"
3434

3535
echo ""
3636
echo "Examples:"
@@ -59,7 +59,8 @@ function parse_args
5959
elif [[ $make_start == false ]]
6060
then
6161
BUILD_ARGS+=("$arg")
62-
else
62+
e
63+
se
6364
MAKE_ARGS+=("$arg")
6465
fi
6566

@@ -108,7 +109,7 @@ function do_init
108109

109110
# build libevent
110111
cd ${TOPDIR}/deps/3rd/libevent && \
111-
git checkout release-2.1.12-stable && \ #不知道干了什么
112+
git checkout release-2.1.12-stable && \
112113
mkdir -p build && \
113114
cd build && \
114115
${CMAKE_COMMAND} .. -DEVENT__DISABLE_OPENSSL=ON -DEVENT__LIBRARY_TYPE=BOTH && \
@@ -127,7 +128,7 @@ function do_init
127128
cd ${TOPDIR}/deps/3rd/benchmark && \
128129
mkdir -p build && \
129130
cd build && \
130-
${CMAKE_COMMAND} .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBENCHMARK_ENABLE_TESTING=OFF -DBENCHMARK_INSTALL_DOCS=OFF -DBENCHMARK_ENABLE_GTEST_TESTS=OFF -DBENCHMARK_USE_BUNDLED_GTEST=OFF -DBENCHMARK_ENABLE_ASSEMBLY_TESTS=OFF && \
131+
${CMAKE_COMMAND} .. -DBENCHMARK_ENABLE_TESTING=OFF -DBENCHMARK_INSTALL_DOCS=OFF -DBENCHMARK_ENABLE_GTEST_TESTS=OFF -DBENCHMARK_USE_BUNDLED_GTEST=OFF -DBENCHMARK_ENABLE_ASSEMBLY_TESTS=OFF && \
131132
${MAKE_COMMAND} -j4 && \
132133
${MAKE_COMMAND} install
133134

@@ -183,6 +184,20 @@ function build
183184
esac
184185
}
185186

187+
function do_unittest
188+
{
189+
cd ./build/bin
190+
for exe in $(pwd)/*_test; do
191+
echo $exe
192+
if [ $exe != $(pwd)/"client_performance_test" ] && \
193+
[ $exe != $(pwd)/"record_manager_concurrency_test" ] && \
194+
[ $exe != $(pwd)/"bplus_tree_concurrency_test" ] && \
195+
[ $exe != $(pwd)/"bplus_tree_test" ]; then
196+
$exe
197+
fi
198+
done
199+
}
200+
186201
function do_test
187202
{
188203
# test component
@@ -255,4 +270,4 @@ function main
255270
esac
256271
}
257272

258-
main "$@"
273+
main "$@"

db/sys/dblwr.db

Whitespace-only changes.

miniob/db/sys/dblwr.db

24.1 KB
Binary file not shown.

miniob/db/sys/sys.db

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0

miniob/db/sys/test.data

8 KB
Binary file not shown.

miniob/db/sys/test.table

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"fields" :
3+
[
4+
{
5+
"FIELD_id" : 0,
6+
"len" : 4,
7+
"name" : "t1",
8+
"offset" : 0,
9+
"type" : "ints",
10+
"visible" : true
11+
}
12+
],
13+
"indexes" : null,
14+
"storage_format" : 1,
15+
"table_id" : 0,
16+
"table_name" : "test"
17+
}

miniob/db/sys/test2.data

8 KB
Binary file not shown.

miniob/db/sys/test2.table

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"fields" :
3+
[
4+
{
5+
"FIELD_id" : 0,
6+
"len" : 4,
7+
"name" : "t2",
8+
"offset" : 0,
9+
"type" : "ints",
10+
"visible" : true
11+
}
12+
],
13+
"indexes" : null,
14+
"storage_format" : 1,
15+
"table_id" : 1,
16+
"table_name" : "test2"
17+
}

0 commit comments

Comments
 (0)