subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1860551 - /subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c
Date Mon, 03 Jun 2019 11:13:07 GMT
Author: rhuijben
Date: Mon Jun  3 11:13:06 2019
New Revision: 1860551

URL: http://svn.apache.org/viewvc?rev=1860551&view=rev
Log:
Update Sqlite query parsing code in wc-queries-test to handle some new
intermediate explanation lines without warnings.

* subversion/tests/libsvn_wc/wc-queries-test.c
  (explanation_item): Add some booleans.
  (parse_explanation_item): Allow a few more constructs that caused
    unneeded warnings.

Modified:
    subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c

Modified: subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c?rev=1860551&r1=1860550&r2=1860551&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c Mon Jun  3 11:13:06 2019
@@ -267,6 +267,14 @@ struct explanation_item
   const char *compound_right;
   svn_boolean_t create_btree;
 
+  svn_boolean_t create_union;
+  svn_boolean_t union_all;
+
+  svn_boolean_t merge;
+
+  svn_boolean_t multi_index;
+  svn_boolean_t multi_index_or;
+
   int expression_vars;
   int expected_rows;
 };
@@ -313,6 +321,18 @@ parse_explanation_item(struct explanatio
           item->table = apr_psprintf(result_pool, "SUBQUERY-%s",
                                      apr_strtok(NULL, " ", &last));
         }
+      else if (MATCH_TOKEN(token, "CONSTANT"))
+        {
+          item->table = "sqlite_master"; /* not worth checking. 
+                                            Just a lookup */
+          token = apr_strtok(NULL, " ", &last);
+          if (!MATCH_TOKEN(token, "ROW"))
+            {
+              printf("DBG: Expected 'ROW', got '%s' in '%s'\n",
+                     token, text);
+              return SVN_NO_ERROR;
+            }
+        }
       else
         {
           printf("DBG: Expected 'TABLE', got '%s' in '%s'\n", token, text);
@@ -434,39 +454,44 @@ parse_explanation_item(struct explanatio
       /* Handling temporary table (E.g. UNION) */
 
       token = apr_strtok(NULL, " ", &last);
-      if (!MATCH_TOKEN(token, "SUBQUERIES"))
-        {
-          printf("DBG: Expected 'SUBQUERIES', got '%s' in '%s'\n", token,
-                 text);
-          return SVN_NO_ERROR;
-        }
-
-      item->compound_left = apr_strtok(NULL, " ", &last);
-      token = apr_strtok(NULL, " ", &last);
-
-      if (!MATCH_TOKEN(token, "AND"))
-        {
-          printf("DBG: Expected 'AND', got '%s' in '%s'\n", token, text);
-          return SVN_NO_ERROR;
-        }
-
-      item->compound_right = apr_strtok(NULL, " ", &last);
-
-      token = apr_strtok(NULL, " ", &last);
-      if (MATCH_TOKEN(token, "USING"))
+      if (MATCH_TOKEN(token, "SUBQUERIES"))
         {
+          item->compound_left = apr_strtok(NULL, " ", &last);
           token = apr_strtok(NULL, " ", &last);
-          if (!MATCH_TOKEN(token, "TEMP"))
+
+          if (!MATCH_TOKEN(token, "AND"))
             {
-              printf("DBG: Expected 'TEMP', got '%s' in '%s'\n", token, text);
+              printf("DBG: Expected 'AND', got '%s' in '%s'\n", token, text);
+              return SVN_NO_ERROR;
             }
+
+          item->compound_right = apr_strtok(NULL, " ", &last);
+
           token = apr_strtok(NULL, " ", &last);
-          if (!MATCH_TOKEN(token, "B-TREE"))
+          if (MATCH_TOKEN(token, "USING"))
             {
-              printf("DBG: Expected 'B-TREE', got '%s' in '%s'\n", token,
-                     text);
+              token = apr_strtok(NULL, " ", &last);
+              if (!MATCH_TOKEN(token, "TEMP"))
+                {
+                  printf("DBG: Expected 'TEMP', got '%s' in '%s'\n", token, text);
+                }
+              token = apr_strtok(NULL, " ", &last);
+              if (!MATCH_TOKEN(token, "B-TREE"))
+                {
+                  printf("DBG: Expected 'B-TREE', got '%s' in '%s'\n", token,
+                         text);
+                }
+              item->create_btree = TRUE;
             }
-          item->create_btree = TRUE;
+        }
+      else if (MATCH_TOKEN(token, "QUERY"))
+        {
+        }
+      else
+        {
+          printf("DBG: Expected 'SUBQUERIES', got '%s' in '%s'\n", token,
+                 text);
+          return SVN_NO_ERROR;
         }
     }
   else if (MATCH_TOKEN(item->operation, "USE"))
@@ -475,6 +500,48 @@ parse_explanation_item(struct explanatio
       /* ### Need parsing */
       item->create_btree = TRUE;
     }
+  else if (MATCH_TOKEN(item->operation, "UNION"))
+    {
+      item->create_union = TRUE;
+
+      token = apr_strtok(NULL, " ", &last);
+      if (MATCH_TOKEN(token, "ALL"))
+        item->union_all = TRUE;
+      else
+        item->union_all = FALSE;
+    }
+  else if (MATCH_TOKEN(item->operation, "INDEX"))
+    {
+      
+    }
+  else if (MATCH_TOKEN(item->operation, "MULTI-INDEX"))
+    {
+      item->multi_index = TRUE;
+      token = apr_strtok(NULL, " ", &last);
+      if (MATCH_TOKEN(token, "OR"))
+        item->multi_index_or = TRUE;
+    }
+  else if (MATCH_TOKEN(item->operation, "MERGE"))
+    {
+      item->merge = TRUE;
+    }
+  else if (MATCH_TOKEN(item->operation, "LEFT")
+           || MATCH_TOKEN(item->operation, "RIGHT"))
+    {
+    }
+  else if (MATCH_TOKEN(item->operation, "CORRELATED"))
+    {
+      item->merge = TRUE;
+    }
+  else if (MATCH_TOKEN(item->operation, "CO-ROUTINE"))
+    {
+    }
+  else if (MATCH_TOKEN(item->operation, "SCALAR"))
+    {      
+    }
+  else if (MATCH_TOKEN(item->operation, "LEFT-MOST"))
+    {
+    }
   else
     {
       printf("DBG: Unhandled sqlite operation '%s' in explanation\n", item->operation);



Mime
View raw message