[Erp5-report] r13734 - in /erp5/trunk/products/ERP5/bootstrap/erp5_mysql_innodb_catalog: Ca...

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Mar 28 10:12:31 CEST 2007


Author: vincent
Date: Wed Mar 28 10:12:30 2007
New Revision: 13734

URL: http://svn.erp5.org?rev=13734&view=rev
Log:
Add a new parameter controling the index increment.
Add default values on parameters to make the query backward-compatible (provided that arguments are not passed by position).
Wrap query line to make it more readable.

Modified:
    erp5/trunk/products/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_portal_ids_generate_id.xml
    erp5/trunk/products/ERP5/bootstrap/erp5_mysql_innodb_catalog/bt/revision

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_portal_ids_generate_id.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_portal_ids_generate_id.xml?rev=13734&r1=13733&r2=13734&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_portal_ids_generate_id.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_portal_ids_generate_id.xml Wed Mar 28 10:12:30 2007
@@ -37,6 +37,25 @@
                                 <value>
                                   <dictionary>
                                     <item>
+                                        <key> <string>default</string> </key>
+                                        <value> <string>1</string> </value>
+                                    </item>
+                                    <item>
+                                        <key> <string>type</string> </key>
+                                        <value> <string>int</string> </value>
+                                    </item>
+                                  </dictionary>
+                                </value>
+                            </item>
+                            <item>
+                                <key> <string>id_count</string> </key>
+                                <value>
+                                  <dictionary>
+                                    <item>
+                                        <key> <string>default</string> </key>
+                                        <value> <string>1</string> </value>
+                                    </item>
+                                    <item>
                                         <key> <string>type</string> </key>
                                         <value> <string>int</string> </value>
                                     </item>
@@ -56,8 +75,9 @@
                         <key> <string>_keys</string> </key>
                         <value>
                           <list>
-                            <string>id_group</string>
-                            <string>default</string>
+<string>id_group</string>
+<string>id_count</string>
+<string>default</string>
                           </list>
                         </value>
                     </item>
@@ -69,7 +89,8 @@
         <item>
             <key> <string>arguments_src</string> </key>
             <value> <string>id_group\r\n
-default:int</string> </value>
+id_count:int=1\r\n
+default:int=1</string> </value>
         </item>
         <item>
             <key> <string>connection_id</string> </key>
@@ -88,7 +109,12 @@
 \n
 BEGIN\n
 <dtml-var sql_delimiter>\n
-INSERT INTO portal_ids (`id_group`, `last_id`) VALUES (<dtml-sqlvar id_group type="string">, LAST_INSERT_ID(<dtml-sqlvar default type="int">)) ON DUPLICATE KEY UPDATE `last_id` = LAST_INSERT_ID(`last_id` + 1)\n
+INSERT INTO\n
+  portal_ids (`id_group`, `last_id`)\n
+VALUES\n
+  (<dtml-sqlvar id_group type="string">, LAST_INSERT_ID(<dtml-sqlvar default type="int">))\n
+ON DUPLICATE KEY UPDATE\n
+  `last_id` = LAST_INSERT_ID(`last_id` + <dtml-sqlvar id_count type="int">)\n
 <dtml-var sql_delimiter>\n
 SELECT LAST_INSERT_ID()
 
@@ -133,7 +159,12 @@
 \n
 BEGIN\n
 <dtml-var sql_delimiter>\n
-INSERT INTO portal_ids (`id_group`, `last_id`) VALUES (<dtml-sqlvar id_group type="string">, LAST_INSERT_ID(<dtml-sqlvar default type="int">)) ON DUPLICATE KEY UPDATE `last_id` = LAST_INSERT_ID(`last_id` + 1)\n
+INSERT INTO\n
+  portal_ids (`id_group`, `last_id`)\n
+VALUES\n
+  (<dtml-sqlvar id_group type="string">, LAST_INSERT_ID(<dtml-sqlvar default type="int">))\n
+ON DUPLICATE KEY UPDATE\n
+  `last_id` = LAST_INSERT_ID(`last_id` + <dtml-sqlvar id_count type="int">)\n
 <dtml-var sql_delimiter>\n
 SELECT LAST_INSERT_ID()
 

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_mysql_innodb_catalog/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_mysql_innodb_catalog/bt/revision?rev=13734&r1=13733&r2=13734&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_mysql_innodb_catalog/bt/revision (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_mysql_innodb_catalog/bt/revision Wed Mar 28 10:12:30 2007
@@ -1,1 +1,1 @@
-35
+36




More information about the Erp5-report mailing list