Commit fbfd8323 authored by Jérome Perrin's avatar Jérome Perrin

mysql_innodb_catalog: use INSERT after DELETE, not REPLACE

If rows have been deleted before, it's more natural to simply INSERT and
no need for REPLACE
parent 6f7fb01f
...@@ -13,7 +13,7 @@ WHERE ...@@ -13,7 +13,7 @@ WHERE
</dtml-if> </dtml-if>
</dtml-in> </dtml-in>
<dtml-if expr="_.len(movement_list) > 0"> <dtml-if expr="_.len(movement_list) > 0">
REPLACE INTO INSERT INTO
item item
VALUES VALUES
<dtml-in prefix="loop" expr="movement_list"> <dtml-in prefix="loop" expr="movement_list">
......
...@@ -9,7 +9,7 @@ DELETE FROM `measure` WHERE ...@@ -9,7 +9,7 @@ DELETE FROM `measure` WHERE
<dtml-if measure_list> <dtml-if measure_list>
<dtml-var sql_delimiter> <dtml-var sql_delimiter>
REPLACE INTO `measure` INSERT INTO `measure`
VALUES VALUES
<dtml-in measure_list prefix="loop"> <dtml-in measure_list prefix="loop">
( (
......
...@@ -14,7 +14,7 @@ WHERE ...@@ -14,7 +14,7 @@ WHERE
<dtml-call expr="category_list.append((uid[loop_item], uid_item[0], uid_item[1], uid_item[2]))"> <dtml-call expr="category_list.append((uid[loop_item], uid_item[0], uid_item[1], uid_item[2]))">
</dtml-in></dtml-if></dtml-let></dtml-if></dtml-in> </dtml-in></dtml-if></dtml-let></dtml-if></dtml-in>
<dtml-if expr="category_list"> <dtml-if expr="category_list">
REPLACE INTO category VALUES INSERT INTO category VALUES
<dtml-in prefix="loop" expr="category_list"> <dtml-in prefix="loop" expr="category_list">
(<dtml-sqlvar expr="loop_item[0]" type="int">, <dtml-sqlvar expr="loop_item[1]" type="int">, <dtml-sqlvar expr="loop_item[2]" type="int">, <dtml-sqlvar expr="loop_item[3]" type="int">)<dtml-if sequence-end><dtml-else>,</dtml-if> (<dtml-sqlvar expr="loop_item[0]" type="int">, <dtml-sqlvar expr="loop_item[1]" type="int">, <dtml-sqlvar expr="loop_item[2]" type="int">, <dtml-sqlvar expr="loop_item[3]" type="int">)<dtml-if sequence-end><dtml-else>,</dtml-if>
</dtml-in> </dtml-in>
......
...@@ -14,7 +14,7 @@ WHERE ...@@ -14,7 +14,7 @@ WHERE
<dtml-call expr="category_list.append((uid[loop_item], uid_item[0], uid_item[1], uid_item[2]))"> <dtml-call expr="category_list.append((uid[loop_item], uid_item[0], uid_item[1], uid_item[2]))">
</dtml-in></dtml-if></dtml-let></dtml-if></dtml-in> </dtml-in></dtml-if></dtml-let></dtml-if></dtml-in>
<dtml-if expr="category_list"> <dtml-if expr="category_list">
REPLACE INTO category VALUES INSERT INTO category VALUES
<dtml-in prefix="loop" expr="category_list"> <dtml-in prefix="loop" expr="category_list">
(<dtml-sqlvar expr="loop_item[0]" type="int">, <dtml-sqlvar expr="loop_item[1]" type="int">, <dtml-sqlvar expr="loop_item[2]" type="int">, <dtml-sqlvar expr="loop_item[3]" type="int">)<dtml-if sequence-end><dtml-else>,</dtml-if> (<dtml-sqlvar expr="loop_item[0]" type="int">, <dtml-sqlvar expr="loop_item[1]" type="int">, <dtml-sqlvar expr="loop_item[2]" type="int">, <dtml-sqlvar expr="loop_item[3]" type="int">)<dtml-if sequence-end><dtml-else>,</dtml-if>
</dtml-in> </dtml-in>
......
...@@ -14,7 +14,7 @@ WHERE ...@@ -14,7 +14,7 @@ WHERE
</dtml-if> </dtml-if>
</dtml-in> </dtml-in>
<dtml-if expr="_.len(predicate_list) > 0"> <dtml-if expr="_.len(predicate_list) > 0">
REPLACE INTO predicate_category VALUES INSERT INTO predicate_category VALUES
<dtml-in prefix="loop" expr="predicate_list"> <dtml-in prefix="loop" expr="predicate_list">
<dtml-if sequence-start><dtml-else>,</dtml-if> <dtml-if sequence-start><dtml-else>,</dtml-if>
<dtml-if "predicate_property_dict[loop_item].has_key('membership_criterion_category_list')"> <dtml-if "predicate_property_dict[loop_item].has_key('membership_criterion_category_list')">
......
...@@ -14,7 +14,7 @@ WHERE ...@@ -14,7 +14,7 @@ WHERE
</dtml-if> </dtml-if>
</dtml-in> </dtml-in>
<dtml-if expr="_.len(predicate_list) > 0"> <dtml-if expr="_.len(predicate_list) > 0">
REPLACE INTO predicate VALUES INSERT INTO predicate VALUES
<dtml-in prefix="loop" expr="predicate_list"> <dtml-in prefix="loop" expr="predicate_list">
<dtml-if sequence-start><dtml-else>,</dtml-if> <dtml-if sequence-start><dtml-else>,</dtml-if>
( (
......
...@@ -21,8 +21,7 @@ DELETE FROM `quantity_unit_conversion` WHERE ...@@ -21,8 +21,7 @@ DELETE FROM `quantity_unit_conversion` WHERE
<dtml-call "value_list.extend(loop_item.values())"> <dtml-call "value_list.extend(loop_item.values())">
</dtml-in> </dtml-in>
REPLACE INTO `quantity_unit_conversion` INSERT INTO `quantity_unit_conversion` VALUES
VALUES
<dtml-in "value_list" prefix="loop"> <dtml-in "value_list" prefix="loop">
( (
<dtml-sqlvar expr="loop_item['uid']" type="int" optional>, <dtml-sqlvar expr="loop_item['uid']" type="int" optional>,
......
...@@ -72,7 +72,7 @@ WHERE ...@@ -72,7 +72,7 @@ WHERE
</dtml-in> </dtml-in>
<dtml-if "row_list"> <dtml-if "row_list">
REPLACE INTO INSERT INTO
stock stock
( (
`uid`, `uid`,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment