Bug #6963 Backup generates invalid SQL
Submitted: 2 Dec 2004 20:00 Modified: 2 Dec 2004 20:26
Reporter: Mr Wakazula Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Administrator Severity:S3 (Non-critical)
Version:1.0.15 OS:Windows (Windows 2000)
Assigned to: CPU Architecture:Any

[2 Dec 2004 20:00] Mr Wakazula
Description:
A comma is being appended to INSERT statements generated by the MySQL
Administrator backup utility.  See below.

The _filter_brand table only required one insert statement:
INSERT INTO `_filter_brand` (`component_id`,`brand_id`) 
VALUES 
 (1,1),
 (2,1),
 (3,1),
 (4,1),
 (5,1),
 (6,1),
 (7,1),
 (8,1),
 (9,1),
 (10,1),
 (11,1),
 (12,1),
 (13,1),
 (14,1),
 (15,1),
 (15,6),
 (16,1),
 (17,202),;

The _island table required two insert statements.  Note where
the error is located.

INSERT INTO `_island` (`island_id`,`scheduled_at`) VALUES 
 (168084,'2004-11-30 16:55:23'),
 (168085,'2004-11-30 16:55:24'),
 (168086,'2004-11-30 16:55:40'),
 (168088,'2004-11-30 16:56:04'),
 (168089,'2004-11-30 16:56:28'),
 (168092,'2004-11-30 16:57:32'),
 (168093,'2004-11-30 16:57:59'),
 (168094,'2004-11-30 16:58:12'),
 (168095,'2004-11-30 16:58:22'),
 (168096,'2004-11-30 16:59:05'),
 (168097,'2004-11-30 16:59:14'),
 (168098,'2004-11-30 16:59:57'),
 (168099,'2004-11-30 17:00:17'),
 (168101,'2004-11-30 17:01:38'),
 (168102,'2004-11-30 17:01:40'),
 (168103,'2004-11-30 17:02:49'),
 (168104,'2004-11-30 17:03:18'),
 (168105,'2004-11-30 17:05:42'),
 (168106,'2004-11-30 17:06:46'),
 (168107,'2004-11-30 17:07:24'),
 (168108,'2004-11-30 17:07:26'),
 (168109,'2004-11-30 17:08:07'),
 (168145,'2004-11-30 17:28:09'),
 (168146,'2004-11-30 17:28:15'),
 (168147,'2004-11-30 17:28:16'),
 (168148,'2004-11-30 17:28:48'),
 (168149,'2004-11-30 17:29:23'),
 (168150,'2004-11-30 17:29:24'),
 (168151,'2004-11-30 17:29:26'),
 (168152,'2004-11-30 17:29:38');
INSERT INTO `_island` (`island_id`,`scheduled_at`) VALUES 
 (168153,'2004-11-30 17:30:01'),
 (168154,'2004-11-30 17:30:10'),
 (168155,'2004-11-30 17:30:50'),
 (168156,'2004-11-30 17:31:05'),
 (168157,'2004-11-30 17:31:29'),
 (168158,'2004-11-30 17:31:58'),
 (168159,'2004-11-30 17:32:31'),
 (168160,'2004-11-30 17:32:31'),
 (168161,'2004-11-30 17:32:37'),
 (168162,'2004-11-30 17:33:02'),
 (168164,'2004-11-30 17:34:01'),
 (168165,'2004-11-30 17:34:27'),
 (168167,'2004-11-30 17:35:21'),
 (168168,'2004-11-30 17:35:48'),;

Performing a restore causes the following error to be thrown:

The server has returned this error message: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 '' at line 19

How to repeat:
1) click 'Backup' from the MySql Administrator 
2) click the 'Backup Project' tab
2) select a schema
3) select all tables contained witin the shema
4) click the 'Advanced Options' tab
5) ensure the following parameters are used:

- single transaction
- backup selected schemata completely
- backup type: sql files
- complete INSERTs
- comment

6) click the 'Execute Backup Now' button

Suggested fix:
Please remove the extra comma.
[2 Dec 2004 20:26] MySQL Verification Team
Duplicate for #6929