File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,11 @@ function cmd_prepare()
7878 end
7979
8080 -- make sure all tables are created before we load data
81+
82+ if drv :name () == " pgsql" then
83+ show_query = " select * from pg_catalog.pg_tables where schemaname != 'information_schema' and schemaname != 'pg_catalog'"
84+ end
85+
8186 repeat
8287 rs = con :query (show_query )
8388 ffi .C .usleep (1000 )
@@ -355,6 +360,20 @@ function set_isolation_level(drv,con)
355360
356361 con :query (" SET SESSION " .. isolation_variable .. " ='" .. isolation_level .. " '" )
357362 end
363+
364+ if drv :name () == " pgsql"
365+ then
366+ if sysbench .opt .trx_level == " RR" then
367+ isolation_level = " REPEATABLE READ"
368+ elseif sysbench .opt .trx_level == " RC" then
369+ isolation_level = " READ COMMITTED"
370+ elseif sysbench .opt .trx_level == " SER" then
371+ isolation_level = " SERIALIZABLE"
372+ end
373+
374+ con :query (" SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL " .. isolation_level )
375+ end
376+
358377end
359378
360379
You can’t perform that action at this time.
0 commit comments