1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-10 16:44:17 +02:00

Remove definer from routine and event

This commit is contained in:
Jakub Vrana
2012-08-09 09:39:12 -07:00
parent ca32e71e42
commit a4e38a266d
3 changed files with 11 additions and 3 deletions

View File

@@ -357,6 +357,14 @@ function drop_create($drop, $create, $location, $message_drop, $message_alter, $
return $dropped;
}
/** Remove current user definer from SQL command
* @param string
* @return string
*/
function remove_definer($query) {
return preg_replace('~^([A-Z =]+) DEFINER=`' . preg_replace('~@(.*)~', '`@`(%|\\1)', logged_user()) . '`~', '\\1', $query); //! proper escaping of user
}
/** Get string to add a file in TAR
* @param string
* @param string