TPC-Council / HammerDB

HammerDB Database Load Testing and Benchmarking Tool
http://www.hammerdb.com
GNU General Public License v3.0
545 stars 115 forks source link

Buildschema error on MySQL tpc-h bm cannot add foreign key constraint #598

Closed AllenXieSZ closed 9 months ago

AllenXieSZ commented 10 months ago

Guidance Bug reports are for when HammerDB is not behaving as expected. Bug reports should not be submitted for help in understanding database performance related questions. General questions on database performance or HammerDB usability should be submitted under Discussions.

Describe the bug A clear and concise description of what the bug is. set the bm to tpc-h and set the db to mysql, run the buildschema, it will through out error and stop

To Reproduce Steps to reproduce the behavior: mysql->tpc-h->buildschema

  1. Go to '...'
  2. Click on '....'
  3. Run workload '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

HammerDB Version (please complete the following information):

Database Client (please complete the following information):

Additional context Add any other context about the problem here.

I check the source it's due to inconsistent data type in src/mysql/mysqlolap.tcl line 188 as below 188 L_ORDERKEY BIGINT NOT NULL, different with line 105 105 O_ORDERKEY INT NOT NULL,

sm-shaw commented 10 months ago

Have verified and bug was introduced with #556

Error in Virtual User 1: Error: mysqlexec/db server: Referencing column 'L_ORDERKEY' and referenced column 'O_ORDERKEY' in foreign key constraint 'LINEITEM_ibfk_1' are incompatible.
Error in Virtual User 1: Error: mariaexec/db server: Can't create table `tpch`.`LINEITEM` (errno: 150 "Foreign key constraint is incorrectly formed")

Fix needed is to also changed referenced O_ORDERKEY to bigint O_ORDERKEY BIGINT NOT NULL,

AllenXieSZ commented 10 months ago

Thanks Shawn for quick update