log_bin_trust_function_creators
Dies ist einfach ein Ass in der Lücke bei der Migration von gespeicherten Prozeduren. Die DETERMINISTIC-Eigenschaft wurde zu zwei Dingen hinzugefügt:
- Schützen Sie die Konsistenz der aufgerufenen gespeicherten Prozeduren, die in Binärprotokollen gespeichert sind
- Sparen Sie Entwicklern die Kopfschmerzen beim Zurückgehen und Hinzufügen der Eigenschaft
Die Fehlermeldung hat einfach ihren hässlichen Kopf aufgerichtet, weil die binäre Protokollierung aktiviert ist und gespeicherte Prozeduren vorhanden sind. Deaktivieren Sie entweder die binäre Protokollierung und markieren Sie die gespeicherten Prozeduren als deterministisch.
Hier ist etwas schnelles und schmutziges, das Sie mit allen gespeicherten Prozeduren tun können, ohne die Skripte bearbeiten zu müssen: Aktualisieren Sie mysql.proc und tun Sie dies:
UPDATE mysql.proc SET is_deterministic = 'YES';
Ich habe es in MySQL 5.5.12 für Windows versucht
mysql> select db,name from mysql.proc;
+--------+-----------------------+
| db | name |
+--------+-----------------------+
| lovesh | LoadMyData |
| stuff | DoesUserHaveEditPrivs |
| stuff | LoadSampleData |
| stuff | MakeTables |
| stuff | ShowLast40 |
| test | CreateSampleTable |
| test | CreateSampleTables |
| test | GetMissingIntegers |
| test | GetTestTableCounts |
| test | ImportWeeklyBatch |
| test | InsertName |
| test | LoadSampleTables |
| test | MigrateColumn |
+--------+-----------------------+
13 rows in set (0.00 sec)
mysql> select db,name,is_deterministic from mysql.proc ;
+--------+-----------------------+------------------+
| db | name | is_deterministic |
+--------+-----------------------+------------------+
| test | InsertName | NO |
| test | MigrateColumn | NO |
| test | GetMissingIntegers | NO |
| test | CreateSampleTable | NO |
| test | CreateSampleTables | NO |
| test | LoadSampleTables | NO |
| test | ImportWeeklyBatch | NO |
| test | GetTestTableCounts | NO |
| stuff | MakeTables | NO |
| stuff | ShowLast40 | NO |
| stuff | LoadSampleData | NO |
| stuff | DoesUserHaveEditPrivs | NO |
| lovesh | LoadMyData | NO |
+--------+-----------------------+------------------+
13 rows in set (0.00 sec)
mysql> update mysql.proc set is_deterministic='YES' where db='lovesh';
Query OK, 1 row affected (0.02 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select db,name,is_deterministic from mysql.proc ;
+--------+-----------------------+------------------+
| db | name | is_deterministic |
+--------+-----------------------+------------------+
| test | InsertName | NO |
| test | MigrateColumn | NO |
| test | GetMissingIntegers | NO |
| test | CreateSampleTable | NO |
| test | CreateSampleTables | NO |
| test | LoadSampleTables | NO |
| test | ImportWeeklyBatch | NO |
| test | GetTestTableCounts | NO |
| stuff | MakeTables | NO |
| stuff | ShowLast40 | NO |
| stuff | LoadSampleData | NO |
| stuff | DoesUserHaveEditPrivs | NO |
| lovesh | LoadMyData | YES |
+--------+-----------------------+------------------+
13 rows in set (0.00 sec)
mysql> desc information_schema.routines;
+--------------------------+---------------+------+-----+---------------------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------------------+---------------+------+-----+---------------------+-------+
| SPECIFIC_NAME | varchar(64) | NO | | | |
| ROUTINE_CATALOG | varchar(512) | NO | | | |
| ROUTINE_SCHEMA | varchar(64) | NO | | | |
| ROUTINE_NAME | varchar(64) | NO | | | |
| ROUTINE_TYPE | varchar(9) | NO | | | |
| DATA_TYPE | varchar(64) | NO | | | |
| CHARACTER_MAXIMUM_LENGTH | int(21) | YES | | NULL | |
| CHARACTER_OCTET_LENGTH | int(21) | YES | | NULL | |
| NUMERIC_PRECISION | int(21) | YES | | NULL | |
| NUMERIC_SCALE | int(21) | YES | | NULL | |
| CHARACTER_SET_NAME | varchar(64) | YES | | NULL | |
| COLLATION_NAME | varchar(64) | YES | | NULL | |
| DTD_IDENTIFIER | longtext | YES | | NULL | |
| ROUTINE_BODY | varchar(8) | NO | | | |
| ROUTINE_DEFINITION | longtext | YES | | NULL | |
| EXTERNAL_NAME | varchar(64) | YES | | NULL | |
| EXTERNAL_LANGUAGE | varchar(64) | YES | | NULL | |
| PARAMETER_STYLE | varchar(8) | NO | | | |
| IS_DETERMINISTIC | varchar(3) | NO | | | |
| SQL_DATA_ACCESS | varchar(64) | NO | | | |
| SQL_PATH | varchar(64) | YES | | NULL | |
| SECURITY_TYPE | varchar(7) | NO | | | |
| CREATED | datetime | NO | | 0000-00-00 00:00:00 | |
| LAST_ALTERED | datetime | NO | | 0000-00-00 00:00:00 | |
| SQL_MODE | varchar(8192) | NO | | | |
| ROUTINE_COMMENT | longtext | NO | | NULL | |
| DEFINER | varchar(77) | NO | | | |
| CHARACTER_SET_CLIENT | varchar(32) | NO | | | |
| COLLATION_CONNECTION | varchar(32) | NO | | | |
| DATABASE_COLLATION | varchar(32) | NO | | | |
+--------------------------+---------------+------+-----+---------------------+-------+
30 rows in set (0.02 sec)
mysql> select * from information_schema.routines where routine_schema='lovesh'\G
*************************** 1. row ***************************
SPECIFIC_NAME: LoadMyData
ROUTINE_CATALOG: def
ROUTINE_SCHEMA: lovesh
ROUTINE_NAME: LoadMyData
ROUTINE_TYPE: PROCEDURE
DATA_TYPE:
CHARACTER_MAXIMUM_LENGTH: NULL
CHARACTER_OCTET_LENGTH: NULL
NUMERIC_PRECISION: NULL
NUMERIC_SCALE: NULL
CHARACTER_SET_NAME: NULL
COLLATION_NAME: NULL
DTD_IDENTIFIER: NULL
ROUTINE_BODY: SQL
ROUTINE_DEFINITION: BEGIN
DECLARE NDX INT;
SET NDX = 0;
WHILE NDX < 100 DO
INSERT INTO mydata (ti_time) VALUES (NOW() - INTERVAL CEILING(14400*RAND()) SECOND
);
SET NDX = NDX + 1;
END WHILE;
END
EXTERNAL_NAME: NULL
EXTERNAL_LANGUAGE: NULL
PARAMETER_STYLE: SQL
IS_DETERMINISTIC: YES
SQL_DATA_ACCESS: CONTAINS SQL
SQL_PATH: NULL
SECURITY_TYPE: DEFINER
CREATED: 2011-07-25 11:12:02
LAST_ALTERED: 2011-07-18 22:39:34
SQL_MODE:
ROUTINE_COMMENT:
DEFINER: lwdba@127.0.0.1
CHARACTER_SET_CLIENT: cp850
COLLATION_CONNECTION: cp850_general_ci
DATABASE_COLLATION: latin1_swedish_ci
1 row in set (0.03 sec)
mysql>
Wenn Sie dies für alle gespeicherten Prozeduren tun, sollte MySQL Workbench damit aufhören, sich zu beschweren.