Skip to content

DBGroup-SUSTech/ssmonetdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQLsmith for MonetDB

added SQLsmith Driver for MonetDB

Description

SQLsmith is a random SQL query generator.

Dependencies:

  • C++11
  • libpqxx // for postgresql
  • boost::regex in case your std::regex is broken
  • monetdb_mapi // for monetdb

Building on Fedora

apt-get install build-essential autoconf autoconf-archive libpqxx-dev libboost-regex-dev libsqlite3-dev
cd ssmonetdb
autoreconf -i 
./configure
make

Misc on x64 Ubuntu

For error: "Could not find a version of the Boost::Regex library!" using the following command
./configure --with-boost-libdir=/usr/lib/x86_64-linux-gnu
For error: No package 'monetdb-mapi' found or No package 'LIBPQXX' found  
adjusting the PKG_CONFIG_PATH environment variable

Usage

SQLsmith connects to the target database to retrieve the schema for query generation and to send the generated queries to. Currently, all generated statements are rolled back. Beware that SQLsmith does call functions that could possibly have side-effects (e.g. pg_terminate_backend). Use a suitably underprivileged user for its connection to avoid this.

Example invocation:

sqlsmith --verbose --monetdb="databasename"

The following options are currently supported:

--target=connstrtarget postgresql database
--monetdb=dbnametarget monetdb database
--log-to=connstrdatabase for logging errors (for postgresql only)
--verboseemit progress output
--versionshow version information
--seed=intseed RNG with specified integer instead of PID
--dry-runprint queries instead of executing them
--max-queries=longterminate after generating this many queries
--dump-all-graphsdump generated ASTs for debugging

Sample output:

--verbose makes sqlsmith emit some progress indication to stderr. A symbol is output for each query sent to the server. Currently the following ones are generated:

symbolmeaningdetails
.okQuery generated and executed with ok sqlstate
ssyntax errorThese are bugs in sqlsmith - please report
ttimeoutSQLsmith sets a statement timeout of 1s
cbroken connectionThese happen when a query crashes the server
eother error

It also periodically emits error reports. In the following example, these are mostly caused by the primitive type system.

License

SQLsmith is available under GPLv3. Use it at your own risk. It may damage your database (one of the purposes of this tool is to try and break things). See the file COPYING for details.

Authors for SQLsmith

Andreas Seltenreich <seltenreich@gmx.de>

Authors for SQLsmith driver for MonetDB

Bo Tang <tangloner@gmail.com>

Stefan Manegold <Stefan.Manegold@cwi.nl>