deactivate the calling of a procedure (for now), needs more research

This commit is contained in:
Marc Delisle
2007-03-20 23:19:14 +00:00
parent c2d495c530
commit 4d6b70a52a
2 changed files with 18 additions and 12 deletions

View File

@@ -30,8 +30,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
+ [upload] make use of $cfg['TempDir'] for file uploads + [upload] make use of $cfg['TempDir'] for file uploads
+ [server] improved display of binary logs + [server] improved display of binary logs
+ [data] better error handling in tbl_create.php + [data] better error handling in tbl_create.php
+ [routines] from Patch #1649881, thanks to Mike Beck; work in progress... + [routines] from Patch #1649881, thanks to Mike Beck
(still to do: support definer; procedure execution)
2.10.1.0 (not released yet) 2.10.1.0 (not released yet)
===================== =====================

View File

@@ -5,9 +5,18 @@
* @version $Id$ * @version $Id$
*/ */
/** /**
* Check parameters * @todo Support seeing the "results" of the called procedure or
* * function. This needs further reseach because a procedure
* does not necessarily contain a SELECT statement that
* produces something to see. But it seems we could at least
* get the number of rows affected. We would have to
* use the CLIENT_MULTI_RESULTS flag to get the result set
* and also the call status. All this does not fit well with
* our current sql.php.
* Of course the interface would need a way to pass calling parameters.
* Also, support DEFINER (like we do in export).
*/ */
if ( PMA_MYSQL_INT_VERSION >= 50002 ) { if ( PMA_MYSQL_INT_VERSION >= 50002 ) {
$url_query .= '&goto=db_structure.php'; $url_query .= '&goto=db_structure.php';
@@ -20,7 +29,6 @@ if ( PMA_MYSQL_INT_VERSION >= 50002 ) {
<th>%s</th> <th>%s</th>
<th>&nbsp;</th> <th>&nbsp;</th>
<th>&nbsp;</th> <th>&nbsp;</th>
<th>&nbsp;</th>
<th>%s</th> <th>%s</th>
<th>%s</th> <th>%s</th>
</tr>', </tr>',
@@ -39,17 +47,17 @@ if ( PMA_MYSQL_INT_VERSION >= 50002 ) {
$routine['SPECIFIC_NAME']); $routine['SPECIFIC_NAME']);
$definition = PMA_DBI_fetch_value($sql); $definition = PMA_DBI_fetch_value($sql);
if ($routine['ROUTINE_TYPE'] == 'PROCEDURE') { //if ($routine['ROUTINE_TYPE'] == 'PROCEDURE') {
$sqlUseProc = 'CALL ' . $routine['SPECIFIC_NAME'] . '()'; // $sqlUseProc = 'CALL ' . $routine['SPECIFIC_NAME'] . '()';
} else { //} else {
$sqlUseProc = 'SELECT ' . $routine['SPECIFIC_NAME'] . '()'; // $sqlUseProc = 'SELECT ' . $routine['SPECIFIC_NAME'] . '()';
/* this won't get us far: to really use the function /* this won't get us far: to really use the function
i'd need to know how many parameters the function needs and then create i'd need to know how many parameters the function needs and then create
something to ask for them. As i don't see this directly in something to ask for them. As i don't see this directly in
the table i am afraid that requires parsing the ROUTINE_DEFINITION the table i am afraid that requires parsing the ROUTINE_DEFINITION
and i don't really need that now so i simply don't offer and i don't really need that now so i simply don't offer
a method for running the function*/ a method for running the function*/
} //}
if ($routine['ROUTINE_TYPE'] == 'PROCEDURE') { if ($routine['ROUTINE_TYPE'] == 'PROCEDURE') {
$sqlDropProc = 'DROP PROCEDURE ' . $routine['SPECIFIC_NAME']; $sqlDropProc = 'DROP PROCEDURE ' . $routine['SPECIFIC_NAME'];
} else { } else {
@@ -61,12 +69,11 @@ if ( PMA_MYSQL_INT_VERSION >= 50002 ) {
<td>%s</td> <td>%s</td>
<td>%s</td> <td>%s</td>
<td>%s</td> <td>%s</td>
<td>%s</td>
</tr>', </tr>',
($ct%2 == 0) ? 'even' : 'odd', ($ct%2 == 0) ? 'even' : 'odd',
$routine['ROUTINE_NAME'], $routine['ROUTINE_NAME'],
! empty($definition) ? '<a href="db_sql.php?' . $url_query . '&amp;sql_query=' . urlencode($definition) . '&amp;show_query=1&amp;delimiter=' . urlencode($delimiter) . '">' . $titles['Structure'] . '</a>' : '&nbsp;', ! empty($definition) ? '<a href="db_sql.php?' . $url_query . '&amp;sql_query=' . urlencode($definition) . '&amp;show_query=1&amp;delimiter=' . urlencode($delimiter) . '">' . $titles['Structure'] . '</a>' : '&nbsp;',
$routine['ROUTINE_TYPE'] == 'PROCEDURE' ? '<a href="sql.php?' . $url_query . '&sql_query=' . urlencode($sqlUseProc) . '">' . $titles['Browse'] . '</a>' : '&nbsp;', //$routine['ROUTINE_TYPE'] == 'PROCEDURE' ? '<a href="sql.php?' . $url_query . '&sql_query=' . urlencode($sqlUseProc) . '">' . $titles['Browse'] . '</a>' : '&nbsp;',
'<a href="sql.php?' . $url_query . '&sql_query=' . urlencode($sqlDropProc) . '" onclick="return confirmLink(this, \'' . PMA_jsFormat($sqlDropProc, false) . '\')">' . $titles['Drop'] . '</a>', '<a href="sql.php?' . $url_query . '&sql_query=' . urlencode($sqlDropProc) . '" onclick="return confirmLink(this, \'' . PMA_jsFormat($sqlDropProc, false) . '\')">' . $titles['Drop'] . '</a>',
$routine['ROUTINE_TYPE'], $routine['ROUTINE_TYPE'],
$routine['DTD_IDENTIFIER']); $routine['DTD_IDENTIFIER']);