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

non-integer id #51

Open
voltechs opened this issue Jul 31, 2012 · 1 comment
Open

non-integer id #51

voltechs opened this issue Jul 31, 2012 · 1 comment

Comments

@voltechs
Copy link

Rebuilding a table with non-integer id's doesn't work. Is there a workaround? I'm not sure why this is even an issue.

I had this happen twice. The first table was small enough I could convert to integer, and then back. After the table is 'rebuilt', non-integer id's and parent_id's work fine, but not prior to the rebuild.

My second table is much too massive to do by hand.

@voltechs
Copy link
Author

Group Exists (0.5ms)  SELECT 1 FROM `groups` LEFT OUTER JOIN `groups` AS parent
ON `groups`.`parent_id` = parent.
WHERE (`groups`.`lft` IS NULL OR `groups`.`rgt` IS NULL OR `groups`.`lft` >= `groups`.`rgt` OR (`groups`.`parent_id` IS NOT NULL AND (`groups`.`lft` <= parent.`lft` OR `groups`.`rgt` >= parent.`rgt`))) LIMIT 1

ActiveRecord::StatementInvalid: Mysql2::Error: 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 'WHERE (`groups`.`lft` IS NULL OR `groups`.`rgt` IS NULL OR `groups`.`lft` >= `gr' at line 1: SELECT  1 FROM `groups` LEFT OUTER JOIN `groups` AS parent ON `groups`.`parent_id` = parent. WHERE (`groups`.`lft` IS NULL OR `groups`.`rgt` IS NULL OR `groups`.`lft` >= `groups`.`rgt` OR (`groups`.`parent_id` IS NOT NULL AND (`groups`.`lft` <= parent.`lft` OR `groups`.`rgt` >= parent.`rgt`))) LIMIT 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant