Commit 23abd822 authored by Sebastien Robin's avatar Sebastien Robin

updated SQLQueue zsql methods in order to support more validation


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1787 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 81a48125
......@@ -10,16 +10,20 @@ class_file:
<params></params>
CREATE TABLE `message_queue` (
`uid` int(11) NOT NULL auto_increment,
`date` datetime,
`path` VARCHAR(255),
`method_id` VARCHAR(40),
`processing_node` INT DEFAULT -1,
`processing` INT DEFAULT 0,
`processing_date` datetime,
`priority` INT DEFAULT 0,
`message` BLOB,
PRIMARY KEY (`uid`),
KEY `date` (`date`),
KEY `path` (`path`),
KEY `method_id` (`method_id`),
KEY `processing_node` (`processing_node`),
KEY `processing` (`processing`),
KEY `processing_date` (`processing_date`),
KEY `priority` (`priority`)
) TYPE = InnoDB;
......@@ -11,6 +11,7 @@ class_file:
UPDATE
message_queue
SET
processing_date = <dtml-sqlvar "_.DateTime()" type="string">,
processing=1
WHERE
uid = <dtml-sqlvar uid type="int">
......@@ -8,10 +8,15 @@ class_name:
class_file:
</dtml-comment>
<params>processing_node
priority</params>
priority
to_date</params>
SELECT * FROM
message_queue
WHERE
processing <> 1
<dtml-if processing_node> AND processing_node = <dtml-sqlvar processing_node type="int"></dtml-if>
<dtml-if priority> AND priority = <dtml-sqlvar priority type="int"> </dtml-if>
<dtml-if to_date> AND date <= <dtml-sqlvar to_date type="string"> </dtml-if>
ORDER BY
priority, date
......@@ -9,10 +9,12 @@ class_file:
</dtml-comment>
<params>processing_node
method_id
path</params>
path
to_date</params>
SELECT uid FROM
message_queue
WHERE
processing <> 1
<dtml-if processing_node> AND processing_node = <dtml-sqlvar processing_node type="int"></dtml-if>
<dtml-if path>AND path = <dtml-sqlvar path type="string"></dtml-if>
<dtml-if to_date>AND date <= <dtml-sqlvar to_date type="string"> </dtml-if>
......@@ -8,11 +8,13 @@ class_name:
class_file:
</dtml-comment>
<params>uid
priority</params>
priority
date</params>
UPDATE
message_queue
SET
priority = <dtml-sqlvar priority type="int">,
processing = 0
processing = 0,
date = <dtml-sqlvar date type="string">
WHERE
uid = <dtml-sqlvar uid type="int">
......@@ -10,10 +10,12 @@ class_file:
<params>path
method_id
message
priority</params>
priority
date</params>
INSERT INTO message_queue
SET
path = <dtml-sqlvar path type="string">,
<dtml-if date>date = <dtml-sqlvar date type="string">, <dtml-else>date = <dtml-sqlvar "_.DateTime()" type="string">, </dtml-if>
method_id = <dtml-sqlvar method_id type="string">,
processing_node = -1,
processing = -1,
......
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