Skip to content

Commit 411da5b

Browse files
authored
Support cockroachdb (#19)
* add support for cockroachdb by docker pulling * adjust sqlancer dockerfile to adapt the latest version of cockrachdb * Revert "adjust sqlancer dockerfile to adapt the latest version of cockrachdb" This reverts commit c04c6f1. * set default miracle to NoREC
1 parent fc0c7b4 commit 411da5b

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

cockroachdb/__init__.py

Whitespace-only changes.

cockroachdb/config.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"embedded": "no",
3+
"dbms": "cockroachdb",
4+
"image": "cockroachdb/cockroach:v24.1.0",
5+
"container_name": "cockroachdb-sqlancer",
6+
"port": 26257,
7+
"startup_cmd": [
8+
"start-single-node",
9+
"--insecure"
10+
],
11+
"username": "root",
12+
"password": "",
13+
"oracle": "NOREC",
14+
"num_threads": 4,
15+
"timeout_seconds": 60
16+
}
17+

config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"dbms_list": ["mysql", "postgres", "sqlite", "tidb"],
2+
"dbms_list": ["mysql", "postgres", "sqlite", "tidb", "cockroachdb"],
33
"dbms": "mysql",
44
"container_name": "mysql-custom",
55
"image": "mysql-custom",

test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def start_db_container(dbms, cfg, script_log, docker_log):
1818
image = cfg.get("image")
1919
container_name = cfg.get("container_name", f"{dbms}-sqlancer")
2020
env_dict = cfg.get("env", {})
21+
startup_cmd = cfg.get("startup_cmd", [])
2122

2223
if not image:
2324
script_log.error( "Missing 'image' field in config.json")
@@ -36,7 +37,8 @@ def start_db_container(dbms, cfg, script_log, docker_log):
3637
"--name", container_name,
3738
"--network", "sqlancer-net",
3839
*env_vars,
39-
image
40+
image,
41+
*startup_cmd
4042
], docker_log)
4143

4244
script_log.info("Starting DBMS container: %s ...", container_name)

0 commit comments

Comments
 (0)