You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/11/09 09:33:46 UTC

[GitHub] [netbeans] sbrbot opened a new pull request, #4945: [NETBEANS-1603] resolving the problem with (un)showing MySQL procedures in NetBeans IDE DB explorer

sbrbot opened a new pull request, #4945:
URL: https://github.com/apache/netbeans/pull/4945

   This commit resolves problem where NetBeans did not show MySQL procedures in IDE's internal DB explorer.
   
   
   ---
   **^Add meaningful description above**
   
   By opening a pull request you confirm that, unless explicitly stated otherwise, the changes -
   
    - are all your own work, and you have the right to contribute them.
    - are contributed solely under the terms and conditions of the Apache License 2.0 (see section 5 of the license for more information).
   
   Please make sure (eg. `git log`) that all commits have a valid name and email address for you in the Author field.
   
   If you're a first time contributor, see the Contributing guidelines for more information.
   
   If you're a committer, please label the PR before pressing "Create pull request" so that the right test jobs can run.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] matthiasblaesing closed pull request #4945: [NETBEANS-1603] resolving the problem with (un)showing MySQL procedures in NetBeans IDE DB explorer

Posted by GitBox <gi...@apache.org>.
matthiasblaesing closed pull request #4945: [NETBEANS-1603] resolving the problem with (un)showing MySQL procedures in NetBeans IDE DB explorer
URL: https://github.com/apache/netbeans/pull/4945


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] matthiasblaesing commented on a diff in pull request #4945: [NETBEANS-1603] resolving the problem with (un)showing MySQL procedures in NetBeans IDE DB explorer

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on code in PR #4945:
URL: https://github.com/apache/netbeans/pull/4945#discussion_r1019590246


##########
ide/db/src/org/netbeans/modules/db/explorer/node/ProcedureNode.java:
##########
@@ -336,39 +336,49 @@ public String getSource() {
             String source = "";
             try {
                 String query = "";
-                String escapedName = "";
+                String escapedName = getName().replace("'", "''"); // NOI18N
                 boolean function = false;
                 switch (getType()) {
                     case Function:
                         function = true;
                     case Procedure:
-                        escapedName = getName().replace("'", "''");
-                        query = "SELECT param_list, returns, body, db FROM mysql.proc WHERE name = '"
-                                + escapedName + "';"; // NOI18N
-                        try (Statement stat = connection.getJDBCConnection().createStatement();
+                        query = "SELECT routine_schema,routine_definition,dtd_identifier,is_deterministic,sql_data_access,routine_comment," // NOI18N
+                              + "(SELECT GROUP_CONCAT(CONCAT(" + (function ? "" : "parameter_mode,' ',") + "parameter_name,' ',dtd_identifier))" // NOI18N
+                              + " FROM information_schema.parameters" // NOI18N
+                              + " WHERE specific_name=routine_name AND ordinal_position>0 ORDER BY ordinal_position) AS routine_params" // NOI18N

Review Comment:
   ```suggestion
                                 + "IFNULL((SELECT GROUP_CONCAT(CONCAT(" + (function ? "" : "parameter_mode,' ',") + "parameter_name,' ',dtd_identifier))" // NOI18N
                                 + " FROM information_schema.parameters" // NOI18N
                                 + " WHERE specific_name=routine_name AND ordinal_position>0 ORDER BY ordinal_position), '') AS routine_params" // NOI18N
   ```
   
   If your procedure or function does not have a parameter the current code generates invalid code:
   
   ```
   DELIMITER @@
   DROP PROCEDURE GetAllProducts @@
   CREATE PROCEDURE test.GetAllProducts(null)
   CONTAINS SQL
   NOT DETERMINISTIC
   BEGIN
   	SELECT *  FROM t1;
   END @@ 
   DELIMITER ; 
   ```
   
   The `null` in line 3 is the problem.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] matthiasblaesing commented on pull request #4945: [NETBEANS-1603] resolving the problem with (un)showing MySQL procedures in NetBeans IDE DB explorer

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on PR #4945:
URL: https://github.com/apache/netbeans/pull/4945#issuecomment-1366189191

   @sbrbot this is getting stale - could you please have a look at the review comment?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists