Polluting patches in both http://drupal.org/node/106576 and http://drupal.org/node/132630 was an important change to fix how we escape blobs when creating backup tables. I ripped the code out of #106576, so it could be fixed separately, since it needs to go into both DRUPAL-4-7 and HEAD.

And so begins the long list of bugs that require totally separate patches due to lame differences between HEAD and DRUPAL-4-7... :(

Here's the patch for DRUPAL-4-7

Comments

dww’s picture

StatusFileSize
new1.54 KB

And for HEAD...

dww’s picture

Assigned: dww » Unassigned

not having thought about this much or investigated, it's not clear why we're manually trying to escape everything instead of just using db_escape_string()... these patches might need re-doing.

smk-ka’s picture

Version: 4.7.x-1.x-dev » 5.x-1.x-dev
Assigned: Unassigned » smk-ka
StatusFileSize
new2 KB

[...] it's not clear why we're manually trying to escape everything instead of just using db_escape_string()...

Because creating a textual dump is different from actually executing a query. mysql_real_escape_string() escapes both types of quotes with a backslash, where we only need to double single quotes and leave double quotes unchanged.

Updated patch contains:
- support for NULL values, to be able to 100% recreate a database
- the missing read-in of the table schema.

Tests I've run so far:
1. created a phpMyAdmin reference dump
2. created a site snapshot using Demo module
3. reset site using Demo module
4. created another dump using phpMyAdmin and visually diffed against the first one. Result is 100% the same (except for changed timestamps, of course).
--
Stefan Kudwien
unleashed mind

dww’s picture

Status: Needs review » Patch (to be ported)

great, thanks! don't have time to review/test now, but i certainly appreciate the patch. however, since this is a bug, please provide a version for the DRUPAL-4-7 branch, too...

thanks,
-derek

jeremy’s picture

Status: Patch (to be ported) » Closed (won't fix)

The 5.x branch is no longer supported.