|
18 | 18 | -- PLEASE SUBMIT A PULL REQUEST TO https://github.com/MarkLeith/mysql-sys |
19 | 19 | -- |
20 | 20 |
|
21 | | -REPLACE INTO mysql.user VALUES ('localhost','mysql.sys','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','Y','N','','','','',0,0,0,0,'mysql_native_password','*THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE','N',CURRENT_TIMESTAMP,NULL,'Y'); |
| 21 | +REPLACE INTO mysql.user VALUES ('localhost','mysql.sys','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0,0,'mysql_native_password','*THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE','N',CURRENT_TIMESTAMP,NULL,'Y'); |
| 22 | + |
| 23 | +REPLACE INTO mysql.db VALUES ('localhost','sys','mysql.sys','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','Y'); |
22 | 24 |
|
23 | 25 | REPLACE INTO mysql.tables_priv VALUES ('localhost','sys','mysql.sys','sys_config','root@localhost', CURRENT_TIMESTAMP, 'Select', ''); |
24 | 26 |
|
| 27 | +FLUSH PRIVILEGES; |
| 28 | + |
25 | 29 | SET NAMES utf8; |
26 | 30 |
|
27 | 31 | CREATE DATABASE IF NOT EXISTS sys DEFAULT CHARACTER SET utf8; |
@@ -330,7 +334,7 @@ CREATE DEFINER='mysql.sys'@'localhost' PROCEDURE create_synonym_db ( IN in_db_na |
330 | 334 |
|
331 | 335 | DROP PROCEDURE IF EXISTS execute_prepared_stmt; |
332 | 336 |
|
333 | | -CREATE DEFINER='mysql.sys'@'localhost' PROCEDURE execute_prepared_stmt ( IN in_query longtext CHARACTER SET UTF8 ) COMMENT '\n Description\n \n Takes the query in the argument and executes it using a prepared statement. The prepared statement is deallocated,\n so the procdure is mainly useful for executing one off dynamically created queries.\n \n The sys_execute_prepared_stmt prepared statement name is used for the query and is required not to exist.\n \n \n Parameters\n \n in_query (longtext CHARACTER SET UTF8):\n The query to execute.\n \n \n Configuration Options\n \n sys.debug\n Whether to provide debugging output.\n Default is ''OFF''. Set to ''ON'' to include.\n \n \n Example\n \n mysql> CALL sys.execute_prepared_stmt(''SELECT * FROM sys.sys_config'');\n +------------------------+-------+---------------------+--------+\n | variable | value | set_time | set_by |\n +------------------------+-------+---------------------+--------+\n | statement_truncate_len | 64 | 2015-06-30 13:06:00 | NULL |\n +------------------------+-------+---------------------+--------+\n 1 row in set (0.00 sec)\n \n Query OK, 0 rows affected (0.00 sec)\n ' SQL SECURITY INVOKER NOT DETERMINISTIC READS SQL DATA BEGIN IF (@sys.debug IS NULL) THEN SET @sys.debug = sys.sys_get_config('debug', 'OFF'); END IF; IF (in_query IS NULL OR LENGTH(in_query) < 4) THEN SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = "The @sys.execute_prepared_stmt.sql must contain a query"; END IF; SET @sys.execute_prepared_stmt.sql = in_query; IF (@sys.debug = 'ON') THEN SELECT @sys.execute_prepared_stmt.sql AS 'Debug'; END IF; PREPARE sys_execute_prepared_stmt FROM @sys.execute_prepared_stmt.sql; EXECUTE sys_execute_prepared_stmt; DEALLOCATE PREPARE sys_execute_prepared_stmt; SET @sys.execute_prepared_stmt.sql = NULL; END; |
| 337 | +CREATE DEFINER='mysql.sys'@'localhost' PROCEDURE execute_prepared_stmt ( IN in_query longtext CHARACTER SET UTF8 ) COMMENT '\n Description\n \n Takes the query in the argument and executes it using a prepared statement. The prepared statement is deallocated,\n so the procedure is mainly useful for executing one off dynamically created queries.\n \n The sys_execute_prepared_stmt prepared statement name is used for the query and is required not to exist.\n \n \n Parameters\n \n in_query (longtext CHARACTER SET UTF8):\n The query to execute.\n \n \n Configuration Options\n \n sys.debug\n Whether to provide debugging output.\n Default is ''OFF''. Set to ''ON'' to include.\n \n \n Example\n \n mysql> CALL sys.execute_prepared_stmt(''SELECT * FROM sys.sys_config'');\n +------------------------+-------+---------------------+--------+\n | variable | value | set_time | set_by |\n +------------------------+-------+---------------------+--------+\n | statement_truncate_len | 64 | 2015-06-30 13:06:00 | NULL |\n +------------------------+-------+---------------------+--------+\n 1 row in set (0.00 sec)\n \n Query OK, 0 rows affected (0.00 sec)\n ' SQL SECURITY INVOKER NOT DETERMINISTIC READS SQL DATA BEGIN IF (@sys.debug IS NULL) THEN SET @sys.debug = sys.sys_get_config('debug', 'OFF'); END IF; IF (in_query IS NULL OR LENGTH(in_query) < 4) THEN SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = "The @sys.execute_prepared_stmt.sql must contain a query"; END IF; SET @sys.execute_prepared_stmt.sql = in_query; IF (@sys.debug = 'ON') THEN SELECT @sys.execute_prepared_stmt.sql AS 'Debug'; END IF; PREPARE sys_execute_prepared_stmt FROM @sys.execute_prepared_stmt.sql; EXECUTE sys_execute_prepared_stmt; DEALLOCATE PREPARE sys_execute_prepared_stmt; SET @sys.execute_prepared_stmt.sql = NULL; END; |
334 | 338 |
|
335 | 339 | DROP PROCEDURE IF EXISTS diagnostics; |
336 | 340 |
|
|
0 commit comments