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

Arithmetic overflow for larger databases #538

Closed
Alex-Zarenin opened this issue Apr 16, 2023 · 2 comments · Fixed by #541
Closed

Arithmetic overflow for larger databases #538

Alex-Zarenin opened this issue Apr 16, 2023 · 2 comments · Fixed by #541
Assignees
Labels
bug Something isn't working database Database specific

Comments

@Alex-Zarenin
Copy link
Contributor

Describe the bug
A script generated for SQL Server TPPROC-C includes the following statements:

if {[catch {set rows [ odbc allrows "select sum(d_next_o_id) from district" ]} message ]} {
error "Failed to query district table : $message"

For large size test databases (30,000 warehouses, 75,000 warehouses) this statement results in arithmetic overflow. To address this issue, I have to manually modify the script before each run to replace statement above with:

if {[catch {set rows [ odbc allrows "select sum(cast(d_next_o_id as bigint)) from district" ]} message ]} {
error "Failed to query district table : $message"

Casting d_next_o_id to bigint addressing the issue with arithmetic overflow. It would be helpful to include this cast into the script generator so that users do not have to do this manual change. BTW, this statement appears twice in the script.

To Reproduce
Steps to reproduce the behavior:

  1. Generate large test database - 30,000 warehouses or more
  2. Run performance test with 500 virtual users using Autopilot
  3. See error

Expected behavior

I would expect that test run successfully independent of the size of the test database.

HammerDB Version (please complete the following information):

  • Version: 4.6
  • Build:

HammerDB Interface (please complete the following information):

  • UI: GUI

Operating System (please complete the following information):

  • Server OS: Windows Server 2019
  • Client OS: Windows Server 2019

Database Server (please complete the following information):

  • Database name: SQL Server 2019

Database Client (please complete the following information):

  • Database client name: [ODBC Driver 17 for SQL Server

Additional context
Add any other context about the problem here.

@sm-shaw
Copy link
Contributor

sm-shaw commented Apr 17, 2023

This looks like a good fix and cast(... as bigint) has already been used in TPROC-H without issues where similar problems were observed with queries on larger schemas.
@Alex-Zarenin, please advise if you would like to do a Pull Request for this as well - it should be straightforward.
The query is found 4 times in https://github.com/TPC-Council/HammerDB/blob/master/src/mssqlserver/mssqlsoltp.tcl
as there are different versions of the script that get modified depending on the options selected, such as timed or asynchronous.

@sm-shaw sm-shaw added the bug Something isn't working label Apr 17, 2023
@sm-shaw sm-shaw self-assigned this Apr 17, 2023
@sm-shaw sm-shaw added the database Database specific label Apr 17, 2023
This was referenced Apr 17, 2023
@Alex-Zarenin
Copy link
Contributor Author

I just created a pull request for this issue: #541

@sm-shaw sm-shaw linked a pull request Apr 18, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working database Database specific
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants