Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
AllenXieSZ opened this issue Sep 15, 2023 · 2 comments · Fixed by #599
Closed

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

AllenXieSZ opened this issue Sep 15, 2023 · 2 comments · Fixed by #599
Assignees
Labels
bug Something isn't working build database Database specific

Comments

@AllenXieSZ
Copy link

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):

  • Version: [e.g. 4.7]
  • Build: [e.g. Release download or build from source]
    4.8
    HammerDB Interface (please complete the following information):
  • UI: [e.g. GUI or CLI]
    CLI
    Operating System (please complete the following information):
  • Server OS: [e.g. RHEL8]
  • Client OS: [e.g. Windows 11]
    RHEL8
    Database Server (please complete the following information):
  • Database name: [e.g. PostgreSQL]
  • Database Release Version [e.g. 15.2]

Database Client (please complete the following information):

  • Database client name: [e.g. ODBC Driver 18 for SQL Server]

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 sm-shaw self-assigned this Sep 15, 2023
@sm-shaw sm-shaw added bug Something isn't working build database Database specific labels Sep 15, 2023
@sm-shaw
Copy link
Contributor

sm-shaw commented Sep 15, 2023

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,

@sm-shaw sm-shaw linked a pull request Sep 15, 2023 that will close this issue
@AllenXieSZ
Copy link
Author

Thanks Shawn for quick update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build database Database specific
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants