Commit a8f1b221 authored by Romain Courteaud's avatar Romain Courteaud Committed by Rafael Monnerat

slapos_mysql_innodb_catalog: use REPLACE to update consistency table

Only one line is used per document.
Using REPLACE is better than DELETE / INSERT.
parent 76c536e1
DELETE FROM REPLACE INTO
consistency
WHERE
<dtml-in uid>
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
</dtml-in>
;
<dtml-var "'\0'">
INSERT INTO
consistency consistency
(`uid`, `consistency_error`)
VALUES VALUES
<dtml-in prefix="loop" expr="_.range(_.len(uid))"> <dtml-in prefix="loop" expr="_.range(_.len(uid))">
( (
<dtml-sqlvar expr="uid[loop_item]" type="int">, <dtml-sqlvar expr="uid[loop_item]" type="int">,
<dtml-sqlvar expr="int(len(checkConsistency[loop_item]) > 0)" type="int"> <dtml-sqlvar expr="int(len(checkConsistency[loop_item]) > 0)" type="int">
) )
<dtml-if sequence-end><dtml-else>,</dtml-if> <dtml-if sequence-end>
<dtml-else>
,
</dtml-if>
</dtml-in> </dtml-in>
...@@ -43,13 +43,13 @@ checkConsistency</string> </value> ...@@ -43,13 +43,13 @@ checkConsistency</string> </value>
</item> </item>
<item> <item>
<key> <string>expression</string> </key> <key> <string>expression</string> </key>
<value> <string>python: context.getPortalType() in ["Sale Invoice Transaction", "Subscription Request"]</string> </value> <value> <string>python: context.getRelativeUrl().count(\'/\') == 1</string> </value>
</item> </item>
<item> <item>
<key> <string>expression_cache_key</string> </key> <key> <string>expression_cache_key</string> </key>
<value> <value>
<tuple> <tuple>
<string>portal_type</string> <string>relative_url</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
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