Skip to content

linotrylie/fuzz_debug_platform

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SqlDebug

Toy Arount with It by Docker Compose

You should install Docker Compose on your computer first.

$ git clone https://github.com/fuzzdebugplatform/docker-compose.git
$ cd docker-compose
$ docker-compose up -d
Creating docker-compose_pltform_1 ... done
Creating docker-compose_tw_1      ... done
Creating docker-compose_mysql_1   ... done

The test above is about window functions, with yy file exampleyy/windows.yy.

You can use docker logs to see test process:

$ docker logs docker-compose_pltform_1
2019/12/17 11:49:35 staring prepare data in db
2019/12/17 11:49:53 prepare data in db ok
2019/12/17 11:49:53 tidb statistic funtion open ok
2019/12/17 11:49:53 starting generate query
2019/12/17 11:50:04 fuzz ok

When you see "fuzz ok", you can open localhost:43000 to see analysis(you can alse open this page in advance, but you'd better flush the page after fuzz ok):

quick experience

If you want to rerun it, please clear them first:

$ docker-compose stop
$ docker-compose rm

Run with Binary

  • First, you should wrap the tidb version you are interesting with tidb-wrapper

  • config tidb source dir in config/config.go(must consistent with wrapped tidb)

var defaultConf = Config{
	TiDBSourceDir:        "/home/dqyuan/append/language/Go/projects/hackthon/tidb-bad/",
	TiDBTraceServerAddr:  "http://localhost:43222/trace/",
	TopN:                 10000,
	FailureRateThreshold: 0.7,
}
  • start a wrapped tidb
tidb-bad-wrapper$ ./bin/tidb-server -path testdb
  • start a normal tidb (another version)
tidb-good$ ./bin/tidb-server -P 4001 -path testdb
  • build web page
cd web
yarn run build
  • run test
./bin/platform -Y exampleyy/subquery_test.yy --dsn1 "root:@tcp(127.0.0.1:4000)/randgen"  --dsn2 "root:@tcp(127.0.0.1:4001)/randgen" -Q 100 --debug -W "web/build"

visit localhost:3000 to see analysis.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 35.7%
  • Go 33.3%
  • Yacc 23.3%
  • CSS 4.8%
  • HTML 2.5%
  • Makefile 0.2%
  • Dockerfile 0.2%