Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Reading Issue for Partitioned Tables #282

@dev-quentin

Description

@dev-quentin

Problem Description

$line = trim(fgets($handle));

This line does not work correctly with partitions in MySQL databases.

Example

If the SQL file contains a partitioned table like the one below:

CREATE TABLE my_table (
  id mediumint(8) NOT NULL DEFAULT 0,
  field_code int(3) NOT NULL DEFAULT 0,
  field_subcode int(3) NOT NULL DEFAULT 0,
  value text NOT NULL,
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci
 PARTITION BY KEY (field_code, field_subcode)
PARTITIONS 50;

The current mechanism produces an incorrect line such as

COLLATE=utf8mb3_unicode_ciPARTITION

Solution

Remove the trim function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions