Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant