Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yoku0825/ec783f4f2b6350a860c4736ad4739d16 to your computer and use it in GitHub Desktop.
Save yoku0825/ec783f4f2b6350a860c4736ad4739d16 to your computer and use it in GitHub Desktop.
`DROP DATABASE` needs Super_priv patch based on MySQL 5.6.16
*** sql/sql_db.cc.orig 2014-01-15 00:38:00.000000000 +0900
--- sql/sql_db.cc 2014-02-28 17:13:19.383810416 +0900
***************
*** 44,49 ****
--- 44,51 ----
#endif
#include "debug_sync.h"
+ #include "sql_parse.h" // check_global_access
+
#define MAX_DROP_TABLE_Q_LEN 1024
const char *del_exts[]= {".frm", ".BAK", ".TMD", ".opt", ".OLD", NullS};
***************
*** 772,777 ****
--- 774,782 ----
bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
{
+ if (check_global_access(thd, SUPER_ACL))
+ DBUG_RETURN(0);
+
ulong deleted_tables= 0;
bool error= true;
char path[2 * FN_REFLEN + 16];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment