matthiasblaesing commented on a change in pull request #2010: [NETBEANS-1603]
MySQL Procedures in DB Explorer
URL: https://github.com/apache/netbeans/pull/2010#discussion_r391246264
##########
File path: ide/db/src/org/netbeans/modules/db/explorer/node/ProcedureNode.java
##########
@@ -336,39 +337,48 @@ public String getSource() {
String source = "";
try {
String query = "";
- String escapedName = "";
+ String escapedName = getName().replace("'", "''");
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();
- ResultSet rs = stat.executeQuery(query);) {
+ 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) AS routine_params" // NOI18N
Review comment:
The ordering is needed for the subquery to `information_schema.parameters`.
I suspect, that the DB server will always return parameters in the natural
order, but if it is not guaranteed an order by will give the safety.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists