Closed (fixed)
Project:
Universally Unique IDentifier
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Sep 2010 at 18:56 UTC
Updated:
14 Oct 2010 at 21:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
apotek commentedAnother way to say this is change the uuid => array() in this function
Of course, we'll also have to create an update hook.
Comment #2
apotek commentedOkay, here's the patch.
Comment #3
apotek commentedRegenerated the patch to be more properly formatted and to update smoother. Also wrapped the uuid_comment table create statement in a if table does not exist wrap.
This is a pretty atomic and specific patch.
Comment #4
damienmckennaLooks good to me. +1
Comment #5
recidive commentedActually UUIDs are 36 chars long (32 digits and 4 hyphens).
In the long run, I think we should store only the 32 digits stripping out the hyphens in database only.
For now, I think converting the columns to 36 chars and use CHAR instead of VARCHAR would be an improvement.
Also, there are some code style issues with your patch:
1. There are tabs indentation and they are not accepted;
2. There is an inline comment with no comment at all;
3. Comments must start with a capital letter and end with a period;
4. We normally don't use "while(list(,$table) = each($tables))" constructors but "foreach ($tables as $table)".
Comment #6
apotek commentedThanks for the feedback. I'm confused, though, as it looks like you looked at the first version of the patch rather than the uuid-913820.patch version. The posted version has no tabs, and no inline comment with no comment in it.
I have created a new patch, with the column defined to 32 char. I also edited my comments to start with capital letters and end with periods.
> 4. We normally don't use "while(list(,$table) = each($tables))" constructors but "foreach ($tables as $table)".
If this is a blocker, I suppose I can roll another version of the patch to conform more the the Drupal way, it's just that the Drupal way is part of the reason why Drupal uses up so much more memory than necessary. As you know, foreach *copies* each variable rather than just iterating through them. Using a while() construct simply iterates through an array without the added expense of having to gobble up more memory.
Comment #7
recidive commentedJust changing the column to CHAR(32) will not make it as the UUID including the hyphens are 36 chars long. So it should be 36 instead of 32.
Also, you should write uuid_update_6004() function to make you changes to database schema, since uuid_update_6003() will not run in sites running the latest schema.
That was the line I said there's a inline comment with no comment at all:
And please change the while(list()) loop with foreach() for consistency.
I'm looking forward to commiting you patches. Thank you!
Comment #8
damienmckennaHere's an updated patch that cleans up some of the code and includes all of the requested changes from #7, and some others. Could someone please review it.
Comment #9
apotek commentedCleaned up as requested. Took a couple shortcuts from Damien as well. Thanks.
Comment #10
damienmckennaWorked correctly for me.
Comment #11
recidive commentedThanks guys.
Just a question: what's the change in uuid_update_6003() about?
Is that part of the patch or was it mistakenly added?
Comment #12
apotek commentedJust put that in so that no errors are generated if the table already exists. It's unrelated, so feel free to rip it out, or I can rip it out of the patch and make a new issue for it, if you like. But is seems harmless where it is.
Comment #13
recidive commentedCommited! Thanks!