Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Broken Backup (Column length too big)

Post Reply
Drache
Posts: 10
Joined: Mon Nov 07, 2011 3:12 pm

Broken Backup (Column length too big)

Unread post by Drache »

The built-in backup button made some invalid CREATE TABLE statements.

The original table looks like

Code: Select all

mysql> desc ___nu14eccea0f3ffc7___;
+-----------------------------------+--------------+------+-----+---------+-------+
| Field                             | Type         | Null | Key | Default | Extra |
+-----------------------------------+--------------+------+-----+---------+-------+
| zzsys_object_id                   | varchar(15)  | NO   |     | NULL    |       |
| sob_zzsys_form_id                 | varchar(15)  | NO   |     |         |       |
| sob_all_access_key                | char(1)      | YES  |     | NULL    |       |
| sob_all_admin_only                | char(1)      | YES  |     | NULL    |       |
| sob_all_class                     | varchar(50)  | YES  |     | NULL    |       |
| sob_all_clone                     | char(1)      | YES  |     | NULL    |       |
| sob_all_column_number             | int(11)      | YES  | MUL | NULL    |       |
| sob_all_display_condition         | varchar(255) | YES  |     | NULL    |       |
...
while the backup-SQL turns varchar(x) into char(3*x):

Code: Select all

create table ___nu14eccea0f3ffc7___
(
    zzsys_object_id char(45),
    sob_zzsys_form_id char(45),
    sob_all_access_key char(3),
    sob_all_admin_only char(3),
    sob_all_class char(150),
    sob_all_clone char(3),
    sob_all_column_number int,
    sob_all_display_condition char(765),
...
Restoring the backup with:

Code: Select all

mysql -u root -p < backup.sql
fails with
ERROR 1074 (42000) at line XXX: Column length too big for column 'sob_all_display_condition' (max = 255); use BLOB or TEXT instead

I guess there is some conversion playing wrong with UTF-8 but why ??
Ruben
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Broken Backup (Column length too big)

Unread post by admin »

Ruben,

Try replacing sqlbackup.php in the attached zip file.
sqlbackup.zip
Steven
You do not have the required permissions to view the files attached to this post.
Drache
Posts: 10
Joined: Mon Nov 07, 2011 3:12 pm

Re: Broken Backup (Column length too big)

Unread post by Drache »

Thank you very much, Steven, that works without errors. But I still have these triple sizes.
The above looks like that now:

Code: Select all

create table ___nu14eda8135d2a1a___
(
    `zzsys_object_id` varchar(45),
    `sob_zzsys_form_id` varchar(45),
    `sob_all_access_key` varchar(3),
    `sob_all_admin_only` varchar(3),
    `sob_all_class` varchar(150),
    `sob_all_clone` varchar(3),
    `sob_all_column_number` int,
    `sob_all_display_condition` varchar(765),
There is a legal but ugly encoding mix. Both my test database and the ___nu***___ tables have a charset of "latin-1" (while the zzsys_* tables were created with charset=utf8).
This will be converted soon and I'll see whether this fixes something.

I'm generally somewhat confused about the Backup feature. I guess the built-in Backup will be a cross-database alternative to mysqldump. But has it some advantage above the latter for MySQL users ?
Ruben
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Broken Backup (Column length too big)

Unread post by admin »

Drache,

We have a new (better) version for backup now.

We build and host nuBuilder applications for other companies.

The backup button is for those customers who want to take their own backups.

Steven
Post Reply