Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

table parser does not parse columns with only name and type. this leads to data loss over these column types during the copy phase/ #11

Closed
purzelrakete opened this issue Feb 14, 2012 · 1 comment
Assignees

Comments

@purzelrakete
Copy link
Contributor

Lhm::Table::Parser is used to parse the strucutre of origin and destination tables in a migration. The resulting intersection determines which columns are copied in the chunking phase.

Lhm::Table::Parser currently parses the output of show create table. An error in the regular expression for columns causes the following table definition to parse incorrectly:

CREATE TABLE users (
id int(11) NOT NULL AUTO_INCREMENT,
reference int(11) DEFAULT NULL,
username varchar(255) DEFAULT NULL,
group varchar(255) DEFAULT NULL,
created_at datetime DEFAULT NULL,
comment varchar(20) DEFAULT NULL,
description text,
PRIMARY KEY (id),
UNIQUE KEY index_users_on_reference (reference),
KEY index_users_on_username_and_created_at (username,created_at)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

Parsing this ddl will fail to add the description column to the parsed table.

A more robust Table parser using information_schema and no regular expressions fixes this problem.

@ghost ghost assigned purzelrakete Feb 14, 2012
@purzelrakete
Copy link
Contributor Author

fixed in 1.0.2

ghost pushed a commit that referenced this issue Mar 3, 2012
jeffrafter pushed a commit to teespring/lhm that referenced this issue Feb 9, 2016
…le_row_when_the_id_is_not_1_sc_master

Test for detroying single row when the id is not 1 sc master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant