[Lsb-messages] /var/www/bzr/lsb/devel/dbadmin r270: Improve Standard table checkers

Denis Silakov denis.silakov at rosalab.ru
Tue Jan 15 11:26:08 UTC 2013


------------------------------------------------------------
revno: 270
committer: Denis Silakov <denis.silakov at rosalab.ru>
branch nick: dbadmin
timestamp: Tue 2013-01-15 15:26:08 +0400
message:
  Improve Standard table checkers
modified:
  consistency/consistency.inc
  consistency/foreign_keys.php
-------------- next part --------------
=== modified file 'consistency/consistency.inc'
--- a/consistency/consistency.inc	2013-01-12 13:45:33 +0000
+++ b/consistency/consistency.inc	2013-01-15 11:26:08 +0000
@@ -58,7 +58,7 @@
     print("<h1>'Appearence' Fields Consistency</h1>\n");
     $arr = array('AbiApi', 'ArchClass', 'ArchConst', 'ArchDE', 'ArchES', 'ArchType', 'ArchInt',
                  'ArchLib', 'CmdStd', 'Header', 'IntStd', 'InterpretedLanguage', 'InterpretedLanguageModule', 'SModCmd',
-                 'SModLib', 'ModSMod', 'RpmTag', 'Standard', 'TestSuite');
+                 'SModLib', 'SModStd', 'ModSMod', 'RpmTag', 'Standard', 'TestSuite');
     $sum = 0;
     for($i=0; $i<count($arr); $i++) {
         $prefix = preg_replace("/[a-z]/","",$arr[$i]);
@@ -93,7 +93,7 @@
     // Check situations when we have several records for the same element with 'withdrawnin' field equals to NULL;
     // normally this means that one of such records has empty 'appeared' field, the other one has some value in it
     // A tricky question is to guess which fields we should group by; let's take first two fields from the table
-    // (with known exceptions for ArchInt and ArchClass); it would be better to use some unique key instead
+    // (with known exceptions for ArchInt, ArchClass and Standard); it would be better to use some unique key instead
     $title = "Several non-Withdrawn Entries for the Same Entity";
     print("<h1>$title</h1>\n");
     print("<h2>The following tables contain several records for the same entity with withdrawnin field equals to NULL</h2>");
@@ -125,6 +125,9 @@
         else if ($arr[$i] == "ArchClass") {
             $fields = "$fields,ACpos";
         }
+        else if ($arr[$i] == "Standard") {
+            $fields = "Stag";
+        }
 
         $prefix = preg_replace("/[a-z]/","",$arr[$i]);
         if ($arr[$i]=='RpmTag') {
@@ -135,6 +138,7 @@
 
         $query="SELECT $fields FROM $arr[$i]
                 WHERE $field_withdrawn IS NULL
+                AND $field_appeared > ''
                 GROUP BY $fields
                 HAVING COUNT($field_appeared) > 1";
         $res = Query($query);
@@ -148,7 +152,9 @@
             foreach ($res as $row) {
                 print("<tr>\n");
                 print("<td>".$row[$fields_array[0]]."</td>");
-                print("<td>".$row[$fields_array[1]]."</td>");
+                if ($arr[$i] != "Standard") {
+        	    print("<td>".$row[$fields_array[1]]."</td>");
+        	}
                 print("</tr>\n");
             }
             print("</table>\n");

=== modified file 'consistency/foreign_keys.php'
--- a/consistency/foreign_keys.php	2012-03-23 12:37:45 +0000
+++ b/consistency/foreign_keys.php	2013-01-15 11:26:08 +0000
@@ -82,6 +82,8 @@
     array('SModCmd', 'SMCcid', 'Command', 'Cid'),
     array('SModLib', 'SMLsmid', 'SubModule', 'SMid'),
     array('SModLib', 'SMLlid', 'Library', 'Lid'),
+    array('SModStd', 'SMSsmid', 'SubModule', 'SMid'),
+    array('SModStd', 'SMSsid', 'Standard', 'Sid'),
     array('ModSMod', 'MSMmid', 'Module', 'Mid'),
     array('ModSMod', 'MSMsmid', 'SubModule', 'SMid'),
     array('Parameter', 'Pint', 'Interface', 'Iid'),



More information about the lsb-messages mailing list