Skip to content

Conversation

nuno-faria
Copy link

The current implementation of the auto incremented primary key in the History table uses id int NOT NULL AUTO_INCREMENT for all database engines. However, the correct code for PostgreSQL should be id serial NOT NULL, as can be confirmed in the docs.

Currently, the prepare results in the following error:

FATAL: PQexec() failed: 7 syntax error at or near "AUTO_INCREMENT"
FATAL: failed query was:        create table IF NOT EXISTS history1 (
        id int NOT NULL AUTO_INCREMENT,
        h_c_id int,
        h_c_d_id smallint,
        h_c_w_id smallint,
        h_d_id smallint,
        h_w_id smallint,
        h_date timestamp,
        h_amount decimal(6,2),
        h_data varchar(24) ,PRIMARY KEY(id)
        )
FATAL: `sysbench.cmdline.call_command' function failed: ./tpcc_common.lua:242: SQL error, errno = 0, state = '42601': syntax error at or near "AUTO_INCREMENT"

This commit fixes this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant