Skip to content

Commit

Permalink
Fix: Changed INSERT statements of templated benchmarks (#447)
Browse files Browse the repository at this point in the history
INSERT query was not working due to duplicate primary keys

Simple solutions on the query did not work for all systems
(For example _INSERT IGNORE, INSERT -- IF NOT EXISTS_).

For now I changed the table of the insert to one that does not have a
primary key.

This PR tries to solve #428
  • Loading branch information
ETHenzlere authored Jan 17, 2024
1 parent 42655b8 commit febe379
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 30 deletions.
4 changes: 1 addition & 3 deletions config/cockroachdb/sample_templated_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<work>
<time>10</time>
<rate>100</rate>
<weights>20,20,10,10,10,10,10<!-- FIXME: ,10 --></weights>
<weights>20,20,10,10,10,10,10,10</weights>
</work>
</works>

Expand All @@ -51,10 +51,8 @@
<transactiontype>
<name>DeleteItem</name>
</transactiontype>
<!-- FIXME:
<transactiontype>
<name>InsertItem</name>
</transactiontype>
-->
</transactiontypes>
</parameters>
4 changes: 1 addition & 3 deletions config/mariadb/sample_templated_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<work>
<time>10</time>
<rate>100</rate>
<weights>20,20,10,10,10,10,10<!-- FIXME: ,10 --></weights>
<weights>20,20,10,10,10,10,10,10</weights>
</work>
</works>

Expand All @@ -52,10 +52,8 @@
<transactiontype>
<name>DeleteItem</name>
</transactiontype>
<!-- FIXME:
<transactiontype>
<name>InsertItem</name>
</transactiontype>
-->
</transactiontypes>
</parameters>
4 changes: 1 addition & 3 deletions config/mysql/sample_templated_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<work>
<time>10</time>
<rate>100</rate>
<weights>20,20,10,10,10,10,10<!-- FIXME: ,10 --></weights>
<weights>20,20,10,10,10,10,10,10</weights>
</work>
</works>

Expand All @@ -52,10 +52,8 @@
<transactiontype>
<name>DeleteItem</name>
</transactiontype>
<!-- FIXME:
<transactiontype>
<name>InsertItem</name>
</transactiontype>
-->
</transactiontypes>
</parameters>
4 changes: 1 addition & 3 deletions config/oracle/sample_templated_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<work>
<time>10</time>
<rate>100</rate>
<weights>20,20,10,10,10,10,10<!-- FIXME: ,10 --></weights>
<weights>20,20,10,10,10,10,10,10</weights>
</work>
</works>

Expand All @@ -52,10 +52,8 @@
<transactiontype>
<name>DeleteItem</name>
</transactiontype>
<!-- FIXME:
<transactiontype>
<name>InsertItem</name>
</transactiontype>
-->
</transactiontypes>
</parameters>
4 changes: 1 addition & 3 deletions config/postgres/sample_templated_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<work>
<time>10</time>
<rate>100</rate>
<weights>20,20,10,10,10,10,10<!-- FIXME: ,10 --></weights>
<weights>20,20,10,10,10,10,10,10</weights>
</work>
</works>

Expand All @@ -52,10 +52,8 @@
<transactiontype>
<name>DeleteItem</name>
</transactiontype>
<!-- FIXME:
<transactiontype>
<name>InsertItem</name>
</transactiontype>
-->
</transactiontypes>
</parameters>
4 changes: 1 addition & 3 deletions config/sqlite/sample_templated_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<work>
<time>10</time>
<rate>100</rate>
<weights>20,20,10,10,10,10,10<!-- FIXME: ,10 --></weights>
<weights>20,20,10,10,10,10,10,10</weights>
</work>
</works>

Expand All @@ -49,10 +49,8 @@
<transactiontype>
<name>DeleteItem</name>
</transactiontype>
<!-- FIXME:
<transactiontype>
<name>InsertItem</name>
</transactiontype>
-->
</transactiontypes>
</parameters>
4 changes: 1 addition & 3 deletions config/sqlserver/sample_templated_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<work>
<time>10</time>
<rate>100</rate>
<weights>20,20,10,10,10,10,10<!-- FIXME: ,10 --></weights>
<weights>20,20,10,10,10,10,10,10</weights>
</work>
</works>

Expand All @@ -52,10 +52,8 @@
<transactiontype>
<name>DeleteItem</name>
</transactiontype>
<!-- FIXME:
<transactiontype>
<name>InsertItem</name>
</transactiontype>
-->
</transactiontypes>
</parameters>
22 changes: 13 additions & 9 deletions data/templated/example.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,23 +79,27 @@
<value>255.0</value>
</values>
</template>
<!-- FIXME: This results in primary key failures due to duplicate keys.
<template name="InsertItem">
<query><![CDATA[INSERT INTO item VALUES(?,?,?,?,?)]]></query>
<query><![CDATA[INSERT INTO history VALUES(?,?,?,?,?,?,?,?)]]></query>
<types>
<type>INTEGER</type>
<type>VARCHAR</type>
<type>INTEGER</type>
<type>INTEGER</type>
<type>INTEGER</type>
<type>INTEGER</type>
<type>TIMESTAMP</type>
<type>FLOAT</type>
<type>VARCHAR</type>
<type>INTEGER</type>
</types>
<values>
<value>100001</value>
<value>Testname</value>
<value>255.1</value>
<value>Testdata</value>
<value>1</value>
<value>1</value>
<value>1</value>
<value>1</value>
<value>1</value>
<value>2022-10-10 11:30:30</value>
<value>1.0</value>
<value>Test</value>
</values>
</template>
-->
</templates>

0 comments on commit febe379

Please sign in to comment.