List:Commits« Previous MessageNext Message »
From:rburnett Date:September 4 2008 7:52pm
Subject:Connector/NET commit: r1400 - in trunk: MySql.Data/Provider/Source MySql.VisualStudio/DDEX
View as plain text  
Modified:
   trunk/MySql.Data/Provider/Source/ISSchemaProvider.cs
   trunk/MySql.VisualStudio/DDEX/MySqlDataObjectSupport.xml
   trunk/MySql.VisualStudio/DDEX/MySqlDataViewSupport.xml
Log:
fixed problem with stored procedure and function enumeration in VS

Modified: trunk/MySql.Data/Provider/Source/ISSchemaProvider.cs
===================================================================
--- trunk/MySql.Data/Provider/Source/ISSchemaProvider.cs	2008-09-03 21:29:54 UTC (rev
1399)
+++ trunk/MySql.Data/Provider/Source/ISSchemaProvider.cs	2008-09-04 17:52:41 UTC (rev
1400)
@@ -258,15 +258,7 @@
 
         private DataTable GetParametersFromIS(string[] restrictions)
         {
-            StringBuilder sql = new StringBuilder(@"SELECT r.ROUTINE_TYPE, p.* FROM 
-                INFORMATION_SCHEMA.ROUTINES r, INFORMATION_SCHEMA.PARAMETERS p");
-            // if the user is not trying to restrict by routine type then we
-            // don't need the join.  However we understand that since 'PARAMETERS'
-            // isn't keyed to routines then we can't tell the difference between
-            // procedures and functions with the same name
-            if (restrictions == null || restrictions.Length < 4 ||
-                restrictions[3] == null)
-                sql = new StringBuilder("SELECT * FROM INFORMATION_SCHEMA.PARAMETERS");
+            StringBuilder sql = new StringBuilder(@"SELECT * FROM
INFORMATION_SCHEMA.PARAMETERS ");
 
             string[] keys = new string[5];
             keys[0] = "SPECIFIC_CATALOG";
@@ -313,6 +305,7 @@
                 dt.Columns.Add("CHARACTER_SET_NAME", typeof(string));
                 dt.Columns.Add("COLLATION_NAME", typeof(string));
                 dt.Columns.Add("DTD_IDENTIFIER", typeof(string));
+                dt.Columns.Add("ROUTINE_TYPE", typeof(string));
                 GetParametersFromShowCreate(dt, restrictions, routines);
 
                 return dt;
@@ -503,6 +496,7 @@
             parameter["SPECIFIC_NAME"] = procedure["ROUTINE_NAME"];
             parameter["PARAMETER_MODE"] = "IN";
             parameter["ORDINAL_POSITION"] = 0;
+            parameter["ROUTINE_TYPE"] = procedure["ROUTINE_TYPE"];
         }
 
         /// <summary>

Modified: trunk/MySql.VisualStudio/DDEX/MySqlDataObjectSupport.xml
===================================================================
--- trunk/MySql.VisualStudio/DDEX/MySqlDataObjectSupport.xml	2008-09-03 21:29:54 UTC (rev
1399)
+++ trunk/MySql.VisualStudio/DDEX/MySqlDataObjectSupport.xml	2008-09-04 17:52:41 UTC (rev
1400)
@@ -660,17 +660,17 @@
         <Concept name="FunctionParameter" restrictions="null, {Schema},
{StoredProcedure}, FUNCTION, {Name}" />
       </Concepts>
       <Identifier>
-        <Part name="Database" itemName="ROUTINE_CATALOG">
+        <Part name="Database" itemName="SPECIFIC_CATALOG">
           <Concepts>
             <Concept name="Identifier0" />
           </Concepts>
         </Part>
-        <Part name="Schema" itemName="ROUTINE_SCHEMA">
+        <Part name="Schema" itemName="SPECIFIC_SCHEMA">
           <Concepts>
             <Concept name="Identifier1" />
           </Concepts>
         </Part>
-        <Part name="StoredProcedure" itemName="ROUTINE_NAME">
+        <Part name="StoredProcedure" itemName="SPECIFIC_NAME">
           <Concepts>
             <Concept name="Identifier2" />
           </Concepts>
@@ -707,8 +707,7 @@
             </Concept>
           </Concepts>
         </Property>
-        <Property name="Flags" type="System.String" itemName="FLAGS"/>
-        <Property name="CharacterSet" type="System.String" itemName="CHARACTER_SET"
/>
+        <Property name="CharacterSet" type="System.String"
itemName="CHARACTER_SET_NAME" />
         <Property name="Length" type="System.Int32"
itemName="CHARACTER_MAXIMUM_LENGTH">
           <Concepts>
             <Concept name="Length"/>
@@ -729,16 +728,15 @@
           </Concepts>
         </Property>
         <Property name="Mode" type="System.String" itemName="PARAMETER_MODE"/>
-        <Property name="IsResult" type="System.String" itemName="IS_RESULT"/>
         <AggregatedConcepts>
           <!--
-            In order to correctly identify the direction of a parameter as required
-            by the Direction concept, we must use both the Mode and IsResult
-            properties.  Hence this is an aggregated concept.
+          In order to correctly identify the direction of a parameter as required
+          by the Direction concept, we must use both the Mode and IsResult
+          properties.  Hence this is an aggregated concept.
           -->
-          <AggregatedConcept name="Direction" fromData="IsResult, Mode">
+          <AggregatedConcept name="Direction" fromData="Ordinal,Mode">
             <Conversion>
-              <Calculate expr="IIF({0} =
'NO',IIF({1}='IN','IN',IIF({1}='OUT','OUT','IN/OUT')),'RETVAL')"
type="System.String"/>
+              <Calculate expr="IIF({0} =
'0','RETVAL',IIF({1}='IN','IN',IIF({1}='OUT','OUT','IN/OUT')))" type="System.String"/>
             </Conversion>
           </AggregatedConcept>
         </AggregatedConcepts>
@@ -917,7 +915,8 @@
     <Type name="Index" defaultSort="Schema,Table,Name">
       <Concepts>
         <Concept name="TableIndex" restrictions="null,{Schema},{Table},{Name}"/>
-        <Concept name="TableUniqueKey" restrictions="null,{Schema},{Table},{Name}"
filter="IsUnique = true"/>
+        <Concept name="TableUniqueKey" restrictions="null,{Schema},{Table},{Name}" 
+                 filter="IsUnique = true"/>
       </Concepts>
       <Identifier>
         <Part name="Catalog" itemName="INDEX_CATALOG">

Modified: trunk/MySql.VisualStudio/DDEX/MySqlDataViewSupport.xml
===================================================================
--- trunk/MySql.VisualStudio/DDEX/MySqlDataViewSupport.xml	2008-09-03 21:29:54 UTC (rev
1399)
+++ trunk/MySql.VisualStudio/DDEX/MySqlDataViewSupport.xml	2008-09-04 17:52:41 UTC (rev
1400)
@@ -205,10 +205,9 @@
             <SelectionNode nid="StoredProcedure">
               <Icon name="StoredProcedure" />
               <Children>
-                <Selection type="StoredProcedureParameter" 
+                <Selection type="StoredProcedureParameter"
                           
restrictions="null,{StoredProcedure.Database},{StoredProcedure.Name},PROCEDURE">
                   <SelectionNode>
-                    <Icon when="{IsResult} = 'YES'" name="ReturnValue" />
                     <Icon when="{Mode} = 'IN'" name="InputParameter" />
                     <Icon when="{Mode} = 'OUT'" name="OutputParameter" />
                     <Icon when="{Mode} = 'INOUT'" name="OutputParameter" />
@@ -251,12 +250,16 @@
           </CommandBinding>
         </CommandBindings>
         <Children>
-          <Selection type="StoredProcedure"
restrictions="{Root.Database},{Root.Schema},null,FUNCTION" minSourceVersion="5.0.0">
+          <Selection type="StoredProcedure" 
+                     restrictions="{Root.Database},{Root.Schema},null,FUNCTION" 
+                     minSourceVersion="5.0.0">
             <SelectionNode nid="StoredFunction">
               <Icon name="ScalarValuedFunction" />
               <Children>
-                <Selection type="StoredProcedureParameter"
restrictions="{StoredProcedure.Database},{StoredProcedure.Schema},{StoredProcedure.Name},FUNCTION"
minSourceVersion="5.0.0">
-                  <SelectionNode hideWhen="true">
+                <Selection type="StoredProcedureParameter" 
+                          
restrictions="null,{StoredFunction.Database},{StoredFunction.Name},FUNCTION" 
+                           filter="Ordinal > 0">
+                  <SelectionNode>
                     <Icon when="{IsResult} = 'YES'" name="ReturnValue" />
                     <Icon when="{Mode} = 'IN'" name="InputParameter" />
                     <Icon when="{Mode} = 'OUT'" name="OutputParameter" />
@@ -1063,11 +1066,6 @@
           <Category resource="Category_DataType" />
           <Description resource="Description_Object_MySqlType" />
         </Property>
-        <Property name="Flags">
-          <DisplayName resource="DisplayName_Object_Flags" />
-          <Category resource="Category_DataType" />
-          <Description resource="Description_Object_Flags" />
-        </Property>
         <Property name="CharacterSet">
           <DisplayName resource="DisplayName_Object_CharacterSet" />
           <Category resource="Category_DataType" />
@@ -1098,15 +1096,6 @@
             <StandardValue value="INOUT" resource="Value_INOUT" />
           </StandardValues>
         </Property>
-        <Property name="IsResult">
-          <DisplayName resource="DisplayName_Parameter_IsResult" />
-          <Category resource="Category_Base" />
-          <Description resource="Description_Parameter_IsResult" />
-          <StandardValues>
-            <StandardValue value="YES" resource="Value_Yes" />
-            <StandardValue value="NO" resource="Value_No" />
-          </StandardValues>
-        </Property>
       </Properties>
       <CommandBindings>
         <!-- global data menus -->

Thread
Connector/NET commit: r1400 - in trunk: MySql.Data/Provider/Source MySql.VisualStudio/DDEXrburnett4 Sep