Bonjour,

J'ai un bug aléatoire et très difficile à reproduire qui me détruit littéralement toutes mes tables sauf une ().

Cela se produit rarement, mais j'ai pu logger quelques infos lors du dernier crash, il en résulte ceci :

- 14:54:34, la dernière page chargée avant que la base ne disparaisse, une page simple qui n'a aucune chance de détruire la base, de près ou de loin.
Les seules requêtes exécutées sont les suivantes :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
 
110902 14:54:34	   24 Connect	root@localhost on Doctrine_tests
		   24 Query	SELECT t0.id AS id1, t0.uniqHash AS uniqHash2, t0.login AS login3, t0.password AS password4, t0.email AS email5, t0.birth_date AS birth_date6, t0.avatar AS avatar7, t0.first_name AS first_name8, t0.last_name AS last_name9, t0.country AS country10, t0.adress AS adress11, t0.postal_code AS postal_code12, t0.town AS town13, t0.province AS province14, t0.team_invitation_sub AS team_invitation_sub15, t0.created_at AS created_at16, t0.lifeak_settings AS lifeak_settings17, t0.statut AS statut18 FROM user t0 WHERE t0.id = 1
		   24 Query	START TRANSACTION
		   24 Query	UPDATE user SET statut = 'AWAY' WHERE id = 1
		   24 Query	COMMIT
		   24 Quit
Vous pouvez remarquer les champs existants dans la table "user", il y en a 18. Après la suppression, la table est recréée selon un ancien modèle qui ne contient que 7 champs, ce modèle ne fait même plus partie de mes sources..


- Je me suis absenté 30mins environ, et dans l'intervalle à 15:09:07 exactement, alors que je ne charge aucune page, un flot de requête s’exécute, supprime toutes les tables, et modifie la table "user" (la seule survivante).

Le code des requêtes de suppression faisant plus de 400 lignes de log je ne vais pas les poster en entier, mais voici le début :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
110902 15:09:07	   25 Connect	root@localhost on Doctrine_tests
		   25 Query	SHOW FULL TABLES WHERE Table_type = 'BASE TABLE'
110902 15:09:08	   25 Query	DESCRIBE bottom_panel
		   25 Query	SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON   c.constraint_name = k.constraint_name AND   c.table_name = 'bottom_panel' */ WHERE k.table_name = 'bottom_panel' AND k.table_schema = 'Doctrine_tests' /*!50116 AND c.constraint_schema = 'Doctrine_tests' */ AND k.`REFERENCED_COLUMN_NAME` is not NULL
		   25 Query	SELECT TABLE_NAME AS `Table`, NON_UNIQUE AS Non_Unique, INDEX_NAME AS Key_name, SEQ_IN_INDEX AS Seq_in_index, COLUMN_NAME AS Column_Name, COLLATION AS Collation, CARDINALITY AS Cardinality, SUB_PART AS Sub_Part, PACKED AS Packed, NULLABLE AS `Null`, INDEX_TYPE AS Index_Type, COMMENT AS Comment FROM information_schema.STATISTICS WHERE TABLE_NAME = 'bottom_panel' AND TABLE_SCHEMA = 'Doctrine_tests'
		   25 Query	DESCRIBE calls
		   25 Query	SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON   c.constraint_name = k.constraint_name AND   c.table_name = 'calls' */ WHERE k.table_name = 'calls' AND k.table_schema = 'Doctrine_tests' /*!50116 AND c.constraint_schema = 'Doctrine_tests' */ AND k.`REFERENCED_COLUMN_NAME` is not NULL
		   25 Query	SELECT TABLE_NAME AS `Table`, NON_UNIQUE AS Non_Unique, INDEX_NAME AS Key_name, SEQ_IN_INDEX AS Seq_in_index, COLUMN_NAME AS Column_Name, COLLATION AS Collation, CARDINALITY AS Cardinality, SUB_PART AS Sub_Part, PACKED AS Packed, NULLABLE AS `Null`, INDEX_TYPE AS Index_Type, COMMENT AS Comment FROM information_schema.STATISTICS WHERE TABLE_NAME = 'calls' AND TABLE_SCHEMA = 'Doctrine_tests'
		   25 Query	DESCRIBE contact
		   25 Query	SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON   c.constraint_name = k.constraint_name AND   c.table_name = 'contact' */ WHERE k.table_name = 'contact' AND k.table_schema = 'Doctrine_tests' /*!50116 AND c.constraint_schema = 'Doctrine_tests' */ AND k.`REFERENCED_COLUMN_NAME` is not NULL
		   25 Query	SELECT TABLE_NAME AS `Table`, NON_UNIQUE AS Non_Unique, INDEX_NAME AS Key_name, SEQ_IN_INDEX AS Seq_in_index, COLUMN_NAME AS Column_Name, COLLATION AS Collation, CARDINALITY AS Cardinality, SUB_PART AS Sub_Part, PACKED AS Packed, NULLABLE AS `Null`, INDEX_TYPE AS Index_Type, COMMENT AS Comment FROM information_schema.STATISTICS WHERE TABLE_NAME = 'contact' AND TABLE_SCHEMA = 'Doctrine_tests'
		   25 Query	DESCRIBE contact_category
		   25 Query	SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON   c.constraint_name = k.constraint_name AND   c.table_name = 'contact_category' */ WHERE k.table_name = 'contact_category' AND k.table_schema = 'Doctrine_tests' /*!50116 AND c.constraint_schema = 'Doctrine_tests' */ AND k.`REFERENCED_COLUMN_NAME` is not NULL
		   25 Query	SELECT TABLE_NAME AS `Table`, NON_UNIQUE AS Non_Unique, INDEX_NAME AS Key_name, SEQ_IN_INDEX AS Seq_in_index, COLUMN_NAME AS Column_Name, COLLATION AS Collation, CARDINALITY AS Cardinality, SUB_PART AS Sub_Part, PACKED AS Packed, NULLABLE AS `Null`, INDEX_TYPE AS Index_Type, COMMENT AS Comment FROM information_schema.STATISTICS WHERE TABLE_NAME = 'contact_category' AND TABLE_SCHEMA = 'Doctrine_tests'
		   25 Query	DESCRIBE credential
		   25 Query	SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON   c.constraint_name = k.constraint_name AND   c.table_name = 'credential' */ WHERE k.table_name = 'credential' AND k.table_schema = 'Doctrine_tests' /*!50116 AND c.constraint_schema = 'Doctrine_tests' */ AND k.`REFERENCED_COLUMN_NAME` is not NULL
		   25 Query	SELECT TABLE_NAME AS `Table`, NON_UNIQUE AS Non_Unique, INDEX_NAME AS Key_name, SEQ_IN_INDEX AS Seq_in_index, COLUMN_NAME AS Column_Name, COLLATION AS Collation, CARDINALITY AS Cardinality, SUB_PART AS Sub_Part, PACKED AS Packed, NULLABLE AS `Null`, INDEX_TYPE AS Index_Type, COMMENT AS Comment FROM information_schema.STATISTICS WHERE TABLE_NAME = 'credential' AND TABLE_SCHEMA = 'Doctrine_tests'
		   25 Query	DESCRIBE module_panel
		   25 Query	SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON   c.constraint_name = k.constraint_name AND   c.table_name = 'module_panel' */ WHERE k.table_name = 'module_panel' AND k.table_schema = 'Doctrine_tests' /*!50116 AND c.constraint_schema = 'Doctrine_tests' */ AND k.`REFERENCED_COLUMN_NAME` is not NULL
		   25 Query	SELECT TABLE_NAME AS `Table`, NON_UNIQUE AS Non_Unique, INDEX_NAME AS Key_name, SEQ_IN_INDEX AS Seq_in_index, COLUMN_NAME AS Column_Name, COLLATION AS Collation, CARDINALITY AS Cardinality, SUB_PART AS Sub_Part, PACKED AS Packed, NULLABLE AS `Null`, INDEX_TYPE AS Index_Type, COMMENT AS Comment FROM information_schema.STATISTICS WHERE TABLE_NAME = 'module_panel' AND TABLE_SCHEMA = 'Doctrine_tests'
		   25 Query	DESCRIBE news
		   25 Query	SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON   c.constraint_name = k.constraint_name AND   c.table_name = 'news' */ WHERE k.table_name = 'news' AND k.table_schema = 'Doctrine_tests' /*!50116 AND c.constraint_schema = 'Doctrine_tests' */ AND k.`REFERENCED_COLUMN_NAME` is not NULL
		   25 Query	SELECT TABLE_NAME AS `Table`, NON_UNIQUE AS Non_Unique, INDEX_NAME AS Key_name, SEQ_IN_INDEX AS Seq_in_index, COLUMN_NAME AS Column_Name, COLLATION AS Collation, CARDINALITY AS Cardinality, SUB_PART AS Sub_Part, PACKED AS Packed, NULLABLE AS `Null`, INDEX_TYPE AS Index_Type, COMMENT AS Comment FROM information_schema.STATISTICS WHERE TABLE_NAME = 'news' AND TABLE_SCHEMA = 'Doctrine_tests'
		   25 Query	DESCRIBE newsletter
		   25 Query	SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON   c.constraint_name = k.constraint_name AND   c.table_name = 'newsletter' */ WHERE k.table_name = 'newsletter' AND k.table_schema = 'Doctrine_tests' /*!50116 AND c.constraint_schema = 'Doctrine_tests' */ AND k.`REFERENCED_COLUMN_NAME` is not NULL
		   25 Query	SELECT TABLE_NAME AS `Table`, NON_UNIQUE AS Non_Unique, INDEX_NAME AS Key_name, SEQ_IN_INDEX AS Seq_in_index, COLUMN_NAME AS Column_Name, COLLATION AS Collation, CARDINALITY AS Cardinality, SUB_PART AS Sub_Part, PACKED AS Packed, NULLABLE AS `Null`, INDEX_TYPE AS Index_Type, COMMENT AS Comment FROM information_schema.STATISTICS WHERE TABLE_NAME = 'newsletter' AND TABLE_SCHEMA = 'Doctrine_tests'
		   25 Query	DESCRIBE newsletter_recipient
		   25 Query	SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON   c.constraint_name = k.constraint_name AND   c.table_name = 'newsletter_recipient' */ WHERE k.table_name = 'newsletter_recipient' AND k.table_schema = 'Doctrine_tests' /*!50116 AND c.constraint_schema = 'Doctrine_tests' */ AND k.`REFERENCED_COLUMN_NAME` is not NULL
		   25 Query	SELECT TABLE_NAME AS `Table`, NON_UNIQUE AS Non_Unique, INDEX_NAME AS Key_name, SEQ_IN_INDEX AS Seq_in_index, COLUMN_NAME AS Column_Name, COLLATION AS Collation, CARDINALITY AS Cardinality, SUB_PART AS Sub_Part, PACKED AS Packed, NULLABLE AS `Null`, INDEX_TYPE AS Index_Type, COMMENT AS Comment FROM information_schema.STATISTICS WHERE TABLE_NAME = 'newsletter_recipient' AND TABLE_SCHEMA = 'Doctrine_tests'
		   25 Query	DESCRIBE newsletter_stats
		   25 Query	SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON   c.constraint_name = k.constraint_name AND   c.table_name = 'newsletter_stats' */ WHERE k.table_name = 'newsletter_stats' AND k.table_schema = 'Doctrine_tests' /*!50116 AND c.constraint_schema = 'Doctrine_tests' */ AND k.`REFERENCED_COLUMN_NAME` is not NULL
		   25 Query	SELECT TABLE_NAME AS `Table`, NON_UNIQUE AS Non_Unique, INDEX_NAME AS Key_name, SEQ_IN_INDEX AS Seq_in_index, COLUMN_NAME AS Column_Name, COLLATION AS Collation, CARDINALITY AS Cardinality, SUB_PART AS Sub_Part, PACKED AS Packed, NULLABLE AS `Null`, INDEX_TYPE AS Index_Type, COMMENT AS Comment FROM information_schema.STATISTICS WHERE TABLE_NAME = 'newsletter_stats' AND TABLE_SCHEMA = 'Doctrine_tests'
		   25 Query	DESCRIBE newsletter_template
		   25 Query	SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON   c.constraint_name = k.constraint_name AND   c.table_name = 'newsletter_template' */ WHERE k.table_name = 'newsletter_template' AND k.table_schema = 'Doctrine_tests' /*!50116 AND c.constraint_schema = 'Doctrine_tests' */ AND k.`REFERENCED_COLUMN_NAME` is not NULL
		   25 Query	SELECT TABLE_NAME AS `Table`, NON_UNIQUE AS Non_Unique, INDEX_NAME AS Key_name, SEQ_IN_INDEX AS Seq_in_index, COLUMN_NAME AS Column_Name, COLLATION AS Collation, CARDINALITY AS Cardinality, SUB_PART AS Sub_Part, PACKED AS Packed, NULLABLE AS `Null`, INDEX_TYPE AS Index_Type, COMMENT AS Comment FROM information_schema.STATISTICS WHERE TABLE_NAME = 'newsletter_template' AND TABLE_SCHEMA = 'Doctrine_tests'
		   25 Query	DESCRIBE private_conversation
		   26 Connect	root@localhost on Doctrine_tests
		   26 Query	SHOW FULL TABLES WHERE Table_type = 'BASE TABLE'
		   26 Query	DESCRIBE bottom_panel
		   26 Query	SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON   c.constraint_name = k.constraint_name AND   c.table_name = 'bottom_panel' */ WHERE k.table_name = 'bottom_panel' AND k.table_schema = 'Doctrine_tests' /*!50116 AND c.constraint_schema = 'Doctrine_tests' */ AND k.`REFERENCED_COLUMN_NAME` is not NULL
		   25 Query	SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON   c.constraint_name = k.constraint_name AND   c.table_name = 'private_conversation' */ WHERE k.table_name = 'private_conversation' AND k.table_schema = 'Doctrine_tests' /*!50116 AND c.constraint_schema = 'Doctrine_tests' */ AND k.`REFERENCED_COLUMN_NAME` is not NULL
		   26 Query	SELECT TABLE_NAME AS `Table`, NON_UNIQUE AS Non_Unique, INDEX_NAME AS Key_name, SEQ_IN_INDEX AS Seq_in_index, COLUMN_NAME AS Column_Name, COLLATION AS Collation, CARDINALITY AS Cardinality, SUB_PART AS Sub_Part, PACKED AS Packed, NULLABLE AS `Null`, INDEX_TYPE AS Index_Type, COMMENT AS Comment FROM information_schema.STATISTICS WHERE TABLE_NAME = 'bottom_panel' AND TABLE_SCHEMA = 'Doctrine_tests'
		   25 Query	SELECT TABLE_NAME AS `Table`, NON_UNIQUE AS Non_Unique, INDEX_NAME AS Key_name, SEQ_IN_INDEX AS Seq_in_index, COLUMN_NAME AS Column_Name, COLLATION AS Collation, CARDINALITY AS Cardinality, SUB_PART AS Sub_Part, PACKED AS Packed, NULLABLE AS `Null`, INDEX_TYPE AS Index_Type, COMMENT AS Comment FROM information_schema.STATISTICS WHERE TABLE_NAME = 'private_conversation' AND TABLE_SCHEMA = 'Doctrine_tests'
		   26 Query	DESCRIBE calls
Donc voilà, très honnêtement j'ai déjà eu des bugs mystiques mais là je n'y comprend vraiment rien. Que ce soit au niveau de Doctrine ou de Mysql, y-a-t-il un système de cache, de sauvegarde ou autre qui puisse mener à un pareil cas ?

Où est-ce que Doctrine (à supposer que ça vienne de lui) peut-il trouver ce modèle qui date de plusieurs semaines ?

Edit:

Je rajoute le log Mysql, qui à curieusement sortie plusieurs erreurs juste avant le bug :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
110902 12:33:45 [Note] Plugin 'FEDERATED' is disabled.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use Windows interlocked functions
InnoDB: Compressed tables use zlib 1.2.3
110902 12:33:45  InnoDB: Initializing buffer pool, size = 128.0M
110902 12:33:45  InnoDB: Completed initialization of buffer pool
110902 12:33:45  InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
110902 12:33:45  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Last MySQL binlog file position 0 102607, file name .\mysql-bin.000312
110902 12:33:58  InnoDB: 1.1.4 started; log sequence number 274252690
110902 12:33:59 [Note] Event Scheduler: Loaded 0 events
110902 12:33:59 [Note] wampmysqld: ready for connections.
Version: '5.5.8-log'  socket: ''  port: 3306  MySQL Community Server (GPL)
110902 15:09:09 [Warning] Invalid (old?) table or database name '#sql2-1064-1a'
110902 15:09:09 [Warning] Invalid (old?) table or database name '#sql2-1064-1a'
110902 15:09:10 [Warning] Invalid (old?) table or database name '#sql2-1064-1a'
110902 15:09:10 [Warning] Invalid (old?) table or database name '#sql2-1064-1a'
110902 15:09:10 [Warning] Invalid (old?) table or database name '#sql2-1064-1a'
110902 15:09:11 [Warning] Invalid (old?) table or database name '#sql2-1064-1a'
110902 15:09:11 [Warning] Invalid (old?) table or database name '#sql2-1064-1a'
110902 15:09:11 [Warning] Invalid (old?) table or database name '#sql2-1064-1a'
110902 15:09:11 [Warning] Invalid (old?) table or database name '#sql2-1064-1a'
110902 15:09:12 [Warning] Invalid (old?) table or database name '#sql2-1064-1a'
110902 15:09:12 [Warning] Invalid (old?) table or database name '#sql2-1064-1a'
110902 15:09:13 [Warning] Invalid (old?) table or database name '#sql2-1064-1a'
110902 15:09:13 [Warning] Invalid (old?) table or database name '#sql2-1064-1a'
110902 15:09:13 [Warning] Invalid (old?) table or database name '#sql2-1064-1a'
110902 15:09:13 [Warning] Invalid (old?) table or database name '#sql2-1064-1a'
110902 15:09:14 [Warning] Invalid (old?) table or database name '#sql2-1064-1a'
110902 15:09:14 [Warning] Invalid (old?) table or database name '#sql2-1064-1a'
110902 15:09:15 [Warning] Invalid (old?) table or database name '#sql2-1064-1a'
Merci par avance pour vos lumières,

Cordialement.