Percona-Lab / sysbench-tpcc

Sysbench scripts to generate a tpcc-like workload for MySQL and PostgreSQL
Apache License 2.0
292 stars 104 forks source link

FATAL: mysql_drv_query() returned error 1105 (Percona-XtraDB-Cluster prohibits use of DML command on a table #30

Closed jangrui closed 3 years ago

jangrui commented 4 years ago

os: centos 7.8 mysql: Percona-XtraDB-Cluster 5.7.30 sysbench: 1.0.20 sysbench-tpcc: 1.0.22

MaWoe commented 3 years ago

Don't know if this works with your exact version of sysbench-tpcc but in master there is a custom script option force_pk which prevents above error:

sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)

tpcc.lua options:
  --enable_purge=STRING         Use purge transaction (yes, no) [no]
  --force_pk=N                  Force using auto-inc PK on history table [0]
  --mysql_storage_engine=STRING Storage engine, if MySQL is used [innodb]
  --mysql_table_options=STRING  Extra table options, if MySQL is used. e.g. 'COLLATE latin1_bin' []
  --pgsql_schema=STRING         Schema name for Pg(default:public) [public]
  --report_csv=STRING           Report output in csv (yes, no) [no]
  --scale=N                     Scale factor (warehouses) [100]
  --tables=N                    Number of tables [1]
  --trx_level=STRING            Transaction isolation level (RC, RR or SER) [RR]
  --use_fk=N                    Use foreign keys [1]
vadimtk commented 3 years ago

For PXC you should use --force_pk=1 options, it will create PK on history table. PXC requires to have primary keys on all tables.