diff --git a/sysbench/tests/db/common.lua b/sysbench/tests/db/common.lua index 1677dc4..96a2a9f 100644 --- a/sysbench/tests/db/common.lua +++ b/sysbench/tests/db/common.lua @@ -36,7 +36,7 @@ pad CHAR(60) DEFAULT '' NOT NULL, elseif (db_driver == "pgsql") then query = [[ CREATE TABLE sbtest]] .. i .. [[ ( -id SERIAL NOT NULL, +id BIGINT IDENTITY(100, 10) NOT NULL, k INTEGER DEFAULT '0' NOT NULL, c CHAR(120) DEFAULT '' NOT NULL, pad CHAR(60) DEFAULT '' NOT NULL, @@ -142,11 +142,11 @@ function set_vars() oltp_range_selects = true end - if (oltp_auto_inc == 'off') then - oltp_auto_inc = false - else +-- if (oltp_auto_inc == 'off') then +-- oltp_auto_inc = false +-- else oltp_auto_inc = true - end +-- end if (oltp_read_only == 'on') then oltp_read_only = true @@ -170,10 +170,10 @@ function set_vars() oltp_skip_trx = false end - if (oltp_create_secondary == 'off') then +-- if (oltp_create_secondary == 'off') then oltp_create_secondary = false - else - oltp_create_secondary = true - end +-- else +-- oltp_create_secondary = true +-- end end diff --git a/sysbench/tests/db/insert.lua b/sysbench/tests/db/insert.lua index 60e9567..7689b54 100644 --- a/sysbench/tests/db/insert.lua +++ b/sysbench/tests/db/insert.lua @@ -25,6 +25,7 @@ function event(thread_id) pad_val = sb_rand_str([[ ###########-###########-###########-###########-###########]]) + oltp_auto_inc = true if (db_driver == "pgsql" and oltp_auto_inc) then rs = db_query("INSERT INTO " .. table_name .. " (k, c, pad) VALUES " .. string.format("(%d, '%s', '%s')", k_val, c_val, pad_val)) diff --git a/sysbench/tests/db/oltp.lua b/sysbench/tests/db/oltp.lua index 209f5a9..54bcfcc 100644 --- a/sysbench/tests/db/oltp.lua +++ b/sysbench/tests/db/oltp.lua @@ -99,8 +99,14 @@ function event(thread_id) ###########-###########-###########-###########-###########-###########-###########-###########-###########-###########]]) pad_val = sb_rand_str([[ ###########-###########-###########-###########-###########]]) - - rs = db_query("INSERT INTO " .. table_name .. " (id, k, c, pad) VALUES " .. string.format("(%d, %d, '%s', '%s')",i, sb_rand(1, oltp_table_size) , c_val, pad_val)) + + oltp_auto_inc = true + + if (oltp_auto_inc) then + rs = db_query("INSERT INTO " .. table_name .. " (k, c, pad) VALUES " .. string.format("(%d, '%s', '%s')",sb_rand(1, oltp_table_size) , c_val, pad_val)) + else + rs = db_query("INSERT INTO " .. table_name .. " (id, k, c, pad) VALUES " .. string.format("(%d, %d, '%s', '%s')",i, sb_rand(1, oltp_table_size) , c_val, pad_val)) + end end diff --git a/sysbench/tests/db/select_random_points.lua b/sysbench/tests/db/select_random_points.lua index 7f6e2c1..caff935 100644 --- a/sysbench/tests/db/select_random_points.lua +++ b/sysbench/tests/db/select_random_points.lua @@ -71,6 +71,7 @@ function prepare() db_query("CREATE INDEX k on sbtest(k)") print("Inserting " .. oltp_table_size .. " records into 'sbtest'") + oltp_auto_inc = true if (oltp_auto_inc) then db_bulk_insert_init("INSERT INTO sbtest(k, c, pad) VALUES") @@ -139,9 +140,9 @@ function set_vars() oltp_table_size = oltp_table_size or 10000 random_points = random_points or 10 - if (oltp_auto_inc == 'off') then - oltp_auto_inc = false - else +-- if (oltp_auto_inc == 'off') then +-- oltp_auto_inc = false +-- else oltp_auto_inc = true - end +-- end end diff --git a/sysbench/tests/db/select_random_ranges.lua b/sysbench/tests/db/select_random_ranges.lua index dfee333..96cfe2f 100644 --- a/sysbench/tests/db/select_random_ranges.lua +++ b/sysbench/tests/db/select_random_ranges.lua @@ -71,7 +71,8 @@ function prepare() db_query("CREATE INDEX k on sbtest(k)") print("Inserting " .. oltp_table_size .. " records into 'sbtest'") - + oltp_auto_inc = true + if (oltp_auto_inc) then db_bulk_insert_init("INSERT INTO sbtest(k, c, pad) VALUES") else @@ -142,9 +143,9 @@ function set_vars() number_of_ranges = number_of_ranges or 10 delta = random_ranges_delta or 5 - if (oltp_auto_inc == 'off') then - oltp_auto_inc = false - else +-- if (oltp_auto_inc == 'off') then +-- oltp_auto_inc = false +-- else oltp_auto_inc = true - end +-- end end