Page 5 of 7 FirstFirst ... 34567 LastLast
Results 41 to 50 of 62
  1. #41
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,363
    Plugin Contributions
    94

    Default Re: Database Conversion Tools [Support Thread]

    Quote Originally Posted by gothstone View Post
    The converter fails out for me at Processing table [address_book]:
    Error log says:
    [19-Sep-2023 13:16:26 UTC] PHP Fatal error: Uncaught mysqli_sql_exception: Data too long for column 'address_title' at row 19641 in /home/pcs/dev/utf8mb4-conversion.php:170
    Stack trace:
    #0 /home/pcs/dev/utf8mb4-conversion.php(170): mysqli_query(Object(mysqli), 'ALTER TABLE `ad...')
    #1 {main}
    thrown in /home/pcs/dev/utf8mb4-conversion.php on line 170

    I don't know the sort order, how can I find row 19641 to fix the address?
    What was the original definition of that address_title field? Perhaps varchar(255)? If that's the case, the maximum varchar length for a utf8mb4 database is 192, so you're looking for records in that table that are between 193 and 255 characters in length.

  2. #42
    Join Date
    Jun 2005
    Posts
    355
    Plugin Contributions
    0

    Default Re: Database Conversion Tools [Support Thread]

    Ya, please ignore entirely. Not only was the column complete garbage, but i had the entirely wrong version of the plug-in from your github. The published one worked quite nicely. No clue what i was thinking or how i managed that.
    2 + 2 = 5 for extremely large values of 2

    Pez Collectors Store •••••••• My Plugins List

  3. #43
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,363
    Plugin Contributions
    94

    Default Re: Database Conversion Tools [Support Thread]

    Thanks for the follow-up!

  4. #44
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,291
    Plugin Contributions
    125

    Default Re: Database Conversion Tools [Support Thread]

    It could be worthwhile to do a pre-check (just like the date pre-check) for this condition. I had to do a few ALTER TABLE commands to fix things like this:

    CREATE INDEX `idx_last_page_url_zen` ON `whos_online` (last_page_url)
    1071: Specified key was too long; max key length is 1000 bytes
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  5. #45
    Join Date
    Feb 2017
    Location
    Tokyo, Japan
    Posts
    278
    Plugin Contributions
    0

    Default Re: Database Conversion Tools [Support Thread]

    Hello,
    What would be the fix for that type of error?
    Code:
    CREATE INDEX `idx_last_page_url_zen` ON `whos_online` (last_page_url)
    1071: Specified key was too long; max key length is 1000 bytes
    Change table from ISAM to InnoDB?
    Zen Cart 1.5.6c modified for Japanese language support. Upgraded incrementally from initial 1.5.5d. Currently planning direct upgrade to 2.0.1.

  6. #46
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,363
    Plugin Contributions
    94

    Default Re: Database Conversion Tools [Support Thread]

    Quote Originally Posted by gernot View Post
    Hello,
    What would be the fix for that type of error?
    Code:
    CREATE INDEX `idx_last_page_url_zen` ON `whos_online` (last_page_url)
    1071: Specified key was too long; max key length is 1000 bytes
    Change table from ISAM to InnoDB?
    Since I've never experienced this error myself, I'm not clear on what correction is needed.

    Off the top of my head, I'm thinking that perhaps that table needs to be truncated prior to any collation conversion.

    In ConvertDb.php, find this section in the getDbTablesAndFields method:
    Code:
                $table['has_date_fields'] = false;
                $table['has_text_fields'] = false;
                $this->tables[$table_name] = [
                    'info' => $table,
                    'fields' => [],
                ];
    
                $fields = $this->doQuery(sprintf($fields_sql_base, $table_name));
    ... and add the highlighted section:
    Code:
                $table['has_date_fields'] = false;
                $table['has_text_fields'] = false;
                $this->tables[$table_name] = [
                    'info' => $table,
                    'fields' => [],
                ];
    
                if ($table_name === 'whos_online' || $table_name === 'db_cache') {
                    $this->doQuery('TRUNCATE TABLE ' . $table_name);
                }
    
                $fields = $this->doQuery(sprintf($fields_sql_base, $table_name));

  7. #47
    Join Date
    Feb 2017
    Location
    Tokyo, Japan
    Posts
    278
    Plugin Contributions
    0

    Default Re: Database Conversion Tools [Support Thread]

    Thank you,
    I got the same error
    HTML Code:
    1071: Specified key was too long; max key length is 1000 bytes
    on 3 different tables, and ran the program again and again until the results showed no more issues.
    I'll re-restore the backup data into the testing DB and see what tables exactly those were, although if there are any logs I would be able to check there.
    Did not see any location of logs though, are there any?
    Zen Cart 1.5.6c modified for Japanese language support. Upgraded incrementally from initial 1.5.5d. Currently planning direct upgrade to 2.0.1.

  8. #48
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,363
    Plugin Contributions
    94

    Default Re: Database Conversion Tools [Support Thread]

    Quote Originally Posted by gernot View Post
    Thank you,
    I got the same error
    HTML Code:
    1071: Specified key was too long; max key length is 1000 bytes
    on 3 different tables, and ran the program again and again until the results showed no more issues.
    I'll re-restore the backup data into the testing DB and see what tables exactly those were, although if there are any logs I would be able to check there.
    Did not see any location of logs though, are there any?
    No logs will be generated, unfortunately. Knowing which tables are affected will help.

  9. #49
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,291
    Plugin Contributions
    125

    Default Re: Database Conversion Tools [Support Thread]

    > I got the same error ... on 3 different tables, and ran the program again and again until the results showed no more issues.

    I suspect the relevant indexes aren't there any more - you should check.
    No need to switch from ISAM to InnoDB though. Just create a shorter index before you do the conversion.

    DROP INDEX idx_last_page_url_zen ON whos_online;
    CREATE INDEX idx_last_page_url_zen ON whos_online (last_page_url(191));

    This way when you convert to UTF8, you won't overflow.
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  10. #50
    Join Date
    Feb 2017
    Location
    Tokyo, Japan
    Posts
    278
    Plugin Contributions
    0

    Default Re: Database Conversion Tools [Support Thread]

    Hi, excuse the long wait, I've imported the original data back into the test DB and run the convert_database.php.
    Sure enough, the conversion stops at the table media_manager, with the error message:
    HTML Code:
    CREATE INDEX `idx_media_name_zen` ON `media_manager` (media_name)
    1071: Specified key was too long; max key length is 1000 bytes;
    Reviewing the tables I see the converter has stopped there, and I haven't run it again for now to proceed (which I did previously) to see which table it complained about next.
    I don't understand the error at all. Looking at the table in question, it is all of 2 lines long, and media_name is about 2 dozen ASCII characters:
    HTML Code:
    MariaDB [zencartshoptest]> desc media_manager;
    +---------------+--------------+------+-----+---------------------+----------------+
    | Field         | Type         | Null | Key | Default             | Extra          |
    +---------------+--------------+------+-----+---------------------+----------------+
    | media_id      | int(11)      | NO   | PRI | NULL                | auto_increment |
    | media_name    | varchar(255) | NO   |     |                     |                |
    | last_modified | datetime     | NO   |     | 0001-01-01 00:00:00 |                |
    | date_added    | datetime     | NO   |     | 0001-01-01 00:00:00 |                |
    +---------------+--------------+------+-----+---------------------+----------------+
    4 rows in set (0.001 sec)
    
    MariaDB [zencartshoptest]> select * from media_manager;
    +----------+---------------------------+---------------------+---------------------+
    | media_id | media_name                | last_modified       | date_added          |
    +----------+---------------------------+---------------------+---------------------+
    |        1 | Russ Tippins - The Hunter | 2004-06-01 20:57:43 | 2004-06-01 20:42:53 |
    |        2 | Help!                     | 2004-07-13 01:01:14 | 2004-07-12 17:57:45 |
    +----------+---------------------------+---------------------+---------------------+
    2 rows in set (0.001 sec)
    Zen Cart 1.5.6c modified for Japanese language support. Upgraded incrementally from initial 1.5.5d. Currently planning direct upgrade to 2.0.1.

 

 
Page 5 of 7 FirstFirst ... 34567 LastLast

Similar Threads

  1. v155 Database I/O Manager (DbIo) Plugin [Support Thread]
    By lat9 in forum Addon Admin Tools
    Replies: 576
    Last Post: 23 Apr 2025, 03:32 PM
  2. Hebrew Support - latest release [Support Thread]
    By eranariel in forum Addon Language Packs
    Replies: 20
    Last Post: 23 Apr 2025, 08:49 AM
  3. v156 PWA, Offline support Push notifications addon [Support Thread]
    By perfumbg in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 23 May 2019, 02:27 PM
  4. v155 Database Server Info [Support Thread]
    By lat9 in forum All Other Contributions/Addons
    Replies: 8
    Last Post: 20 Jan 2017, 01:17 PM
  5. Rate conversion in paypal non-support currency
    By limcheewooi in forum PayPal Express Checkout support
    Replies: 1
    Last Post: 7 Jul 2009, 03:13 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR