-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
Makes GEN_UUID return a compliant RFC-4122 UUID. [CORE3238] #3609
Comments
Modified by: Christoph Theuring (ctheuring)Attachment: rfc4122.txt [ 11830 ] |
Commented by: @hvlad On POSIX we really generate not UUID's but just a sequence of 16 random bytes reading it from /dev/urandom. On Windows we call CoCreateGuid() which generates correct UUID's (i hope :) I don't know if it is really bug or just "implementation details" :) |
Commented by: @hvlad Simple test execute block returns (uuid_txt char(36), verid1 char(1), verid2 char(1)) |
Commented by: @asfernandes The POSIX code could be changed to generate compliant numbers. About conversion to/from string, I'm sorry, but it's over. It's very sad that people waits for final version of software to report such type of bugs. Changing these functions now will have more trouble that benefits, as they're already in use. |
Commented by: Christoph Theuring (ctheuring) Adriano, I don't believe that's over. |
Commented by: @asfernandes This is over because such functions are in use. If one converted a generated UUID to something and store at any place (database, disk, email link) the contrary conversion should generate the original UUID. Changing this is a major break than don't have a compliant UUID. |
Commented by: @pmakowski Adriano, the problem was raised many times before the final release |
Commented by: Christoph Theuring (ctheuring) Philippe - I 100% agree with you. |
Commented by: @asfernandes Philippe, the tickets you mentioned mentions RFC4122 always explicitly meaning its string representation. FWIW, I consider funny a group of people meeting to create a RFC to generate random numbers that's not so random. I was no idea about these peculiarities. Then in FEB-2010, it was asked (UUID is not RFC 4122 compliant on posix) in fb-devel and I replied: At parallel discussion, there were no real objections to maintain non-compliant UUIDs. And the problem is not with generate function. It could be changed and generate compliant numbers. But functions CHAR_TO_UUID and UUID_TO_CHAR should not change their behaviors. So if you want to make it right, maybe is better to wait for when we had a GUID data type. |
Commented by: @pmakowski The problem is that even in release note we claim that we use "RFC4122-compliant form", in fact it is wrong, as Vlad proved it |
Commented by: Christoph Theuring (ctheuring) What's facts: |
Commented by: @pmakowski any news on this bug ? |
Commented by: @asfernandes As I said, GEN_UUID can be changed, but it's string conversion functions are over. No way. Is that GEN_UUID only change that's being requested here? |
Commented by: @pmakowski no let GEN_UUID and UUID_TO_CHAR and CHAR_TO_UUID like they are and add new implementation RFC4122 compliant at least V4 today all the uuid stuff firebird compliant only and even give different result on different plateforms see the simple Vlad test under windows : UUID_TXT VERID1 VERID2 that's bad |
Commented by: Christoph Theuring (ctheuring) Philippe - 100% agree again Christoph Theuring |
Commented by: @pmakowski LGPL is not ok for us |
Commented by: @asfernandes I don't think we should import more sources in our tree, since we already get rid of ICU ones, and distros don't like it. At least in ubuntu there is libuuid/uuid-dev, which appears to be a different package than the one you mentioned. License below: ---------------------------------- Upstream Author: Theodore Ts'o <mailto:tytso@mit.edu> Copyright: Copyright (C) 1999, 2000, 2003, 2004 by Theodore Ts'o Redistribution and use in source and binary forms, with or without THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED |
Commented by: @asfernandes Or even much better. Define FB uuid as version 4 (random) only, and fix the version field. We don't need a new GEN_UUID function. Current one works ok in Windows already, and the fix for POSIX will not cause any problem. |
Commented by: @pmakowski ok with your last proposal Version 4 (random) Version 4 UUIDs use a scheme relying only on random numbers. This algorithm sets the version number as well as two reserved bits. All other bits are set using a random or pseudorandom data source. |
Modified by: @asfernandesVersion: 2.5.1 [ 10333 ] Component: Engine [ 10000 ] assignee: Adriano dos Santos Fernandes [ asfernandes ] summary: the uuid_to_char(gen_uuid()) function/s create (or convert ?) not a valid rfc4122 UUID => Makes GEN_UUID return a compliant RFC-4122 binary UUID and introduce CHAR_TO_UUID2 and UUID_TO_CHAR2 to convert UUIDs from/to string also complying with the RFC |
Modified by: @asfernandes |
Modified by: @asfernandesstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 3.0 Alpha 1 [ 10331 ] Fix Version: 2.5.2 [ 10450 ] |
Commented by: @asfernandes Renaming ticket and reworking on the solution without CHAR_TO_UUID2 and UUID_TO_CHAR2. |
Modified by: @asfernandessummary: Makes GEN_UUID return a compliant RFC-4122 binary UUID and introduce CHAR_TO_UUID2 and UUID_TO_CHAR2 to convert UUIDs from/to string also complying with the RFC => Makes GEN_UUID return a compliant RFC-4122 UUID. |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: Christoph Theuring (ctheuring)
Relate to DOC74
Attachments:
rfc4122.txt
In compliance with rfc4122 every UUID gives his (build)version at the 1st digit of the 3rd block and ALL generated UUIDs with the same code MUST have the SAME digit at this place xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx (this is an example for a version 4 UUID)
The FireBird UUID is a version 4 UUID (?) and must have the digit 4 at this place. But
- every time you generate an UUID THIS digit is different
- THIS digit is mostly NOT a '4'
examples of created UUIDs with FireBird 2.5.0 with SELECT uuid_to_char(gen_uuid()) FROM RDB$DATABASE;
A2A1ED80-1824-101D-C7A6-382DB19A57D1 -> seems to be version 1
AE5E1BCF-E6F2-4D93-5517-B23DDCE6F579 -> seems to be version 4
FF1259D0-87D6-8787-D926-1F7E162A4FE1 -> no legal version
8B0E0580-ED77-360C-7D89-37B69FE1E3C5 -> seems to be a version 3
Include in my FreeAdhocUDF there are functions to create UUIDs of version 1 and 4 - and a UDF to read the version from a generated UUID - see http://freeadhocudf.org/documentation_english/dok_eng_uuid.html also with a description
Commits: b31f4d9 87d19fb e616957 6b364d8 1bb24e6
The text was updated successfully, but these errors were encountered: