dba module for 5.x missing

msn - March 31, 2007 - 17:42
Project:Demonstration site (Sandbox / Snapshot)
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:smk-ka
Status:closed
Description

I tested V1.1.2.2 (CVS)

MySQL 5.0.27
PHP 5.1.6
Apache 1.3.37
dba module with latest drupal 5 patch (worked without errors)

Create snapshot gives a list from "show create table access" to "show create table watchdog"
Last reset: never
Last dump: never
In the map files the map "demo" is made, there is no content

I made a page

Back to demonstration site
Last reset: never
Last dump: never

Reset site gives the error: Dump file files/test1/demo/demo_site.sql does not exist.
Last reset: day, date - time
Last dump: never

Nothing is happening.
I tried this a few times.

I found in the files/tmp map a few sql files named yyyy-mmdd-mmss_backup sql.qz. It could not be the sql files from dba, there were no crons in this periode. These file are generated by demo.
My conclusion: the wrong filenames in the wrong map.

Hope this can help the module building

Martin

#1

sun - April 1, 2007 - 17:32
Title:Some test results» dba module for 5.x missing
Assigned to:Anonymous» sun
Status:active» needs review

I hoped that the 5.x update for dba.module was committed earlier. Although I can't see anymore bugs, it seems that dww wants to test the patch some more... (see issue)

The additional downside of this is, that Demo requires another patch for dba to be committed. And I really do not want to fork the dba module.

As long as dba is not publicly available for 5.x I think it's best to allow testing of Demo with a temporary dba.module I'll upload here. Just replace the files of dba with those supplied here (remove extension .txt).

AttachmentSize
dba.module.txt 49.95 KB

#2

sun - April 1, 2007 - 17:33

Appropriate .info file.

AttachmentSize
dba.info_.txt 138 bytes

#3

msn - April 1, 2007 - 22:34

Thanks, I will test with it

Martin

#4

smk-ka - April 4, 2007 - 12:14
Status:needs review» reviewed & tested by the community

Provided module works fine for me.
Changed status to reflect this workaround actually works.
--
Stefan Kudwien
http://www.unleashedmind.com

#5

sun - April 4, 2007 - 19:25
Status:reviewed & tested by the community» needs work

Please do not use the temporarily provided dba.module on productive sites.
The new 5.x version of dba will be available soon.

#6

dman - May 29, 2007 - 12:58

dba doesn't look to be moving along. :(

Thanks for the attached version. After a bit of version hacking I got your 'adequate' port over there to patch OK, but on debugging, none of the patches or CVS history seemed to show any evidence of dba_auto_backup() ever taking any arguments ... which is why my snapshots were not saving anywhere (as described in the problem above).

I've poked the backup.module before now, and I see a lot of duplication between that and what dba has done ... and what this module is doing too. my ideas on site replication also fall into the same general area :)

I like how demo is small, and only provides the needed UI for what it does. Very useful (although I had hoped it would provide 'branching' or release snapshots that could run independantly of the main site... )
This dependance on dba is a bit unfortunate however. :(
Can't we just steal the three functions we need from it? ;-)

... I'm yet to actually use the module, so let's see how it goes...

.dan.

#7

Farreres - June 26, 2007 - 08:24

dba finally released a dev version.

#8

smk-ka - July 29, 2007 - 22:36

If it takes too long let's just dump dba. Also reduces overall code size if you weren't using any of the other dba functionality.
--
Stefan Kudwien
unleashed mind

AttachmentSize
no_dba.patch 7.89 KB

#9

smk-ka - July 29, 2007 - 22:37
Assigned to:sun» smk-ka
Status:needs work» needs review

#10

dman - July 31, 2007 - 04:40

I'm not sure if this is 100% this-patch related, but I tried it out today.
The first half went pretty well.

I set up a snapshot, made a config change and went to restore it.
White error page:

Warning: Table 'drupal_api.system' doesn't exist query: SELECT * FROM system WHERE type = 'theme' in /var/www/drupal.monster/includes/database.mysql.inc on line 172

Warning: Table 'drupal_api.watchdog' doesn't exist query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (1, 'php', 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''<div class="php"><code><span class="php-keyword">function</span> <span class="p' at line 1\nquery: INSERT INTO api_documentation VALUES(84, 'sitesynch_bookmarklets', 'Development', 'function', 'sitesynch_bookmarklets', 'sitesynch/sitesynch.module', 'Display the setup for form-synch bookmarklets.', '&l in /var/www/drupal.monster/includes/database.mysql.inc on line 172
.... 100 watchdog table errors...

- First, I'd suggest that 'watchdog' be excluded from the dump anyway.
- And it seems to be a recursive sorta error - watchdog complaining about itself ...
.. AH. That's probably a known issue with fecking api.module. I hit it when synching a site this weekend. It has a column named 'return' ... which is a reserved word :( Probably not demo.modules fault.

Returning to the site, I saw the errors again, as Drupal warnings.

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''<div class="php"><code><span class="php-keyword">function</span> <span class="p' at line 1 query: INSERT INTO api_documentation VALUES(84, 'sitesynch_bookmarklets', 'Development', 'function', 'sitesynch_bookmarklets', 'sitesynch/sitesynch.module', 'Display the setup for form-synch bookmarklets.', '<p>Display the setup for form-synch bookmarklets.</p>\n', '<div class="php"><code><span
... and more.

HOWEVER it semed to be only the troublesome api.module, and the rest of the site reverted, as far as I can see.

... I'll look deeper and see what the syntax is that's breaking it. I can probably debug the SQL when I look at it. I've done several of these scripts before.
Again - this may not be this module/patches fault directly - but it's a symptom I got on an otherwise mostly-clean site.

#11

dman - July 31, 2007 - 04:45

What are the reasons we are not just using mysqldump to prepare this SQL?
We can even list the tables by name if we have to deal with prefixes etc. All the rebuild-by-hand seems a bit flakey.

#12

smk-ka - September 12, 2007 - 12:29

I've been playing around with the the command line tools, they work (even for Postgres), but they force you to have safe_mode disabled. I'd definitely include these as an option, but still have script generated dumps as a fallback.

That's why decided to rip some more code from the phpMyAdmin project, the central function is now 100% identical. So, if you don't have any problems dumping with phpMyAdmin, you shouldn't have either with demo module.

To test, grab a clean dev copy (or CVS checkout) and apply the attached patch.

AttachmentSize
no_dba_0.patch 8.87 KB

#13

sun - September 12, 2007 - 17:11

Looks great!
However, can't we try to execute mysqldump now and fallback to the dumping code of phpMyAdmin if it could not be invoked?

There is a minor coding-style issue: (there might be some tabs instead of spaces)

<?php
// Include database specific functions
+  switch ($db_type) {
+      case
'mysqli':
+     
$engine = 'mysql';
+          break;
+      default:
+     
$engine = $db_type;
+          break;
+  }
?>

#14

sun - September 12, 2007 - 20:03
Status:needs review» needs work

Found an issue: The generated SQL dump file is saved as ISO-8859-1 instead of UTF-8. Are we able to save sql files in UTF-8?

#15

smk-ka - September 12, 2007 - 21:58

However, can't we try to execute mysqldump now and fallback to the dumping code of phpMyAdmin if it could not be invoked?

Let's do this in a second step.

generated SQL dump file is saved as ISO-8859-1

How can you say? From my tests this is not the case.

Attached patch has spaces instead of tabs.

AttachmentSize
no_dba_1.patch 8.88 KB

#16

smk-ka - September 12, 2007 - 21:58
Status:needs work» needs review

#17

sun - September 13, 2007 - 13:30
Status:needs review» needs work

Sorry, my fault. I was accidently looking at an old version.

However, I've just tried to import a rather huge dump (Drupal test site) containing data for API module, that failed.
API module stores function signatures (some with single quotes in the value) in the table api_function. The import broke somewhere in that table. A quick comparison of line counts tells that there are 428 datasets missing.

Attached is the complete dump of this table.

Additionally, I'm adding the greatest non-empty dataset in the table api_function at the end of the file.

AttachmentSize
demo_no_dba_import_error.txt 272.29 KB

#18

sun - September 13, 2007 - 13:34

Interestingly, phpMyAdmin imports the same dump file without any errors. Maybe they are using some special character escaping for imports, too?

#19

smk-ka - September 13, 2007 - 20:33
Status:needs work» fixed

Yes, import was broken, too. I think I've got it working now and committed
http://drupal.org/cvs?commit=81167: Removed dependency on dba module
http://drupal.org/cvs?commit=81171: Fixed db import. Excluding watchdog table from dump/restore.

#20

Anonymous - September 27, 2007 - 20:41
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.