Problems after upgrade to MDB2-2.5.0 alpha
| From: | Dmitri | Date: | Wed, 05 Mar 2008 02:24:46 +0000 |
| Subject: | Problems after upgrade to MDB2-2.5.0 alpha | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-28599@lists.php.net to get a copy of this message | ||
Hello!
I was using the MDB2-2.4.1, MDB2_Driver_mysql-1.4.1 and MDB2_Schema-0.8.2 to dump database into xml format and then could re-create the database from the xml
but after upgrading to the version 2.5.0a2 alpha and to MDB2_Driver_mysql-1.5.0a2 alpha I am unable to recreate the database from the xml file that was generating by dumping the database using the same versions (2.5.0a2 for dump and for re-create)
The empty table are created fine, but failed at the first insert of the first data row. The error messages are not very helpful.
This is whay I am doing to re-create database from xml file:
$hdlSchema =& MDB2_Schema::factory($strDSN, $options);
$arrPreviousSchema = $hdlSchema->getDefinitionFromDatabase(); // this
will be an empty array for a new database $arrCurrentSchema = $hdlSchema->parseDatabaseDefinitionFile($strCurrentSchemaFile);$hdlSchema->updateDatabase($arrCurrentSchema, $arrPreviousSchema); Interesting is that when I installed the MDB2-2.4.1 and MDB2_Driver_mysql-1.4.1 again, I was able to recreate the database from the same xml file without any problems. The xml file was actually created with MDB2-2.5.0a2 The problem only appears when tables has actual data and when the first row of data is being inserted. There is nothing extraordinary about the data, no special chars, no binary data Here is the line from MDB2_Error object that has the actual insert statement - it actually includes all statements including the last one that failed, so this line is probably helpful in debugging [debug_output] => query(3): SHOW /*!50002 FULL*/ TABLES/*!50002 WHERE Table_type = 'BASE TABLE'*/<br> query(3): SHOW TABLES<br> beginTransaction(3): Starting transaction/savepoint<br> query(3): START TRANSACTION<br> query(3): SHOW /*!50002 FULL*/ TABLES/*!50002 WHERE Table_type = 'BASE TABLE'*/<br> query(3): CREATE TABLE
ALBUM (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, userinfo_id INT UNSIGNED DEFAULT 0 NOT NULL, title_album CHAR(128) DEFAULT '' NOT NULL, created INT DEFAULT 0 NOT NULL, public_album CHAR(1) DEFAULT 'Y' NOT NULL, password CHAR(32) DEFAULT '' NOT NULL, description CHAR(255) DEFAULT '' NOT NULL, keywords CHAR(255) DEFAULT '' NOT NULL, count_images INT UNSIGNED DEFAULT 0 NOT NULL, popular_rate INT UNSIGNED DEFAULT 0 NOT NULL, xxx CHAR(1) DEFAULT 'N' NOT NULL, aproved CHAR(1) DEFAULT 'Y' NOT NULL, deleted INT UNSIGNED DEFAULT 0 NOT NULL, videos CHAR(1) DEFAULT 'n' NOT NULL, hex_path VARCHAR(18) DEFAULT '' NOT NULL)<br>
query(3): SHOW INDEX FROM ALBUM<br>query(3): CREATE INDEX deleted ON ALBUM (deleted)<br>
query(3): SHOW INDEX FROM ALBUM<br>
query(3): CREATE INDEX userinfo_id ON ALBUM (userinfo_id)<br>query(3): SHOW INDEX FROM ALBUM<br>
query(3): CREATE INDEX created ON ALBUM (created)<br>query(3): SHOW INDEX FROM ALBUM<br>
query(3): CREATE INDEX title_album ON ALBUM (title_album)<br>
query(3): SHOW /*!50002 FULL*/ TABLES/*!50002 WHERE Table_type = 'BASE TABLE'*/<br>
query(3): CREATE TABLE ALBUM_GRANT (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, userinfo_id INT UNSIGNED DEFAULT 0 NOT NULL, album_id INT UNSIGNED DEFAULT 0 NOT NULL, granted_time DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL, granted_nick CHAR(100) DEFAULT '' NOT NULL)<br>
query(3): SHOW /*!50002 FULL*/ TABLES/*!50002 WHERE Table_type = 'BASE TABLE'*/<br>
query(3): CREATE TABLE ALBUM_USERS (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, album_id INT UNSIGNED DEFAULT 0 NOT NULL, nick CHAR(32) DEFAULT '' NOT NULL, created DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL)<br>
query(3): SHOW /*!50002 FULL*/ TABLES/*!50002 WHERE Table_type = 'BASE TABLE'*/<br>
query(3): CREATE TABLE AUDIO_FILES (id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, user_id BIGINT DEFAULT 0 NOT NULL, file_name VARCHAR(255) DEFAULT '' NOT NULL, type VARCHAR(20) DEFAULT '' NOT NULL, resource_id INT DEFAULT 0 NOT NULL, created_date DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL, deleted VARCHAR(1) DEFAULT '' NOT NULL)<br>
query(3): SHOW /*!50002 FULL*/ TABLES/*!50002 WHERE Table_type = 'BASE TABLE'*/<br>
query(3): CREATE TABLE BLOGGER_API (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, blogger_type CHAR(1) DEFAULT '' NOT NULL, userinfo_id INT UNSIGNED DEFAULT 0 NOT NULL, update_yn CHAR(1) DEFAULT 'N' NOT NULL, login VARCHAR(64) DEFAULT '' NOT NULL, pwd VARCHAR(64) DEFAULT '' NOT NULL)<br>
query(3): SHOW /*!50002 FULL*/ TABLES/*!50002 WHERE Table_type = 'BASE TABLE'*/<br>
query(3): CREATE TABLE BLOGGER_LOG (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, userinfo_id INT UNSIGNED DEFAULT 0 NOT NULL, inserted DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL, blogger_type VARCHAR(32) DEFAULT '' NOT NULL, api_action VARCHAR(32) DEFAULT '' NOT NULL, api_code_response VARCHAR(32) DEFAULT '' NOT NULL, api_response VARCHAR(32) DEFAULT '' NOT NULL)<br>
query(3): SHOW /*!50002 FULL*/ TABLES/*!50002 WHERE Table_type = 'BASE TABLE'*/<br>
query(3): CREATE TABLE BLOG_CSS_DECLARATION (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, declaration VARCHAR(64) DEFAULT '' NOT NULL, range_type CHAR(8) DEFAULT '' NOT NULL, initial VARCHAR(32) DEFAULT '' NOT NULL, value_range LONGTEXT, avail_pattern VARCHAR(255) DEFAULT '' NOT NULL, weight INT DEFAULT 1 NOT NULL)<br>
beginTransaction(3): Starting transaction/savepoint<br>
query(3): SAVEPOINT MDB2_SAVEPOINT_2<br>
query(3): INSERT INTO BLOG_CSS_DECLARATION (id, declaration, range_type, initial, value_range, avail_pattern, weight) VALUES ('1', 'color', 'color', '', '', '', '1')<br>
commit(3): Committing transaction/savepoint<br>
query(3): RELEASE SAVEPOINT MDB2_SAVEPOINT_2<br>
rollback(3): Rolling back transaction/savepoint<br>query(3): ROLLBACK<br>
[in_transaction] =>The MDB2_Error object print_r is very large, so this is just the first few lines: MDB2_Error Object ( [error_message_prefix] => [mode] => 16 [level] => 1024 [code] => -4 [message] => MDB2 Error: not found [userinfo] => _doQuery: [Error message: Could not execute statement] [Last executed query: RELEASE SAVEPOINT MDB2_SAVEPOINT_2] [Native code: 1305] [Native message: SAVEPOINT MDB2_SAVEPOINT_2 does not exist] -- Open Source ALL content management with streaming video http://wiki.sharedlog.com