Hi!

> The dump is not fully correctly, because the last character in each line is
> comma (,), not (;).

Yes, it's true. PHPMyAdmin generated the dump this way. The generator code for 
UPDATEs could be somehow mixed with the extended (multi-record) INSERT 
statements. Last UPDATE is colsed with a ; character like the extended INSERT 
statements, so the bug could be in PHPMyAdmin, not in my copy-paste 
operation.

> The hexadecimal encoding in place of ascii was correct because you used
> collate ascii_bin.

I've realized later that PHPMyAdmin dumps ascii_bin columns this way and I 
usually turn off ugly hexadecimal dump of these columns before dumping 
tables. (I don't understand why PHPMyAdmin dumps ascii_bin columns this way 
by default, but I can live with it as far as I can turn it off.)

> Also, I exported the database with UPDATE option and it was exported
> correctly, too. Of course, the name column was hexadecimal encoded, too.

There could be a bug in PHPMyAdmin's dump generator code that places commas at 
the end of all but the last UPDATE lines if extended INSERTs are enabled. 
This behavior is reproduced with the latest version after apt-get upgrade. 
Example dump created by PHPMyAdmin 2.8.0.3-Debian-1 with UPDATE target, 
extended inserts ON and hexadecimal binary fields OFF:


-- phpMyAdmin SQL Dump
-- version 2.8.0.3-Debian-1
-- http://www.phpmyadmin.net
-- 
-- Hoszt: localhost
-- Létrehozás ideje: 2006. Jún 25. 21:45
-- Szerver verzió: 4.1.15
-- PHP Verzió: 4.4.2-1.1
-- 
-- Adatbázis: `app_base`
-- 

-- --------------------------------------------------------

-- 
-- Tábla szerkezet: `group`
-- 

CREATE TABLE `group` (
  `id` int(11) NOT NULL auto_increment,
  `serial_id` int(11) NOT NULL default '0',
  `identifier` varchar(32) character set ascii collate ascii_bin NOT NULL 
default '',
  `members` mediumtext character set ascii collate ascii_bin,
  `roles` mediumtext character set ascii collate ascii_bin,
  `title_en` varchar(255) default NULL,
  `description_en` text,
  `settings` mediumtext character set utf8 collate utf8_bin,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `identifier` (`serial_id`,`identifier`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;

-- 
-- Tábla adatok: `group`
-- 

UPDATE `group` SET `id` = 1, `serial_id` = 1, `identifier` = 'guests', 
`members` = '[1]', `roles` = '[1]', `title_en` = 'Guests', `description_en` 
= 'Guest users. Before login all users are treated as guests.', `settings` = 
NULL WHERE  `id` = 1,
UPDATE `group` SET `id` = 2, `serial_id` = 1, `identifier` = 'admins', 
`members` = '[2]', `roles` = '[1,2,3]', `title_en` = 'Administrators', 
`description_en` = 'User administrators for this application.', `settings` = 
NULL WHERE  `id` = 2;


Notice the comma after the first UPDATE.

Thanks for your assistance, Viktor

Reply via email to