From 396698aadf9d94c873669f4d1b3cfa1146dfcc8e Mon Sep 17 00:00:00 2001 From: Robins Tharakan Date: Mon, 5 Dec 2016 10:56:17 +0000 Subject: [PATCH 1/2] Adding --pgsql-variant=redshift argument targets a Redshift DB --- sysbench/tests/db/common.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sysbench/tests/db/common.lua b/sysbench/tests/db/common.lua index 1677dc4..5d9be23 100644 --- a/sysbench/tests/db/common.lua +++ b/sysbench/tests/db/common.lua @@ -17,6 +17,12 @@ function create_insert(table_id) index_name = "PRIMARY KEY" end + if (pgsql_variant == 'redshift') then + auto_inc_type = "INTEGER IDENTITY(1,1)" + else + auto_inc_type = "SERIAL" + end + i = table_id print("Creating table 'sbtest" .. i .. "'...") @@ -36,7 +42,7 @@ pad CHAR(60) DEFAULT '' NOT NULL, elseif (db_driver == "pgsql") then query = [[ CREATE TABLE sbtest]] .. i .. [[ ( -id SERIAL NOT NULL, +id ]] .. auto_inc_type .. [[ NOT NULL, k INTEGER DEFAULT '0' NOT NULL, c CHAR(120) DEFAULT '' NOT NULL, pad CHAR(60) DEFAULT '' NOT NULL, @@ -176,4 +182,9 @@ function set_vars() oltp_create_secondary = true end + if (pgsql_variant == 'redshift') then + oltp_create_secondary = false + oltp_delete_inserts = 0 + end + end From aead4b99bd6c4d55292c15a49c932c51f9c51556 Mon Sep 17 00:00:00 2001 From: Robins Tharakan Date: Mon, 5 Dec 2016 12:23:46 +0000 Subject: [PATCH 2/2] Minor change to ensure all existing tests pass after previous commit --- tests/t/drivers.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/t/drivers.t b/tests/t/drivers.t index 6eaf6db..943b8ee 100644 --- a/tests/t/drivers.t +++ b/tests/t/drivers.t @@ -18,5 +18,5 @@ Make sure all available DB drivers are covered Dropping table 'sbtest1'... FATAL: invalid database driver name: 'nonexisting' - FATAL: failed to execute function `cleanup': */common.lua:122: DB initialization failed (glob) + FATAL: failed to execute function `cleanup': */common.lua:128: DB initialization failed (glob) [1]