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

Fix o_all_local inserted before set #374

Closed
sm-shaw opened this issue Jun 14, 2022 · 0 comments · Fixed by #375
Closed

Fix o_all_local inserted before set #374

sm-shaw opened this issue Jun 14, 2022 · 0 comments · Fixed by #375
Assignees

Comments

@sm-shaw
Copy link
Contributor

sm-shaw commented Jun 14, 2022

As PR #356 fixes some inconsistencies inherited from the TPC-C spec example code, there is the opportunity to do the same for the o_all_local set at the same time.

In the Spec o_all_local is inserted into ORDERS before it is set and therefore always inherits the default for the insert.
https://www.tpc.org/tpc_documents_current_versions/pdf/tpc-c_v5.11.0.pdf

o_all_local inserted --> EXEC SQL INSERT INTO ORDERS (o_id , o_d _id , o_w _id , o_c_id ,o_entry_d , o_ol_cnt, o_all_local) VALUES (:o_id , :d _id , :w _id , :c_id ,:datetime, :o_ol_cnt, :o_all_local);
EXEC SQL INSERT INTO NEW_ORDER (no_o_id , no_d_id , no_w _id ) VALUES (:o_id , :d _id , :w _id );
for (ol_number=1; ol_number<=o_ol_cnt; ol_number++)
{
ol_supply_w _id =atol(supware[ol_number -1]);
o_all_local set --> if (ol_supply_w _id != w _id) o_all_local=0;
ol_i_id =atol(item id [ol_number-1]);
ol_qu antity=atol(qty[ol_number-1]);
...

HammerDB inherited this behaviour, however Oracle and PostgreSQL have already been updated to fix this issue. Pull request #372 also corrects this for SQL Server. MySQL, MariaDB and Db2 should be updated for consistency by setting the default to 1 and moving the inserts after the point where o_all_local can be set to 0.

@sm-shaw sm-shaw self-assigned this Jun 14, 2022
@sm-shaw sm-shaw linked a pull request Jun 14, 2022 that will close this issue
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 a pull request may close this issue.

1 participant